Upgrade from PHPunit 3.7.x to PHPUnit 4.8.x
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 13 Feb 2016 14:00:20 +0000 (15:00 +0100)
committerKrinkle <krinklemail@gmail.com>
Tue, 23 Feb 2016 00:57:48 +0000 (00:57 +0000)
Major changes:

* (4.0.0) Limited support for stubbing and mocking static methods was removed.
          (introduced in PHPUnit 3.5)
* (4.0.0) The addRiskyTest() was added to the PHPUnit_Framework_TestListener interface.
          Classes that implement this interface MUST implement this method.
* (4.5.0) The "--strict" catch-all option was deprecated. Use specific options instead.

Notable changes:

* (4.6.0) Tests not annotated with @small, @medium, or @large are no longer default
          to matching in group @small.
* (4.6.0) Result printer now checks hasColorSupport().
* (4.8.0) The name of the default group was changed from "__nogroup__" to "default".
* (4.8.0) This is the last release to support PHP 5.3, PHP 5.4, and PHP 5.5.
          PHPUnit 5 will require PHP 5.6 or higher.

PHPUnit 3.7.17 was released March 2013.
PHPUnit 4.8.0 was released August 2015.
PHPUnit 4.8.23 was released January 2016.

Details:

* https://github.com/sebastianbergmann/phpunit/wiki/ChangeLog-for-PHPUnit-3.7
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.0.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.1.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.2.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.3.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.4.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.5.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.6.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.7.0
* https://github.com/sebastianbergmann/phpunit/wiki/Release-Announcement-for-PHPUnit-4.8.0

Bug: T99982
Change-Id: I70ad81513812aa76a84fa55be14135aac94d55e8

composer.json
tests/phpunit/phpunit.php
tests/phpunit/suite.xml

index c5b4395..1270311 100644 (file)
@@ -45,7 +45,7 @@
                "monolog/monolog": "~1.17.2",
                "nikic/php-parser": "1.4.1",
                "nmred/kafka-php": "0.1.5",
-               "phpunit/phpunit": "3.7.37",
+               "phpunit/phpunit": "4.8.23",
                "wikimedia/avro": "1.7.7"
        },
        "suggest": {
index 66e8182..86fc295 100755 (executable)
@@ -176,19 +176,6 @@ class PHPUnitMaintClass extends Maintenance {
                        $_SERVER['argv'] = array_values( $_SERVER['argv'] );
                }
 
-               if ( !wfIsWindows() ) {
-                       # If we are not running on windows then we can enable phpunit colors
-                       # Windows does not come anymore with ANSI.SYS loaded by default
-                       # PHPUnit uses the suite.xml parameters to enable/disable colors
-                       # which can be then forced to be enabled with --colors.
-                       # The below code injects a parameter just like if the user called
-                       # Probably fix bug 29226
-                       $key = array_search( '--colors', $_SERVER['argv'] );
-                       if ( $key === false ) {
-                               array_splice( $_SERVER['argv'], 1, 0, '--colors' );
-                       }
-               }
-
                # Makes MediaWiki PHPUnit directory includable so the PHPUnit will
                # be able to resolve relative files inclusion such as suites/*
                # PHPUnit uses stream_resolve_include_path() internally
index bdabdc1..63f5de0 100644 (file)
@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-Colors don't work on Windows!
-phpunit.php enables colors for other OSs at runtime
--->
 <phpunit bootstrap="./bootstrap.php"
-       colors="false"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
+
+       colors="true"
        backupGlobals="false"
        convertErrorsToExceptions="true"
        convertNoticesToExceptions="true"
@@ -15,7 +13,9 @@ phpunit.php enables colors for other OSs at runtime
        timeoutForSmallTests="10"
        timeoutForMediumTests="30"
        timeoutForLargeTests="60"
-       strict="true"
+       beStrictAboutTestsThatDoNotTestAnything="true"
+       beStrictAboutOutputDuringTests="true"
+       beStrictAboutTestSize="true"
        verbose="true">
        <testsuites>
                <testsuite name="includes">