class UserArrayFromResultTest extends MediaWikiTestCase {
private function getMockResultWrapper( $row = null, $numRows = 1 ) {
- $resultWrapper = $this->getMockBuilder( 'ResultWrapper' )
+ $resultWrapper = $this->getMockBuilder( Wikimedia\Rdbms\ResultWrapper::class )
->disableOriginalConstructor();
$resultWrapper = $resultWrapper->getMock();
$this->assertEquals( $resultWrapper, $object->res );
$this->assertSame( 0, $object->key );
- $this->assertInstanceOf( 'User', $object->current );
+ $this->assertInstanceOf( User::class, $object->current );
$this->assertEquals( $username, $object->current->mName );
}
public static function provideNumberOfRows() {
- return array(
- array( 0 ),
- array( 1 ),
- array( 122 ),
- );
+ return [
+ [ 0 ],
+ [ 1 ],
+ [ 122 ],
+ ];
}
/**
$username = 'addshore';
$userRow = $this->getRowWithUsername( $username );
$object = $this->getUserArrayFromResult( $this->getMockResultWrapper( $userRow ) );
- $this->assertInstanceOf( 'User', $object->current() );
+ $this->assertInstanceOf( User::class, $object->current() );
$this->assertEquals( $username, $object->current()->mName );
}
public function provideTestValid() {
- return array(
- array( $this->getRowWithUsername(), true ),
- array( false, false ),
- );
+ return [
+ [ $this->getRowWithUsername(), true ],
+ [ false, false ],
+ ];
}
/**