* verbose and color default output from phpunit
authorChad Horohoe <demon@users.mediawiki.org>
Tue, 28 Dec 2010 18:17:16 +0000 (18:17 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Tue, 28 Dec 2010 18:17:16 +0000 (18:17 +0000)
* Make a bunch of tests subclass MediaWikiTestCase
* Parser tests and ResourceLoaderTest can't subclass it yet due to various issues

32 files changed:
tests/phpunit/includes/CdbTest.php
tests/phpunit/includes/ExternalStoreTest.php
tests/phpunit/includes/ExtraParserTest.php
tests/phpunit/includes/GlobalTest.php
tests/phpunit/includes/HttpTest.php
tests/phpunit/includes/IPTest.php
tests/phpunit/includes/ImageFunctionsTest.php
tests/phpunit/includes/LanguageConverterTest.php
tests/phpunit/includes/LicensesTest.php
tests/phpunit/includes/LocalFileTest.php
tests/phpunit/includes/MessageTest.php
tests/phpunit/includes/ParserOptionsTest.php
tests/phpunit/includes/ResourceLoaderFileModuleTest.php
tests/phpunit/includes/RevisionTest.php
tests/phpunit/includes/SampleTest.php
tests/phpunit/includes/SanitizerTest.php
tests/phpunit/includes/SeleniumConfigurationTest.php
tests/phpunit/includes/SiteConfigurationTest.php
tests/phpunit/includes/TimeAdjustTest.php
tests/phpunit/includes/TitlePermissionTest.php
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/UploadTest.php
tests/phpunit/includes/UserIsValidEmailAddrTest.php
tests/phpunit/includes/XmlTest.php
tests/phpunit/includes/api/ApiSetup.php
tests/phpunit/includes/api/ApiUploadTest.php
tests/phpunit/includes/db/DatabaseSqliteTest.php
tests/phpunit/includes/db/DatabaseTest.php
tests/phpunit/includes/parser/ParserHelpers.php
tests/phpunit/includes/search/SearchUpdateTest.php
tests/phpunit/suite.xml
tests/phpunit/suites/ExtensionsTestSuite.php

index 987a0f5..6c3e666 100644 (file)
@@ -4,7 +4,7 @@
  * Test the CDB reader/writer
  */
 
-class CdbTest extends PHPUnit_Framework_TestCase {
+class CdbTest extends MediaWikiTestCase {
 
        public function setUp() {
                if ( !CdbReader::haveExtension() ) {
index 3c15f69..92ec734 100644 (file)
@@ -3,7 +3,7 @@
  * External Store tests
  */
 
-class ExternalStoreTest extends PHPUnit_Framework_TestCase {
+class ExternalStoreTest extends MediaWikiTestCase {
        private $saved_wgExternalStores;
 
        function setUp() {
index 130a1c4..949262a 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * Parser-related tests that don't suit for parserTests.txt
  */
-class ExtraParserTest extends PHPUnit_Framework_TestCase {
+class ExtraParserTest extends MediaWikiTestCase {
 
        function setUp() {
                global $wgMemc;
index 426409e..f0deabd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class GlobalTest extends PHPUnit_Framework_TestCase {
+class GlobalTest extends MediaWikiTestCase {
        function setUp() {
                global $wgReadOnlyFile, $wgContLang, $wgLang;
                $this->originals['wgReadOnlyFile'] = $wgReadOnlyFile;
index 3dfefd4..719df0b 100644 (file)
@@ -9,7 +9,7 @@ class MockCookie extends Cookie {
 /**
  * @group Broken
  */
-class HttpTest extends PHPUnit_Framework_TestCase {
+class HttpTest extends MediaWikiTestCase {
        static $content;
        static $headers;
        static $has_curl;
index ee09299..3655e51 100644 (file)
@@ -3,7 +3,7 @@
  * Tests for IP validity functions. Ported from /t/inc/IP.t by avar.
  */
 
-class IPTest extends PHPUnit_Framework_TestCase {
+class IPTest extends MediaWikiTestCase {
        // not sure it should be tested with boolean false. hashar 20100924
        public function testisIPAddress() {
                $this->assertFalse( IP::isIPAddress( false ), 'Boolean false is not an IP' );
index 4de4e63..cb7e67f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class ImageFunctionsTest extends PHPUnit_Framework_TestCase {
+class ImageFunctionsTest extends MediaWikiTestCase {
        function testFitBoxWidth() {
                $vals = array(
                        array(
index 944195f..3ee39a1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class LanguageConverterTest extends PHPUnit_Framework_TestCase {
+class LanguageConverterTest extends MediaWikiTestCase {
        protected $lang = null;
        protected $lc = null;
 
index e1daff7..e467f3c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class LicensesTest extends PHPUnit_Framework_TestCase {
+class LicensesTest extends MediaWikiTestCase {
 
        function testLicenses() {
                $str = "
index 32aa515..e72561f 100644 (file)
@@ -4,7 +4,7 @@
  * These tests should work regardless of $wgCapitalLinks
  */
 
-class LocalFileTest extends PHPUnit_Framework_TestCase {
+class LocalFileTest extends MediaWikiTestCase {
        function setUp() {
                global $wgContLang, $wgCapitalLinks;
 
index fa696d2..67dc009 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class MessageTest extends PHPUnit_Framework_TestCase {
+class MessageTest extends MediaWikiTestCase {
 
        function setUp() {
                global $wgLanguageCode, $wgLang, $wgContLang, $wgMessageCache;
index 63d98e7..02d6b17 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class ParserOptionsTest extends PHPUnit_Framework_TestCase {
+class ParserOptionsTest extends MediaWikiTestCase {
 
        private $popts;
        private $pcache;
index 5ad7d93..a1701d2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class ResourceLoaderFileModuleTest extends PHPUnit_Framework_TestCase {
+class ResourceLoaderFileModuleTest extends MediaWikiTestCase {
        /* Provider Methods */
 
        public function provide() {
index a9405b6..20784a0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class RevisionTest extends PHPUnit_Framework_TestCase {
+class RevisionTest extends MediaWikiTestCase {
        var $saveGlobals = array();
 
        function setUp() {
index 117ac1c..3c3553f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class TestSample extends PHPUnit_Framework_TestCase {
+class TestSample extends MediaWikiTestCase {
 
        /**
         * Anything that needs to happen before your tests should go here.
index a12f901..c2e3e6b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class SanitizerTest extends PHPUnit_Framework_TestCase {
+class SanitizerTest extends MediaWikiTestCase {
 
        function setUp() {
                AutoLoader::loadClass( 'Sanitizer' );
index fa0ea80..d3b0c0f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class SeleniumConfigurationTest extends PHPUnit_Framework_TestCase {
+class SeleniumConfigurationTest extends MediaWikiTestCase {
 
        /*
         * The file where the test temporarity stores the selenium config.
index 9bfab9e..6ed30f2 100644 (file)
@@ -22,7 +22,7 @@ function getSiteParams( $conf, $wiki ) {
        );
 }
 
-class SiteConfigurationTest extends PHPUnit_Framework_TestCase {
+class SiteConfigurationTest extends MediaWikiTestCase {
        var $mConf;
 
        function setUp() {
index 820e713..9065e7c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class TimeAdjustTest extends PHPUnit_Framework_TestCase {
+class TimeAdjustTest extends MediaWikiTestCase {
        static $offset;
 
        public function setUp() {
index fa83b9a..d78f8fc 100644 (file)
@@ -4,7 +4,7 @@
  * @group Database
  * @group Destructive
  */
-class TitlePermissionTest extends PHPUnit_Framework_TestCase {
+class TitlePermissionTest extends MediaWikiTestCase {
        static $title;
        static $user;
        static $anonUser;
index 5b42c1c..7092561 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class TitleTest extends PHPUnit_Framework_TestCase {
+class TitleTest extends MediaWikiTestCase {
 
        function testLegalChars() {
                $titlechars = Title::legalChars();
index d9edd8e..2401bf1 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * @group Upload
  */
-class UploadTest extends PHPUnit_Framework_TestCase {
+class UploadTest extends MediaWikiTestCase {
        protected $upload;
 
 
index c1f3419..6b5ff68 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class UserIsValidEmailAddrTest extends PHPUnit_Framework_TestCase {
+class UserIsValidEmailAddrTest extends MediaWikiTestCase {
 
        private function checkEmail( $addr, $expected = true, $msg = '') {
                $this->assertEquals(
index f01c0f1..e2f59ab 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-class XmlTest extends PHPUnit_Framework_TestCase {
+class XmlTest extends MediaWikiTestCase {
 
        public function testExpandAttributes() {
                $this->assertNull( Xml::expandAttributes(null),
@@ -175,5 +175,5 @@ class XmlTest extends PHPUnit_Framework_TestCase {
 }
 
 // TODO
-class XmlSelectTest extends PHPUnit_Framework_TestCase {
+class XmlSelectTest extends MediaWikiTestCase {
 }
index f004f3c..80ead6b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-abstract class ApiTestSetup extends PHPUnit_Framework_TestCase {
+abstract class ApiTestSetup extends MediaWikiTestCase {
        protected static $user;
        protected static $sysopUser;
        protected static $apiUrl;
index 06d2bdb..87abbb9 100644 (file)
@@ -78,7 +78,7 @@ class ApiTestUser {
 
 }
 
-abstract class ApiTestCase extends PHPUnit_Framework_TestCase {
+abstract class ApiTestCase extends MediaWikiTestCase {
        public static $users;
 
        function setUp() {
index 4cd3daf..24704ad 100644 (file)
@@ -20,7 +20,7 @@ class MockDatabaseSqlite extends DatabaseSqliteStandalone {
 /**
  * @group sqlite
  */
-class DatabaseSqliteTest extends PHPUnit_Framework_TestCase {
+class DatabaseSqliteTest extends MediaWikiTestCase {
        var $db;
 
        public function setUp() {
index b184331..7357524 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * @group Database
  */
-class DatabaseTest extends PHPUnit_Framework_TestCase {
+class DatabaseTest extends MediaWikiTestCase {
        var $db;
 
        function setUp() {
index 43da342..f490a9c 100644 (file)
@@ -16,13 +16,13 @@ class PHPUnitParserTest extends ParserTest {
        }
 }
 
-class ParserUnitTest extends PHPUnit_Framework_TestCase {
+class ParserUnitTest extends MediaWikiTestCase {
        private $test = "";
-       private $suite;
 
        public function __construct( $suite, $test = null ) {
-               $this->suite = $suite;
+               parent::__construct();
                $this->test = $test;
+               $this->suite = $suite;
        }
 
        function count() { return 1; }
index 108b280..935425a 100644 (file)
@@ -18,7 +18,7 @@ class MockSearch extends SearchEngine {
 /**
  * @group Search
  */
-class SearchUpdateTest extends PHPUnit_Framework_TestCase {
+class SearchUpdateTest extends MediaWikiTestCase {
        static $searchType;
 
        function update( $text, $title = 'Test', $id = 1 ) {
index cb25963..f384d84 100644 (file)
@@ -1,13 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <phpunit bootstrap="./bootstrap.php"
-         colors="false"
+         colors="true"
          backupGlobals="false"
          convertErrorsToExceptions="true"
          convertNoticesToExceptions="true"
          convertWarningsToExceptions="true"
-         stopOnFailure="false"
-         strict="true">
+         stopOnFailure="true"
+         strict="true"
+                verbose="true">
        <testsuites>
                <testsuite name="includes">
                        <directory>./includes</directory>
index 4bf3542..4f02a69 100644 (file)
@@ -26,7 +26,7 @@ class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
  * Needed to avoid warnings like 'No tests found in class "ExtensionsTestSuite".'
  * when no extensions with tests are used.
  */
-class DummyExtensionsTest extends PHPUnit_Framework_TestCase {
+class DummyExtensionsTest extends MediaWikiTestCase {
        public function testNothing() {
                
        }