function Drush_TestCase::getOutputFromJSON

6.x drush_testcase.inc Drush_TestCase::getOutputFromJSON($key = NULL)

Accessor for the last output, decoded from json.

Parameters

key Optionally return only a top level element from the json object.: @return array Output as php stdClass object. @access public

8 calls to Drush_TestCase::getOutputFromJSON()
cacheCommandCase::testCacheGetSetClear in tests/cacheCommandTest.php
commandCase::testInvoke in tests/commandTest.php
contextCase::ConfigSearchPaths in tests/contextTest.php
Assure that all possible config files get loaded.
contextCase::ConfigVersionSpecific in tests/contextTest.php
Assure that matching version-specific config files are loaded and others are ignored.
coreCase::testCoreRequirements in tests/coreTest.php

... See full list

File

tests/drush_testcase.inc, line 214
Initialize a sandboxed environment. Starts with call unish_init() at bottom.

Class

Drush_TestCase

Code

function getOutputFromJSON($key = NULL) {
  $json = json_decode(current($this->_output));
  if (isset($key)) {
    $json = $json->{$key}; // http://stackoverflow.com/questions/2925044/hyphens-in-keys-of-object
  }
  return $json;
}