* Block.php: Set mExpiry to the value we store in the database, so that Block::equals() returns true. Fixes BlockTest::testInitializerFunctionsReturnCorrectBlock.
* In Title::checkUserBlock(): Convert message parameters to plain strings to make strict comparisons work. Fixes TitlePermissionTest::testUserBlock().
* ApiBlock.php: Follow-Up r85166, add 'Confirm' parameter to data array. Fixes ApiBlockTest::testMakeNormalBlock().
* ApiQueryTest.php: Use $wgMetaNamespace instead of $wgSitename to account for customizations.
* RandomImageGenerator.php: Use default value for constructor param to prevent fatals.
* ApiTestCaseUpload.php:
** Fix undefined variable $fileName.
** Remove stray ini_set statements, they don't belong there. Especially ini_set( 'error_reporting', 1 ) will effectively disable all reporting, which makes errors hard to track.
* ArticleTablesTest.php: Put testbug14404() in group Broken, as the fix for the bug has been reverted in r83868.
if( !$db ){
$db = wfGetDB( DB_SLAVE );
}
+ $this->mExpiry = $db->encodeExpiry( $this->mExpiry );
$a = array(
'ipb_address' => (string)$this->target,
'ipb_anon_only' => !$this->isHardblock(),
'ipb_create_account' => $this->prevents( 'createaccount' ),
'ipb_enable_autoblock' => $this->isAutoblocking(),
- 'ipb_expiry' => $db->encodeExpiry( $this->mExpiry ),
+ 'ipb_expiry' => $this->mExpiry,
'ipb_range_start' => $this->getRangeStart(),
'ipb_range_end' => $this->getRangeEnd(),
'ipb_deleted' => intval( $this->mHideName ), // typecast required for SQLite
$blockExpiry = $user->mBlock->mExpiry;
$blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $user->mBlock->mTimestamp ), true );
if ( $blockExpiry == 'infinity' ) {
- $blockExpiry = wfMessage( 'infiniteblock' );
+ $blockExpiry = wfMessage( 'infiniteblock' )->text();
} else {
$blockExpiry = $wgLang->timeanddate( wfTimestamp( TS_MW, $blockExpiry ), true );
}
- $intended = $user->mBlock->getTarget();
+ $intended = strval( $user->mBlock->getTarget() );
$errors[] = array( ( $block->mAuto ? 'autoblockedtext' : 'blockedtext' ), $link, $reason, $ip, $name,
$blockid, $blockExpiry, $intended, $blockTimestamp );
'DisableUTEdit' => $params['allowusertalk'],
'AlreadyBlocked' => $params['reblock'],
'Watch' => $params['watchuser'],
+ 'Confirm' => true,
);
$retval = SpecialBlock::processForm( $data );
$wgContLang = new StubContLang;
$wgLang = new StubUserLang;
}
-
+
+ /**
+ * @group Broken
+ */
function testbug14404() {
global $wgUser, $wgContLang, $wgLanguageCode, $wgLang;
$this->user->mBlock->mTimestamp = 0;
$this->assertEquals( array( array( 'autoblockedtext',
'[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', 0, 'infinite', '127.0.8.1',
+ 'Useruser', null, 'infinite', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $prev ), true ) ) ),
$this->title->getUserPermissionsErrors( 'move-target',
$this->user ) );
$this->user->mBlock = new Block( '127.0.8.1', 2, 1, 'no reason given', $now, 0, 10 );
$this->assertEquals( array( array( 'blockedtext',
'[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
- 'Useruser', 0, '23:00, 31 December 1969', '127.0.8.1',
+ 'Useruser', null, '23:00, 31 December 1969', '127.0.8.1',
$wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ) ),
$this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
function testTitlesGetNormalized() {
- global $wgSitename;
+ global $wgMetaNamespace;
$data = $this->doApiRequest( array(
'action' => 'query',
$this->assertEquals(
array(
'from' => 'Project:articleA',
- 'to' => $wgSitename . ':ArticleA'
+ 'to' => $wgMetaNamespace . ':ArticleA'
),
$data[0]['query']['normalized'][0]
);
$wgEnableAPI = true;
wfSetupSession();
- ini_set( 'log_errors', 1 );
- ini_set( 'error_reporting', 1 );
- ini_set( 'display_errors', 1 );
-
$this->clearFakeUploads();
}
$article->doDeleteArticle( "removing for test" );
// see if it now doesn't exist; reload
- $title = Title::newFromText( $fileName, NS_FILE );
+ $title = Title::newFromText( $title->getText(), NS_FILE );
}
return ! ( $title && $title instanceof Title && $title->exists() );
}
private $circlesToDraw = 5;
private $imageWriteMethod;
- public function __construct( $options ) {
+ public function __construct( $options = array() ) {
global $wgUseImageMagick, $wgImageMagickConvertCommand;
foreach ( array( 'dictionaryFile', 'minWidth', 'minHeight', 'maxHeight', 'circlesToDraw' ) as $property ) {
if ( isset( $options[$property] ) ) {