X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitleArrayFromResultTest.php;h=af49ecf73ab7ea056765f33ecf22d66f8ef10695;hp=f06208b3e0a878ddea22c41fae215f92c5663aa9;hb=63d96c15fde8d4d2842aa50c5ed2ce594aa0c674;hpb=995449ef039b769a613ddf3731ece1e4c20d358c diff --git a/tests/phpunit/includes/TitleArrayFromResultTest.php b/tests/phpunit/includes/TitleArrayFromResultTest.php index f06208b3e0..af49ecf73a 100644 --- a/tests/phpunit/includes/TitleArrayFromResultTest.php +++ b/tests/phpunit/includes/TitleArrayFromResultTest.php @@ -4,10 +4,12 @@ * @author Addshore * @covers TitleArrayFromResult */ -class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { +class TitleArrayFromResultTest extends PHPUnit\Framework\TestCase { + + use MediaWikiCoversValidator; private function getMockResultWrapper( $row = null, $numRows = 1 ) { - $resultWrapper = $this->getMockBuilder( 'ResultWrapper' ) + $resultWrapper = $this->getMockBuilder( Wikimedia\Rdbms\ResultWrapper::class ) ->disableOriginalConstructor(); $resultWrapper = $resultWrapper->getMock(); @@ -59,17 +61,17 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { $this->assertEquals( $resultWrapper, $object->res ); $this->assertSame( 0, $object->key ); - $this->assertInstanceOf( 'Title', $object->current ); + $this->assertInstanceOf( Title::class, $object->current ); $this->assertEquals( $namespace, $object->current->mNamespace ); $this->assertEquals( $title, $object->current->mTextform ); } public static function provideNumberOfRows() { - return array( - array( 0 ), - array( 1 ), - array( 122 ), - ); + return [ + [ 0 ], + [ 1 ], + [ 122 ], + ]; } /** @@ -92,16 +94,16 @@ class TitleArrayFromResultTest extends PHPUnit_Framework_TestCase { $title = 'foo'; $row = $this->getRowWithTitle( $namespace, $title ); $object = $this->getTitleArrayFromResult( $this->getMockResultWrapper( $row ) ); - $this->assertInstanceOf( 'Title', $object->current() ); + $this->assertInstanceOf( Title::class, $object->current() ); $this->assertEquals( $namespace, $object->current->mNamespace ); $this->assertEquals( $title, $object->current->mTextform ); } public function provideTestValid() { - return array( - array( $this->getRowWithTitle(), true ), - array( false, false ), - ); + return [ + [ $this->getRowWithTitle(), true ], + [ false, false ], + ]; } /**