From 447529064b0286c065fb41932277c7aca349eca8 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 28 Dec 2010 18:17:16 +0000 Subject: [PATCH] * verbose and color default output from phpunit * Make a bunch of tests subclass MediaWikiTestCase * Parser tests and ResourceLoaderTest can't subclass it yet due to various issues --- tests/phpunit/includes/CdbTest.php | 2 +- tests/phpunit/includes/ExternalStoreTest.php | 2 +- tests/phpunit/includes/ExtraParserTest.php | 2 +- tests/phpunit/includes/GlobalTest.php | 2 +- tests/phpunit/includes/HttpTest.php | 2 +- tests/phpunit/includes/IPTest.php | 2 +- tests/phpunit/includes/ImageFunctionsTest.php | 2 +- tests/phpunit/includes/LanguageConverterTest.php | 2 +- tests/phpunit/includes/LicensesTest.php | 2 +- tests/phpunit/includes/LocalFileTest.php | 2 +- tests/phpunit/includes/MessageTest.php | 2 +- tests/phpunit/includes/ParserOptionsTest.php | 2 +- tests/phpunit/includes/ResourceLoaderFileModuleTest.php | 2 +- tests/phpunit/includes/RevisionTest.php | 2 +- tests/phpunit/includes/SampleTest.php | 2 +- tests/phpunit/includes/SanitizerTest.php | 2 +- tests/phpunit/includes/SeleniumConfigurationTest.php | 2 +- tests/phpunit/includes/SiteConfigurationTest.php | 2 +- tests/phpunit/includes/TimeAdjustTest.php | 2 +- tests/phpunit/includes/TitlePermissionTest.php | 2 +- tests/phpunit/includes/TitleTest.php | 2 +- tests/phpunit/includes/UploadTest.php | 2 +- tests/phpunit/includes/UserIsValidEmailAddrTest.php | 2 +- tests/phpunit/includes/XmlTest.php | 4 ++-- tests/phpunit/includes/api/ApiSetup.php | 2 +- tests/phpunit/includes/api/ApiUploadTest.php | 2 +- tests/phpunit/includes/db/DatabaseSqliteTest.php | 2 +- tests/phpunit/includes/db/DatabaseTest.php | 2 +- tests/phpunit/includes/parser/ParserHelpers.php | 6 +++--- tests/phpunit/includes/search/SearchUpdateTest.php | 2 +- tests/phpunit/suite.xml | 7 ++++--- tests/phpunit/suites/ExtensionsTestSuite.php | 2 +- 32 files changed, 38 insertions(+), 37 deletions(-) diff --git a/tests/phpunit/includes/CdbTest.php b/tests/phpunit/includes/CdbTest.php index 987a0f5be7..6c3e6664a0 100644 --- a/tests/phpunit/includes/CdbTest.php +++ b/tests/phpunit/includes/CdbTest.php @@ -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() ) { diff --git a/tests/phpunit/includes/ExternalStoreTest.php b/tests/phpunit/includes/ExternalStoreTest.php index 3c15f69755..92ec7344ac 100644 --- a/tests/phpunit/includes/ExternalStoreTest.php +++ b/tests/phpunit/includes/ExternalStoreTest.php @@ -3,7 +3,7 @@ * External Store tests */ -class ExternalStoreTest extends PHPUnit_Framework_TestCase { +class ExternalStoreTest extends MediaWikiTestCase { private $saved_wgExternalStores; function setUp() { diff --git a/tests/phpunit/includes/ExtraParserTest.php b/tests/phpunit/includes/ExtraParserTest.php index 130a1c4012..949262a519 100644 --- a/tests/phpunit/includes/ExtraParserTest.php +++ b/tests/phpunit/includes/ExtraParserTest.php @@ -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; diff --git a/tests/phpunit/includes/GlobalTest.php b/tests/phpunit/includes/GlobalTest.php index 426409e9d2..f0deabdea3 100644 --- a/tests/phpunit/includes/GlobalTest.php +++ b/tests/phpunit/includes/GlobalTest.php @@ -1,6 +1,6 @@ originals['wgReadOnlyFile'] = $wgReadOnlyFile; diff --git a/tests/phpunit/includes/HttpTest.php b/tests/phpunit/includes/HttpTest.php index 3dfefd4a83..719df0bf4a 100644 --- a/tests/phpunit/includes/HttpTest.php +++ b/tests/phpunit/includes/HttpTest.php @@ -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; diff --git a/tests/phpunit/includes/IPTest.php b/tests/phpunit/includes/IPTest.php index ee092997bd..3655e51547 100644 --- a/tests/phpunit/includes/IPTest.php +++ b/tests/phpunit/includes/IPTest.php @@ -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' ); diff --git a/tests/phpunit/includes/ImageFunctionsTest.php b/tests/phpunit/includes/ImageFunctionsTest.php index 4de4e63d4f..cb7e67f391 100644 --- a/tests/phpunit/includes/ImageFunctionsTest.php +++ b/tests/phpunit/includes/ImageFunctionsTest.php @@ -1,6 +1,6 @@ assertEquals( diff --git a/tests/phpunit/includes/XmlTest.php b/tests/phpunit/includes/XmlTest.php index f01c0f1cc4..e2f59abb84 100644 --- a/tests/phpunit/includes/XmlTest.php +++ b/tests/phpunit/includes/XmlTest.php @@ -1,6 +1,6 @@ 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 { } diff --git a/tests/phpunit/includes/api/ApiSetup.php b/tests/phpunit/includes/api/ApiSetup.php index f004f3c6be..80ead6bb8d 100644 --- a/tests/phpunit/includes/api/ApiSetup.php +++ b/tests/phpunit/includes/api/ApiSetup.php @@ -1,6 +1,6 @@ suite = $suite; + parent::__construct(); $this->test = $test; + $this->suite = $suite; } function count() { return 1; } diff --git a/tests/phpunit/includes/search/SearchUpdateTest.php b/tests/phpunit/includes/search/SearchUpdateTest.php index 108b280270..935425a676 100644 --- a/tests/phpunit/includes/search/SearchUpdateTest.php +++ b/tests/phpunit/includes/search/SearchUpdateTest.php @@ -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 ) { diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml index cb25963bda..f384d84991 100644 --- a/tests/phpunit/suite.xml +++ b/tests/phpunit/suite.xml @@ -1,13 +1,14 @@ + stopOnFailure="true" + strict="true" + verbose="true"> ./includes diff --git a/tests/phpunit/suites/ExtensionsTestSuite.php b/tests/phpunit/suites/ExtensionsTestSuite.php index 4bf3542799..4f02a693ce 100644 --- a/tests/phpunit/suites/ExtensionsTestSuite.php +++ b/tests/phpunit/suites/ExtensionsTestSuite.php @@ -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() { } -- 2.20.1