private function makeMakefileCase::runMakefileTest

8.0.x makeTest.php private makeMakefileCase::runMakefileTest($test)
6.x makeTest.php private makeMakefileCase::runMakefileTest($test)
7.x makeTest.php private makeMakefileCase::runMakefileTest($test)
5.x makeTest.php private makeMakefileCase::runMakefileTest($test)
master makeTest.php private makeMakefileCase::runMakefileTest($test)

Run a given makefile test.

Parameters

$test: The test makefile to run, as defined by $this->getMakefile();

File

tests/makeTest.php, line 27

Class

makeMakefileCase
Make makefile tests. @group make @group slow

Code

private function runMakefileTest($test) {
  $default_options = array(
    'test' => NULL,
    'md5' => 'print',
  );
  $config = $this->getMakefile($test);
  $options = array_merge($config['options'], $default_options);
  $makefile = $this->makefile_path . DIRECTORY_SEPARATOR . $config['makefile'];
  $return = !empty($config['fail']) ? self::EXIT_ERROR : self::EXIT_SUCCESS;
  $this->drush('make', array($makefile), $options, NULL, NULL, $return);

  // Check the log for the build hash if this test should pass.
  if (empty($config['fail'])) {
    $output = $this->getOutput();
    $this->assertContains($config['md5'], $output, $config['name'] . ' - build md5 matches expected value: ' . $config['md5']);
  }
}