X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitleArrayFromResultTest.php;h=32c757101aa9d9c497a17d7290a7a300af016cc9;hb=55ea37b674f6f70d7c7fed94f76afaa0ccacfc90;hp=63956c123a4b2f2ab83534728a16f9858f7fd9c2;hpb=4eff5204d9ec6eb09df70d2fe017a2146cfa4238;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TitleArrayFromResultTest.php b/tests/phpunit/includes/TitleArrayFromResultTest.php index 63956c123a..32c757101a 100644 --- a/tests/phpunit/includes/TitleArrayFromResultTest.php +++ b/tests/phpunit/includes/TitleArrayFromResultTest.php @@ -4,7 +4,7 @@ * @author Addshore * @covers TitleArrayFromResult */ -class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { +class TitleArrayFromResultTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; @@ -30,10 +30,6 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { return $row; } - private function getTitleArrayFromResult( $resultWrapper ) { - return new TitleArrayFromResult( $resultWrapper ); - } - /** * @covers TitleArrayFromResult::__construct */ @@ -41,7 +37,7 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { $row = false; $resultWrapper = $this->getMockResultWrapper( $row ); - $object = $this->getTitleArrayFromResult( $resultWrapper ); + $object = new TitleArrayFromResult( $resultWrapper ); $this->assertEquals( $resultWrapper, $object->res ); $this->assertSame( 0, $object->key ); @@ -57,7 +53,7 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { $row = $this->getRowWithTitle( $namespace, $title ); $resultWrapper = $this->getMockResultWrapper( $row ); - $object = $this->getTitleArrayFromResult( $resultWrapper ); + $object = new TitleArrayFromResult( $resultWrapper ); $this->assertEquals( $resultWrapper, $object->res ); $this->assertSame( 0, $object->key ); @@ -79,7 +75,7 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { * @covers TitleArrayFromResult::count */ public function testCountWithVaryingValues( $numRows ) { - $object = $this->getTitleArrayFromResult( $this->getMockResultWrapper( + $object = new TitleArrayFromResult( $this->getMockResultWrapper( $this->getRowWithTitle(), $numRows ) ); @@ -93,7 +89,7 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { $namespace = 0; $title = 'foo'; $row = $this->getRowWithTitle( $namespace, $title ); - $object = $this->getTitleArrayFromResult( $this->getMockResultWrapper( $row ) ); + $object = new TitleArrayFromResult( $this->getMockResultWrapper( $row ) ); $this->assertInstanceOf( Title::class, $object->current() ); $this->assertEquals( $namespace, $object->current->mNamespace ); $this->assertEquals( $title, $object->current->mTextform ); @@ -111,7 +107,7 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { * @covers TitleArrayFromResult::valid */ public function testValid( $input, $expected ) { - $object = $this->getTitleArrayFromResult( $this->getMockResultWrapper( $input ) ); + $object = new TitleArrayFromResult( $this->getMockResultWrapper( $input ) ); $this->assertEquals( $expected, $object->valid() ); }