function backendCase::testBackendSetResult

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

Covers the following target responsibilities.

  • Insures that backend_set_result is returned in --backend mode
  • Insures that the result code for the function does not overwrite the explicitly-set value

File

tests/backendTest.php, line 134
We choose to test the backend system in two parts. - Origin. These tests assure that we are generate a proper ssh command when a backend invoke is needed. - Target. These tests assure that drush generates a delimited JSON array …

Class

backendCase

Code

function testBackendSetResult() {
  $php = "drush_backend_set_result('foo'); return 'bar'";
  $this->drush('php-eval', array($php), array('backend' => NULL));
  $parsed = parse_backend_output($this->getOutput());
  // assert that $parsed has 'foo' and not 'bar'
  $this->assertEquals("'foo'", var_export($parsed['object'], TRUE));
}