getTestUser( 'suppress' )->getUser() : $this->getTestUser()->getUser(); $this->assertSame( $expected, AbuseFilter::userCanViewRev( $revRec, $user ) ); } /** * @return Generator|array */ public function provideUserCanViewRev() { $title = Title::newFromText( __METHOD__ ); $visible = new MutableRevisionRecord( $title ); yield 'Visible, not privileged' => [ $visible, false, true ]; yield 'Visible, privileged' => [ $visible, true, true ]; $userSup = new MutableRevisionRecord( $title ); $userSup->setVisibility( RevisionRecord::SUPPRESSED_USER ); yield 'User suppressed, not privileged' => [ $userSup, false, false ]; yield 'User suppressed, privileged' => [ $userSup, true, true ]; $allSupp = new MutableRevisionRecord( $title ); $allSupp->setVisibility( RevisionRecord::SUPPRESSED_ALL ); yield 'All suppressed, not privileged' => [ $allSupp, false, false ]; yield 'All suppressed, privileged' => [ $allSupp, true, true ]; } }