r75933 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75932‎ | r75933 | r75934 >
Date:16:42, 3 November 2010
Author:platonides
Status:deferred
Tags:
Comment:
Follow up r75906.
Those RandomImageGenerator exceptions are not nice. Skip the tests if you have no dictionaries.
Change spaces to tabs.
Place ApiUploadTest in Database and Destructive groups
Mark testGetParserCacheKeyWithDynamicDates() added in r75838 as needed a db
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/ParserOptionsTest.php (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/ParserOptionsTest.php
@@ -17,8 +17,9 @@
1818 parent::tearDown();
1919 }
2020
21 - /*
 21+ /**
2222 * ParserOptions::optionsHash was not giving consistent results when $wgUseDynamicDates was set
 23+ * @group Database
2324 */
2425 function testGetParserCacheKeyWithDynamicDates() {
2526 global $wgUseDynamicDates;
Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php
@@ -30,17 +30,17 @@
3131 function __construct( $username, $realname = 'Real Name', $email = 'sample@sample.com', $groups = array() ) {
3232 global $wgMinimalPasswordLength;
3333
34 - $this->username = $username;
35 - $this->realname = $realname;
 34+ $this->username = $username;
 35+ $this->realname = $realname;
3636 $this->email = $email;
3737 $this->groups = $groups;
3838
3939 // don't allow user to hardcode or select passwords -- people sometimes run tests
4040 // on live wikis. Sometimes we create sysop users in these tests. A sysop user with
4141 // a known password would be a Bad Thing.
42 - $this->password = User::randomPassword();
 42+ $this->password = User::randomPassword();
4343
44 - $this->user = User::newFromName( $this->username );
 44+ $this->user = User::newFromName( $this->username );
4545 $this->user->load();
4646
4747 // In an ideal world we'd have a new wiki (or mock data store) for every single test.
@@ -145,6 +145,10 @@
146146
147147 }
148148
 149+/**
 150+ * @group Database
 151+ * @group Destructive
 152+ */
149153 class ApiUploadTest extends ApiTestCase {
150154 /**
151155 * Fixture -- run before every test
@@ -254,7 +258,13 @@
255259 $extension = 'png';
256260 $mimeType = 'image/png';
257261
258 - $randomImageGenerator = new RandomImageGenerator();
 262+ try {
 263+ $randomImageGenerator = new RandomImageGenerator();
 264+ }
 265+ catch ( Exception $e ) {
 266+ $this->markTestIncomplete( $e->getMessage() );
 267+ }
 268+
259269 $filePaths = $randomImageGenerator->writeImages( 1, $extension, dirname( wfTempDir() ) );
260270 $filePath = $filePaths[0];
261271 $fileName = basename( $filePath );
@@ -342,7 +352,13 @@
343353 $extension = 'png';
344354 $mimeType = 'image/png';
345355
346 - $randomImageGenerator = new RandomImageGenerator();
 356+ try {
 357+ $randomImageGenerator = new RandomImageGenerator();
 358+ }
 359+ catch ( Exception $e ) {
 360+ $this->markTestIncomplete( $e->getMessage() );
 361+ }
 362+
347363 $filePaths = $randomImageGenerator->writeImages( 2, $extension, dirname( wfTempDir() ) );
348364 // we'll reuse this filename
349365 $fileName = basename( $filePaths[0] );
@@ -410,7 +426,12 @@
411427 $extension = 'png';
412428 $mimeType = 'image/png';
413429
414 - $randomImageGenerator = new RandomImageGenerator();
 430+ try {
 431+ $randomImageGenerator = new RandomImageGenerator();
 432+ }
 433+ catch ( Exception $e ) {
 434+ $this->markTestIncomplete( $e->getMessage() );
 435+ }
415436 $filePaths = $randomImageGenerator->writeImages( 1, $extension, dirname( wfTempDir() ) );
416437 $fileNames[0] = basename( $filePaths[0] );
417438 $fileNames[1] = "SameContentAs" . $fileNames[0];
@@ -488,7 +509,13 @@
489510 $extension = 'png';
490511 $mimeType = 'image/png';
491512
492 - $randomImageGenerator = new RandomImageGenerator();
 513+ try {
 514+ $randomImageGenerator = new RandomImageGenerator();
 515+ }
 516+ catch ( Exception $e ) {
 517+ $this->markTestIncomplete( $e->getMessage() );
 518+ }
 519+
493520 $filePaths = $randomImageGenerator->writeImages( 1, $extension, dirname( wfTempDir() ) );
494521 $filePath = $filePaths[0];
495522 $fileName = basename( $filePath );

Follow-up revisions

RevisionCommit summaryAuthorDate
r75934Merging from r75850 through r75933 from trunkawjrichards16:52, 3 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75838Using getDateFormat instead of mDateFormat in ParserOptions::optionsHash. Thi...pdhanda23:00, 1 November 2010
r75906core changes for UploadWizard (merged from r73549 to HEAD in branches/uploadw...neilk04:32, 3 November 2010

Status & tagging log