function cacheCommandCase::testCacheGet

8.0.x cacheCommandTest.php cacheCommandCase::testCacheGet()
7.x cacheCommandTest.php cacheCommandCase::testCacheGet()
master cacheCommandTest.php cacheCommandCase::testCacheGet()

File

tests/cacheCommandTest.php, line 18

Namespace

Unish

Class

cacheCommandCase
Cache command testing.

Code

function testCacheGet() {
  $options = $this->getOptions();
  // Test the cache get command.
  $inputs = array(
    6 => array('variables', NULL),
    7 => array('schema', NULL),
    8 => array('system.filter', 'config'),
  );
  list($key, $bin) = $inputs[UNISH_DRUPAL_MAJOR_VERSION];
  $this->drush('cache-get', array($key, $bin), $options + array('format' => 'json'));
  $schema = $this->getOutputFromJSON('data');
  $this->assertNotEmpty($schema);

  // Test that get-ing a non-existant cid fails.
  $this->drush('cache-get', array('test-failure-cid'), $options + array('format' => 'json'), NULL, NULL, self::EXIT_ERROR);
}