* @copyright Curverider Ltd 2008-2009 * @link http://elgg.org/ */ /** * Elgg test result object. * This class is used to return the values of the test in order to generate a report. */ class ElggTestResult { /** * Textual description of the test being performed (used for reporting). * * @var string */ private $details; /** * Boolean, true if the test was executed successfully - false if not. * * @var bool */ private $successful; /** * Any debug information for the report. * * @var string */ private $debug; /** * Create a test result object. * */ function __construct($success, $details = "", $debug = "") { $success = (bool)$success; $this->successful = $success; $this->details = $details; $this->debug = $debug; } /** * Factory function to generate a successful result. * */ static public function CreateSuccessResult($details) { return new ElggTestResult(true, $details); } /** * Factory function to generate a successful result. * */ static public function CreateFailResult($details, $debug = "") { return new ElggTestResult(false, $details, $debug); } } function testing_execute_tests() { $report = array(); // An array to be populated with ElggTestResult objects $report = trigger_plugin_hook('test', 'test', null, $report); return $report; } ?>