http://www.mediawiki.org/wiki/Special:Code/MediaWiki/75933

Revision: 75933
Author:   platonides
Date:     2010-11-03 16:42:19 +0000 (Wed, 03 Nov 2010)
Log Message:
-----------
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
    trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php

Modified: trunk/phase3/maintenance/tests/phpunit/includes/ParserOptionsTest.php
===================================================================
--- trunk/phase3/maintenance/tests/phpunit/includes/ParserOptionsTest.php       
2010-11-03 14:37:11 UTC (rev 75932)
+++ trunk/phase3/maintenance/tests/phpunit/includes/ParserOptionsTest.php       
2010-11-03 16:42:19 UTC (rev 75933)
@@ -17,8 +17,9 @@
                parent::tearDown();
        }
        
-       /*
+       /**
         * ParserOptions::optionsHash was not giving consistent results when 
$wgUseDynamicDates was set
+        * @group Database
         */
        function testGetParserCacheKeyWithDynamicDates() {      
                global $wgUseDynamicDates;

Modified: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php
===================================================================
--- trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php       
2010-11-03 14:37:11 UTC (rev 75932)
+++ trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php       
2010-11-03 16:42:19 UTC (rev 75933)
@@ -30,17 +30,17 @@
        function __construct( $username, $realname = 'Real Name', $email = 
'sam...@sample.com', $groups = array() ) {
                global $wgMinimalPasswordLength;
 
-               $this->username = $username; 
-               $this->realname = $realname; 
+               $this->username = $username; 
+               $this->realname = $realname; 
                $this->email = $email;
                $this->groups = $groups;
 
                // don't allow user to hardcode or select passwords -- people 
sometimes run tests       
                // on live wikis. Sometimes we create sysop users in these 
tests. A sysop user with
                // a known password would be a Bad Thing.
-               $this->password = User::randomPassword();
+               $this->password = User::randomPassword();
 
-               $this->user = User::newFromName( $this->username );
+               $this->user = User::newFromName( $this->username );
                $this->user->load();
 
                // In an ideal world we'd have a new wiki (or mock data store) 
for every single test.
@@ -145,6 +145,10 @@
 
 }
 
+/**
+ * @group Database
+ * @group Destructive
+ */
 class ApiUploadTest extends ApiTestCase {
        /**
         * Fixture -- run before every test 
@@ -254,7 +258,13 @@
                $extension = 'png';
                $mimeType = 'image/png';
 
-               $randomImageGenerator = new RandomImageGenerator();
+               try {
+                       $randomImageGenerator = new RandomImageGenerator();
+               }
+               catch ( Exception $e ) {
+                       $this->markTestIncomplete( $e->getMessage() );
+               }
+
                $filePaths = $randomImageGenerator->writeImages( 1, $extension, 
dirname( wfTempDir() ) );
                $filePath = $filePaths[0];
                $fileName = basename( $filePath ); 
@@ -342,7 +352,13 @@
                $extension = 'png';
                $mimeType = 'image/png';
 
-               $randomImageGenerator = new RandomImageGenerator();
+               try {
+                       $randomImageGenerator = new RandomImageGenerator();
+               }
+               catch ( Exception $e ) {
+                       $this->markTestIncomplete( $e->getMessage() );
+               }
+
                $filePaths = $randomImageGenerator->writeImages( 2, $extension, 
dirname( wfTempDir() ) );
                // we'll reuse this filename
                $fileName = basename( $filePaths[0] ); 
@@ -410,7 +426,12 @@
                $extension = 'png';
                $mimeType = 'image/png';
 
-               $randomImageGenerator = new RandomImageGenerator();
+               try {
+                       $randomImageGenerator = new RandomImageGenerator();
+               }
+               catch ( Exception $e ) {
+                       $this->markTestIncomplete( $e->getMessage() );
+               }
                $filePaths = $randomImageGenerator->writeImages( 1, $extension, 
dirname( wfTempDir() ) );
                $fileNames[0] = basename( $filePaths[0] ); 
                $fileNames[1] = "SameContentAs" . $fileNames[0];
@@ -488,7 +509,13 @@
                $extension = 'png';
                $mimeType = 'image/png';
 
-               $randomImageGenerator = new RandomImageGenerator();
+               try {
+                       $randomImageGenerator = new RandomImageGenerator();
+               }
+               catch ( Exception $e ) {
+                       $this->markTestIncomplete( $e->getMessage() );
+               }
+
                $filePaths = $randomImageGenerator->writeImages( 1, $extension, 
dirname( wfTempDir() ) );
                $filePath = $filePaths[0];
                $fileName = basename( $filePath ); 


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to