X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fpoolcounter%2FPoolWorkArticleViewTest.php;h=47adfc00f0a3baacdcccd3ae6e94ca2be660d7e8;hb=5174fa8364c95ac8df9d076dbec51b70e086e01a;hp=c6b9deeff4ce09b58a08583b4d59cb75428e9aec;hpb=ede4b68c2bff5d596663a83b17e7ee1ff8da6981;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/poolcounter/PoolWorkArticleViewTest.php b/tests/phpunit/includes/poolcounter/PoolWorkArticleViewTest.php index c6b9deeff4..47adfc00f0 100644 --- a/tests/phpunit/includes/poolcounter/PoolWorkArticleViewTest.php +++ b/tests/phpunit/includes/poolcounter/PoolWorkArticleViewTest.php @@ -2,6 +2,7 @@ use MediaWiki\MediaWikiServices; use MediaWiki\Storage\MutableRevisionRecord; use MediaWiki\Storage\RevisionRecord; +use MediaWiki\Storage\SlotRecord; /** * @covers PoolWorkArticleView @@ -13,7 +14,7 @@ class PoolWorkArticleViewTest extends MediaWikiTestCase { $user = $this->getTestUser()->getUser(); $updater = $page->newPageUpdater( $user ); - $updater->setContent( 'main', new WikitextContent( $text ) ); + $updater->setContent( SlotRecord::MAIN, new WikitextContent( $text ) ); return $updater->saveRevision( CommentStoreComment::newUnsavedComment( 'testing' ) ); } @@ -57,7 +58,7 @@ class PoolWorkArticleViewTest extends MediaWikiTestCase { $fakeRev = new MutableRevisionRecord( $page->getTitle() ); $fakeRev->setId( $rev->getId() ); $fakeRev->setPageId( $page->getId() ); - $fakeRev->setContent( 'main', new WikitextContent( 'YES!' ) ); + $fakeRev->setContent( SlotRecord::MAIN, new WikitextContent( 'YES!' ) ); $work = new PoolWorkArticleView( $page, $options, $rev->getId(), false, $fakeRev ); $work->execute(); @@ -157,12 +158,16 @@ class PoolWorkArticleViewTest extends MediaWikiTestCase { $fakeRev = new MutableRevisionRecord( $page->getTitle() ); $fakeRev->setId( $rev1->getId() ); $fakeRev->setPageId( $page->getId() ); - $fakeRev->setContent( 'main', new WikitextContent( 'SECRET' ) ); + $fakeRev->setContent( SlotRecord::MAIN, new WikitextContent( 'SECRET' ) ); $fakeRev->setVisibility( RevisionRecord::DELETED_TEXT ); $work = new PoolWorkArticleView( $page, $options, $rev1->getId(), false, $fakeRev ); $this->assertFalse( $work->execute() ); + $work = new PoolWorkArticleView( $page, $options, $rev1->getId(), false, $fakeRev, + RevisionRecord::RAW ); + $this->assertNotFalse( $work->execute() ); + // a deleted current revision should still be show $fakeRev->setId( $rev2->getId() ); $work = new PoolWorkArticleView( $page, $options, $rev2->getId(), false, $fakeRev );