Merge "Force $wgCategoryCollation to be uppercase in tests"
[lhc/web/wiklou.git] / tests / phpunit / includes / db / TestORMRowTest.php
index c7bea3b..263553a 100644 (file)
@@ -78,15 +78,24 @@ class TestORMRowTest extends ORMRowTest {
                                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,
@@ -98,6 +107,22 @@ class TestORMRowTest extends ORMRowTest {
                );
        }
 
+       /**
+        * @since 1.21
+        * @return array
+        */
+       protected function getMockValues() {
+               return array(
+                       'id' => 1,
+                       'str' => 'foobar4645645',
+                       'int' => 42,
+                       'float' => 4.2,
+                       'bool' => '',
+                       'array' => array( 42, 'foobar' ),
+                       'blob' => new stdClass()
+               );
+       }
+
 }
 
 class TestORMRow extends ORMRow {}
@@ -155,7 +180,7 @@ class TestORMTable extends ORMTable {
                        'awesome' => 'bool',
                        'stuff' => 'array',
                        'moarstuff' => 'blob',
-                       'time' => 'int', // TS_MW
+                       'time' => 'str', // TS_MW
                );
        }