23 $userMock = $this->getMock( User::class, [
'getEditCount' ] );
24 if ( $requirement > 0 ) {
25 $userMock->expects( $this->once() )
26 ->method(
'getEditCount' )
27 ->willReturn( $editCount );
29 $userMock->expects( $this->never() )
30 ->method(
'getEditCount' );
34 if ( $editCount >= $requirement ) {
35 $this->assertContains(
38 'User must be promoted if they meet edit count requirement'
41 $this->assertNotContains(
44 'User must not be promoted if they fail edit count requirement'