X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fspecials%2Fpagers%2FBlockListPagerTest.php;h=a0291509cb7396dce097f72d64a82bb7793bb063;hb=5a451fd01be397db3209c1881a335423706da5c2;hp=bd37c04cd5d5108af8cad97a158d637de5f27481;hpb=5166d5e8cb72038ebcda6986f7170e68717bb552;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php index bd37c04cd5..a0291509cb 100644 --- a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php +++ b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php @@ -1,5 +1,6 @@ linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); + } + /** * @covers ::formatValue * @dataProvider formatValueEmptyProvider @@ -29,7 +41,7 @@ class BlockListPagerTest extends MediaWikiTestCase { $expected = $expected ?? MWTimestamp::getInstance()->format( 'H:i, j F Y' ); $row = $row ?: new stdClass; - $pager = new BlockListPager( new SpecialPage(), [] ); + $pager = new BlockListPager( new SpecialPage(), [], $this->linkRenderer ); $wrappedPager = TestingAccessWrapper::newFromObject( $pager ); $wrappedPager->mCurrentRow = $row; @@ -117,7 +129,7 @@ class BlockListPagerTest extends MediaWikiTestCase { 'wgScript' => '/w/index.php', ] ); - $pager = new BlockListPager( new SpecialPage(), [] ); + $pager = new BlockListPager( new SpecialPage(), [], $this->linkRenderer ); $row = (object)[ 'ipb_id' => 0, @@ -197,7 +209,7 @@ class BlockListPagerTest extends MediaWikiTestCase { 'ipb_sitewide' => 1, 'ipb_timestamp' => $this->db->timestamp( wfTimestamp( TS_MW ) ), ]; - $pager = new BlockListPager( new SpecialPage(), [] ); + $pager = new BlockListPager( new SpecialPage(), [], $this->linkRenderer ); $pager->preprocessResults( [ $row ] ); foreach ( $links as $link ) { @@ -210,7 +222,7 @@ class BlockListPagerTest extends MediaWikiTestCase { 'by_user_name' => 'Admin', 'ipb_sitewide' => 1, ]; - $pager = new BlockListPager( new SpecialPage(), [] ); + $pager = new BlockListPager( new SpecialPage(), [], $this->linkRenderer ); $pager->preprocessResults( [ $row ] ); $this->assertObjectNotHasAttribute( 'ipb_restrictions', $row ); @@ -222,7 +234,7 @@ class BlockListPagerTest extends MediaWikiTestCase { $target = '127.0.0.1'; // Test Partial Blocks Blocks. - $block = new Block( [ + $block = new DatabaseBlock( [ 'address' => $target, 'by' => $this->getTestSysop()->getUser()->getId(), 'reason' => 'Parce que', @@ -236,7 +248,7 @@ class BlockListPagerTest extends MediaWikiTestCase { $result = $this->db->select( 'ipblocks', [ '*' ], [ 'ipb_id' => $block->getId() ] ); - $pager = new BlockListPager( new SpecialPage(), [] ); + $pager = new BlockListPager( new SpecialPage(), [], $this->linkRenderer ); $pager->preprocessResults( $result ); $wrappedPager = TestingAccessWrapper::newFromObject( $pager ); @@ -247,7 +259,7 @@ class BlockListPagerTest extends MediaWikiTestCase { $restriction = $restrictions[0]; $this->assertEquals( $page->getId(), $restriction->getValue() ); $this->assertEquals( $page->getId(), $restriction->getTitle()->getArticleID() ); - $this->assertEquals( $title->getDBKey(), $restriction->getTitle()->getDBKey() ); + $this->assertEquals( $title->getDBkey(), $restriction->getTitle()->getDBkey() ); $this->assertEquals( $title->getNamespace(), $restriction->getTitle()->getNamespace() ); // Delete the block and the restrictions.