function coreCase::testCoreRequirements

8.0.x coreTest.php coreCase::testCoreRequirements()
6.x coreTest.php coreCase::testCoreRequirements()
7.x coreTest.php coreCase::testCoreRequirements()
5.x coreTest.php coreCase::testCoreRequirements()
master coreTest.php coreCase::testCoreRequirements()

File

tests/coreTest.php, line 124

Namespace

Unish

Class

coreCase
Tests for core commands.

Code

function testCoreRequirements() {
  $root = $this->webroot();
  $options = array(
    'root' => $root,
    'uri' => key($this->getSites()),
    'pipe' => NULL,
    'ignore' => 'cron,http requests,update,update_core,trusted_host_patterns', // no network access when running in tests, so ignore these
    'strict' => 0, // invoke from script: do not verify options
  );
  // Verify that there are no severity 2 items in the status report
  $this->drush('core-requirements', array(), $options + array('severity' => '2'));
  $output = $this->getOutput();
  $this->assertEquals('', $output);

  $this->drush('core-requirements', array(), $options);
  $loaded = $this->getOutputFromJSON();
  // Pick a subset that are valid for D6/D7/D8.
  $expected = array(
    
    // 'install_profile' => -1,
    // 'node_access' => -1,
    'php' => -1,
    
    // 'php_extensions' => -1,
    'php_memory_limit' => -1,
    'php_register_globals' => -1,
    'settings.php' => -1,
  );
  foreach ($expected as $key => $value) {
    if (isset($loaded->$key)) {
      $this->assertEquals($value, $loaded->$key->sid);
    }
  }
}