/** * Check if input test is active * * @param Test $test * @param Suite $suite * @return boolean */ public function isValid(Test $test, Suite $suite) { return $this->isActive() ? $this->name && $test->getName() === $this->name || $this->type && $test->getType() === $this->type || $this->group && $suite->getCurrentGroupName() === $this->group : true; }
/** * Given a test, run the Codeception test. * * @param Test $test Current test to Run. * @return Test $test Updated test with log and result. */ public function run(Test $test) { // Get the full command path to run the test. $command = $this->getCommandPath($test->getType(), $test->getFilename()); // Attempt to set the correct writes to Codeceptions Log path. @chmod($this->getLogPath(), 0777); // Run the helper function (as it's not specific to Codeception) // which returns the result of running the terminal command into an array. $output = run_terminal_command($command); // Add the log to the test which also checks to see if there was a pass/fail. $test->setLog($output); return $test; }
</div>'; } break; case "view": if (isset($_REQUEST["target"])) { $target = $_REQUEST["target"]; $test = new Test($target); $pageBody .= ' <table class="pretty"> <tr> <th>date</th> <td>' . $test->getStartDate() . '</td> </tr> <tr> <th>type</th> <td>' . $testTypes[$test->getType()] . '</td> </tr> <tr> <th>start year</th> <td>' . $test->getStartYear() . '</td> </tr> <tr> <th>stop year</th> <td>' . $test->getStopYear() . '</td> </tr> </table>'; } else { $pageBody .= ' <div class="dialog error"> <p>No test to view was specified, perhaps you can identify one <a href="?section=subjects&action=list">here</a>?</p> </div>';