X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitleArrayFromResultTest.php;h=32c757101aa9d9c497a17d7290a7a300af016cc9;hb=55ea37b674f6f70d7c7fed94f76afaa0ccacfc90;hp=af49ecf73ab7ea056765f33ecf22d66f8ef10695;hpb=ec262cbb893e1675df9a87f4e41d3aa1a7d99156;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TitleArrayFromResultTest.php b/tests/phpunit/includes/TitleArrayFromResultTest.php index af49ecf73a..32c757101a 100644 --- a/tests/phpunit/includes/TitleArrayFromResultTest.php +++ b/tests/phpunit/includes/TitleArrayFromResultTest.php @@ -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() ); }