summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/db/ORMRowTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/db/ORMRowTest.php')
-rw-r--r--tests/phpunit/includes/db/ORMRowTest.php20
1 files changed, 6 insertions, 14 deletions
diff --git a/tests/phpunit/includes/db/ORMRowTest.php b/tests/phpunit/includes/db/ORMRowTest.php
index 9dcaf2b3..27d4d0e8 100644
--- a/tests/phpunit/includes/db/ORMRowTest.php
+++ b/tests/phpunit/includes/db/ORMRowTest.php
@@ -43,19 +43,19 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
* @since 1.20
* @return string
*/
- protected abstract function getRowClass();
+ abstract protected function getRowClass();
/**
* @since 1.20
* @return IORMTable
*/
- protected abstract function getTableInstance();
+ abstract protected function getTableInstance();
/**
* @since 1.20
* @return array
*/
- public abstract function constructorTestProvider();
+ abstract public function constructorTestProvider();
/**
* @since 1.20
@@ -76,6 +76,7 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
*/
protected function getRowInstance( array $data, $loadDefaults ) {
$class = $this->getRowClass();
+
return new $class( $this->getTableInstance(), $data, $loadDefaults );
}
@@ -136,7 +137,7 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
/**
* @dataProvider constructorTestProvider
*/
- public function testSave( array $data, $loadDefaults ) {
+ public function testSaveAndRemove( array $data, $loadDefaults ) {
$item = $this->getRowInstance( $data, $loadDefaults );
$this->assertTrue( $item->save() );
@@ -151,15 +152,6 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
$this->assertEquals( $id, $item->getId() );
$this->verifyFields( $item, $data );
- }
-
- /**
- * @dataProvider constructorTestProvider
- */
- public function testRemove( array $data, $loadDefaults ) {
- $item = $this->getRowInstance( $data, $loadDefaults );
-
- $this->assertTrue( $item->save() );
$this->assertTrue( $item->remove() );
@@ -231,4 +223,4 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
// TODO: test all of the methods!
-} \ No newline at end of file
+}