public function getRunResponse($type, $hash)
{
$response = array('message' => NULL, 'run' => FALSE, 'passed' => FALSE, 'state' => 'error', 'log' => NULL);
// If Codeceptions not properly configured, the test won't be found
// and it won't be run.
if (!$this->ready()) {
$response['message'] = 'The Codeception configuration could not be loaded.';
}
// If the test can't be found, we can't run the test.
if (!($test = $this->getTest($type, $hash))) {
$response['message'] = 'The test could not be found.';
}
// If there's no error message set yet, it means we're good to go!
if (is_null($response['message'])) {
// Run the test!
$test = $this->run($test);
$response['run'] = $test->ran();
$response['log'] = $test->getLog();
$response['passed'] = $test->passed();
$response['state'] = $test->getState();
$response['title'] = $test->getTitle();
}
return $response;
}