* @licence GNU GPL v2+
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
-require_once dirname( __FILE__ ) . "/ORMRowTest.php";
+require_once __DIR__ . "/ORMRowTest.php";
class TestORMRowTest extends ORMRowTest {
return TestORMTable::singleton();
}
- public function setUp() {
+ protected function setUp() {
parent::setUp();
$dbw = wfGetDB( DB_MASTER );
$idField = $isSqlite ? 'INTEGER' : 'INT unsigned';
$primaryKey = $isSqlite ? 'PRIMARY KEY AUTOINCREMENT' : 'auto_increment PRIMARY KEY';
- $dbw->safeQuery(
+ $dbw->query(
'CREATE TABLE IF NOT EXISTS ' . $dbw->tableName( 'orm_test' ) . '(
test_id ' . $idField . ' NOT NULL ' . $primaryKey . ',
test_name VARCHAR(255) NOT NULL,
test_stuff BLOB NOT NULL,
test_moarstuff BLOB NOT NULL,
test_time varbinary(14) NOT NULL
- );'
+ );',
+ __METHOD__
);
}
+ protected function tearDown() {
+ $dbw = wfGetDB( DB_MASTER );
+ $dbw->dropTable( 'orm_test', __METHOD__ );
+
+ parent::tearDown();
+ }
+
public function constructorTestProvider() {
return array(
array(
array(
'name' => 'Foobar',
+ 'time' => '20120101020202',
'age' => 42,
'height' => 9000.1,
'awesome' => true,
'awesome' => 'bool',
'stuff' => 'array',
'moarstuff' => 'blob',
- 'time' => 'int', // TS_MW
+ 'time' => 'str', // TS_MW
);
}