* @ingroup Testing
*/
-class DbTestRecorder extends DbTestPreviewer {
+class DbTestRecorder extends TestRecorder {
public $version;
+ private $db;
+
+ public function __construct( IDatabase $db ) {
+ $this->db = $db;
+ }
/**
* Set up result recording; insert a record for the run with the date
echo "OK, resuming.\n";
}
- parent::start();
-
$this->db->insert( 'testrun',
[
'tr_date' => $this->db->timestamp(),
/**
* Record an individual test item's success or failure to the db
*
- * @param string $test
- * @param bool $result
+ * @param array $test
+ * @param ParserTestResult $result
*/
- function record( $test, $subtest, $result ) {
- parent::record( $test, $subtest, $result );
-
+ function record( $test, ParserTestResult $result ) {
$this->db->insert( 'testitem',
[
'ti_run' => $this->curRun,
- 'ti_name' => $this->getName( $test, $subtest ),
- 'ti_success' => $result ? 1 : 0,
+ 'ti_name' => $test['desc'],
+ 'ti_success' => $result->isSuccess() ? 1 : 0,
],
__METHOD__ );
}
*/
function end() {
$this->db->commit( __METHOD__ );
- parent::end();
}
}
-