$this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
$this->assertSame( 0, self::$lastNotifyArgs[5] );
$this->assertSame( 0, self::$lastNotifyArgs[6] );
- $this->assertEquals( null, self::$lastNotifyArgs[7] );
+ $this->assertNull( self::$lastNotifyArgs[7] );
$this->assertEquals( 1, self::$lastNotifyArgs[8] );
- $this->assertEquals( null, self::$lastNotifyArgs[9] );
+ $this->assertSame( '', self::$lastNotifyArgs[9] );
$this->assertSame( 0, self::$lastNotifyArgs[10] );
}
$this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
$this->assertSame( 0, self::$lastNotifyArgs[5] );
$this->assertSame( 0, self::$lastNotifyArgs[6] );
- $this->assertEquals( null, self::$lastNotifyArgs[7] );
+ $this->assertNull( self::$lastNotifyArgs[7] );
$this->assertEquals( 1, self::$lastNotifyArgs[8] );
- $this->assertEquals( null, self::$lastNotifyArgs[9] );
+ $this->assertSame( '', self::$lastNotifyArgs[9] );
$this->assertSame( 0, self::$lastNotifyArgs[10] );
}
$this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
$this->assertEquals( self::$pageRev->getParentId(), self::$lastNotifyArgs[5] );
$this->assertEquals( $revision->getId(), self::$lastNotifyArgs[6] );
- $this->assertEquals( null, self::$lastNotifyArgs[7] );
+ $this->assertNull( self::$lastNotifyArgs[7] );
$this->assertSame( 0, self::$lastNotifyArgs[8] );
$this->assertEquals( '127.0.0.1', self::$lastNotifyArgs[9] );
$this->assertSame( 0, self::$lastNotifyArgs[10] );
$this->assertEquals( self::$pageName, self::$lastNotifyArgs[4]->getPrefixedText() );
$this->assertEquals( self::$pageRev->getParentId(), self::$lastNotifyArgs[5] );
$this->assertEquals( $revision->getId(), self::$lastNotifyArgs[6] );
- $this->assertEquals( null, self::$lastNotifyArgs[7] );
+ $this->assertNull( self::$lastNotifyArgs[7] );
$this->assertSame( 0, self::$lastNotifyArgs[8] );
$this->assertEquals( '127.0.0.1', self::$lastNotifyArgs[9] );
$this->assertSame( 0, self::$lastNotifyArgs[10] );
$this->assertEquals( 'hello world.', $wikitext,
'Wikitext passed to hook was not as expected'
);
- $this->assertEquals( null, $redirectTarget, 'Redirect seen in hook was not null' );
+ $this->assertNull( $redirectTarget, 'Redirect seen in hook was not null' );
$this->assertEquals( $title, $options->getRedirectTarget(),
'ParserOptions\' redirectTarget was changed'
);
$redirectTarget->getFullText(),
'Redirect seen in hook was not the expected title'
);
- $this->assertEquals(
- null,
+ $this->assertNull(
$options->getRedirectTarget(),
'ParserOptions\' redirectTarget was changed'
);
$cpIndex = null;
$cp->shutdown( null, 'sync', $cpIndex );
- $this->assertEquals( null, $cpIndex, "CP write index retained" );
+ $this->assertNull( $cpIndex, "CP write index retained" );
$this->assertEquals( '45e93a9c215c031d38b7c42d8e4700ca', $cp->getClientId() );
}
$lb = $this->newSingleServerLocalLoadBalancer();
$i = $lb->getWriterIndex();
- $this->assertEquals( null, $lb->getAnyOpenConnection( $i ) );
+ $this->assertFalse( $lb->getAnyOpenConnection( $i ) );
$conn1 = $lb->getConnection( $i );
$this->assertNotEquals( null, $conn1 );
$this->assertFalse( $conn2->getFlag( DBO_TRX ) );
if ( $lb->getServerAttributes( $i )[Database::ATTR_DB_LEVEL_LOCKING] ) {
- $this->assertEquals( null,
+ $this->assertFalse(
$lb->getAnyOpenConnection( $i, $lb::CONN_TRX_AUTOCOMMIT ) );
$this->assertEquals( $conn1,
$lb->getConnection(
$tmpFile = $this->backend->getLocalCopy( [
'src' => "$base/unittest-cont1/not-there" ] );
- $this->assertEquals( null, $tmpFile, "Local copy of not existing file is null ($backendName)." );
+ $this->assertNull( $tmpFile, "Local copy of not existing file is null ($backendName)." );
$tmpFile = $this->backend->getLocalReference( [
'src' => "$base/unittest-cont1/not-there" ] );
- $this->assertEquals( null, $tmpFile, "Local ref of not existing file is null ($backendName)." );
+ $this->assertNull( $tmpFile, "Local ref of not existing file is null ($backendName)." );
}
/**
"Scoped locking of files succeeded with OK status ($backendName)." );
ScopedLock::release( $sl );
- $this->assertEquals( null, $sl,
+ $this->assertNull( $sl,
"Scoped unlocking of files succeeded ($backendName)." );
$this->assertEquals( [], $status->getErrors(),
"Scoped unlocking of files succeeded ($backendName)." );
$v = $cache->getWithSetCallback(
$key, 30, $checkFunc, [ 'staleTTL' => 50 ] + $extOpts );
$this->assertEquals( 'xxx1', $v, "Value returned" );
- $this->assertEquals( false, $oldValReceived, "Callback got no stale value" );
- $this->assertEquals( null, $oldAsOfReceived, "Callback got no stale value" );
+ $this->assertFalse( $oldValReceived, "Callback got no stale value" );
+ $this->assertNull( $oldAsOfReceived, "Callback got no stale value" );
$mockWallClock += 40;
$v = $cache->getWithSetCallback(
$key, 30, $checkFunc, [ 'staleTTL' => 50 ] + $extOpts );
$this->assertEquals( 'xxx3', $v, "Value still returned after expired" );
$this->assertEquals( 3, $wasSet, "Value recalculated while expired" );
- $this->assertEquals( false, $oldValReceived, "Callback got no stale value" );
- $this->assertEquals( null, $oldAsOfReceived, "Callback got no stale value" );
+ $this->assertFalse( $oldValReceived, "Callback got no stale value" );
+ $this->assertNull( $oldAsOfReceived, "Callback got no stale value" );
$mockWallClock = ( $priorTime - $cache::HOLDOFF_TTL - 1 );
$wasSet = 0;
);
$this->assertEquals( 'xxx1', $v, "Value returned" );
$this->assertEquals( 1, $wasSet, "Value computed" );
- $this->assertEquals( false, $oldValReceived, "Callback got no stale value" );
- $this->assertEquals( null, $oldAsOfReceived, "Callback got no stale value" );
+ $this->assertFalse( $oldValReceived, "Callback got no stale value" );
+ $this->assertNull( $oldAsOfReceived, "Callback got no stale value" );
$mockWallClock += $cache::TTL_HOUR; // some time passes
$v = $cache->getWithSetCallback(
$this->assertEquals( $valueV2, $v, "Value returned" );
$this->assertEquals( 1, $wasSet, "Value regenerated" );
$this->assertEquals( false, $priorValue, "Old value not given due to old format" );
- $this->assertEquals( null, $priorAsOf, "Old value not given due to old format" );
+ $this->assertNull( $priorAsOf, "Old value not given due to old format" );
$wasSet = 0;
$v = $cache->getWithSetCallback( $key, 30, $funcV2, $verOpts + $extOpts );
*/
public function testGetDateRangeCondInvalid( $start, $end ) {
$pager = $this->getMockForAbstractClass( RangeChronologicalPager::class );
- $this->assertEquals( null, $pager->getDateRangeCond( $start, $end ) );
+ $this->assertNull( $pager->getDateRangeCond( $start, $end ) );
}
public function getDateRangeCondInvalidProvider() {
// Request parameters
$this->assertEquals( [], $ctx->getModules() );
$this->assertEquals( 'qqx', $ctx->getLanguage() );
- $this->assertEquals( false, $ctx->getDebug() );
- $this->assertEquals( null, $ctx->getOnly() );
+ $this->assertFalse( $ctx->getDebug() );
+ $this->assertNull( $ctx->getOnly() );
$this->assertEquals( 'fallback', $ctx->getSkin() );
- $this->assertEquals( null, $ctx->getUser() );
+ $this->assertNull( $ctx->getUser() );
$this->assertNull( $ctx->getContentOverrideCallback() );
// Misc
$ctx->getModules(),
[ 'foo', 'foo.quux', 'foo.baz', 'foo.bar', 'baz.quux' ]
);
- $this->assertEquals( false, $ctx->getDebug() );
+ $this->assertFalse( $ctx->getDebug() );
$this->assertEquals( 'zh', $ctx->getLanguage() );
$this->assertEquals( 'styles', $ctx->getOnly() );
$this->assertEquals( 'fallback', $ctx->getSkin() );
- $this->assertEquals( null, $ctx->getUser() );
+ $this->assertNull( $ctx->getUser() );
// Misc
$this->assertEquals( 'ltr', $ctx->getDirection() );
] );
$request = new \FauxRequest();
- $this->assertEquals( null, $provider->suggestLoginUsername( $request ) );
+ $this->assertNull( $provider->suggestLoginUsername( $request ) );
$request->setCookies( [
'xUserName' => 'Example',
'expire' => $expire,
];
- $this->assertEquals( null, $this->response->getCookie( 'xkey' ), 'Non-existing cookie' );
+ $this->assertNull( $this->response->getCookie( 'xkey' ), 'Non-existing cookie' );
$this->response->setCookie( 'key', 'val', $expire, [
'prefix' => 'x',
'path' => '/path',
* @covers FauxResponse::header
*/
public function testHeader() {
- $this->assertEquals( null, $this->response->getHeader( 'Location' ), 'Non-existing header' );
+ $this->assertNull( $this->response->getHeader( 'Location' ), 'Non-existing header' );
$this->response->header( 'Location: http://localhost/' );
$this->assertEquals(
$group->getFilter( 'foo' )->getName()
);
- $this->assertEquals(
- null,
+ $this->assertNull(
$group->getFilter( 'bar' )
);
}
$this->assertEquals( 'foo', $obj->getClosing( 0 ) );
$this->assertEquals( 'bar', $obj->getClosing( 1 ) );
$this->assertEquals( 'baz', $obj->getClosing( 2 ) );
- $this->assertEquals( null, $obj->getClosing( 3 ) );
+ $this->assertNull( $obj->getClosing( 3 ) );
}
/**
public function testReplaceDeprecatedCodes() {
$this->assertEquals( 'gsw', LanguageCode::replaceDeprecatedCodes( 'als' ) );
$this->assertEquals( 'gsw', LanguageCode::replaceDeprecatedCodes( 'gsw' ) );
- $this->assertEquals( null, LanguageCode::replaceDeprecatedCodes( null ) );
+ $this->assertNull( LanguageCode::replaceDeprecatedCodes( null ) );
}
/**
$this->assertEquals( 'zero', $session->get( 0 ) );
$this->assertFalse( $backend->dirty );
- $this->assertEquals( null, $session->get( 'null' ) );
+ $this->assertNull( $session->get( 'null' ) );
$this->assertEquals( 'default', $session->get( 'null', 'default' ) );
$this->assertFalse( $backend->dirty );
$this->assertFalse( $backend->dirty );
$logger->setCollect( true );
- $this->assertEquals( null, $session['null'] );
+ $this->assertNull( $session['null'] );
$logger->setCollect( false );
$this->assertFalse( $backend->dirty );
$this->assertSame( [