function backendCase::testOrigin

8.0.x backendTest.php backendCase::testOrigin()
6.x backendTest.php backendCase::testOrigin()
7.x backendTest.php backendCase::testOrigin()
4.x backendTest.php backendCase::testOrigin()
5.x backendTest.php backendCase::testOrigin()
master backendTest.php backendCase::testOrigin()

File

tests/backendTest.php, line 26

Class

backendCase

Code

function testOrigin() {
  $exec = sprintf('%s %s version --simulate --ssh-options=%s | grep ssh', self::escapeshellarg(UNISH_DRUSH), self::escapeshellarg('user@server/path/to/drupal#sitename'), self::escapeshellarg('-i mysite_dsa'));
  $this->execute($exec);
  // $expected might be different on non unix platforms. We shall see.
  $expected = "proc_open: ssh -i mysite_dsa 'user'@'server' 'drush  --uri='\''sitename'\'' --root='\''/path/to/drupal'\'' --simulate version --backend 2>&1'  2>&1";
  $output = $this->getOutput();
  $this->assertEquals($expected, $output, 'Expected ssh command was built');
}