function backendCase::testBackendMethodGet

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

Covers the following target responsibilities.

  • Insures that arrays are stripped when using --backend mode's method GET
  • Insures that arrays can be returned as the function result of backend invoke.

File

tests/backendTest.php, line 181

Namespace

Unish

Class

backendCase
We choose to test the backend system in two parts.

Code

function testBackendMethodGet() {
  $options = array(
    'backend' => NULL,
    'include' => dirname(__FILE__), // Find unit.drush.inc commandfile.
  );
  $php = "\$values = drush_invoke_process('@none', 'unit-return-options', array('value'), array('x' => 'y', 'strict' => 0, 'data' => array('a' => 1, 'b' => 2)), array('method' => 'GET')); return array_key_exists('object', \$values) ? \$values['object'] : 'no result';";
  $this->drush('php-eval', array($php), $options);
  $parsed = $this->parse_backend_output($this->getOutput());
  // assert that $parsed has 'x' but not 'data'
  $this->assertEquals("array (
  'x' => 'y',
)", var_export($parsed['object'], TRUE));
}