1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
Description: PHPUnit 8.x adaptations
Relevenat PHPUnit change: https://github.com/sebastianbergmann/phpunit/commit/ba2241e6e0a634dc333b6e1d2fd6d0e8c16c2f57
Author: Nishanth Aravamudan <nish.aravamudan@canonical.com>,
Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Last-Update: 2020-07-16
--- a/Horde_Test-2.6.4/lib/Horde/Test/AllTests.php
+++ b/Horde_Test-2.6.4/lib/Horde/Test/AllTests.php
@@ -81,8 +81,8 @@
chdir($this->_dir);
$old_error = error_reporting();
$suite = $this->suite();
- $runner = new PHPUnit_TextUI_TestRunner();
- $result = $runner->doRun($suite, array('colors' => 'auto'), false);
+ $runner = new PHPUnit\TextUI\TestRunner();
+ $result = $runner->doRun($suite, array('colors' => 'auto', 'warnings' => array()), false);
error_reporting($old_error);
chdir($old_dir);
return $result;
@@ -91,7 +91,7 @@
/**
* Collect the unit tests of this directory into a new suite.
*
- * @return PHPUnit_Framework_TestSuite The test suite.
+ * @return PHPUnit\Framework\TestSuite The test suite.
*/
public function suite()
{
--- a/Horde_Test-2.6.4/lib/Horde/Test/AllTests/TestRunner.php
+++ b/Horde_Test-2.6.4/lib/Horde/Test/AllTests/TestRunner.php
@@ -22,7 +22,7 @@
* @link http://www.horde.org/components/Horde_Test
* @package Test
*/
-class Horde_Test_AllTests_TestRunner extends PHPUnit_Runner_BaseTestRunner
+class Horde_Test_AllTests_TestRunner extends PHPUnit\Runner\BaseTestRunner
{
/**
* Get the test suite.
@@ -44,7 +44,7 @@
/**
*/
- protected function runFailed($message)
+ protected function runFailed($message): void
{
}
--- a/Horde_Test-2.6.4/lib/Horde/Test/Case.php
+++ b/Horde_Test-2.6.4/lib/Horde/Test/Case.php
@@ -27,14 +27,19 @@
* @license http://www.horde.org/licenses/lgpl21 LGPL
* @link http://www.horde.org/components/Horde_Test
*/
-class Horde_Test_Case extends PHPUnit_Framework_TestCase
+class Horde_Test_Case extends PHPUnit\Framework\TestCase
{
/**
* Useful shorthand if you are mocking a class with a private constructor
*/
public function getMockSkipConstructor($className, array $methods = array(), array $arguments = array(), $mockClassName = '')
{
- return $this->getMock($className, $methods, $arguments, $mockClassName, /* $callOriginalConstructor */ false);
+ return $this->getMockBuilder($className)
+ ->setMethods($methods)
+ ->setConstructorArgs($arguments)
+ ->setMockClassName($mockClassName)
+ ->disableOriginalConstructor()
+ ->getMock();
}
/**
--- a/Horde_Test-2.6.4/lib/Horde/Test/Functional.php
+++ b/Horde_Test-2.6.4/lib/Horde/Test/Functional.php
@@ -31,7 +31,7 @@
* Test two XML strings for equivalency (e.g., identical up to reordering of
* attributes).
*/
- public function assertDomEquals($expected, $actual, $message = null)
+ public function assertDomEquals($expected, $actual, $message = "")
{
$expectedDom = new DOMDocument();
$expectedDom->loadXML($expected);
@@ -46,7 +46,7 @@
* Test two HTML strings for equivalency (e.g., identical up to reordering
* of attributes).
*/
- public function assertHtmlDomEquals($expected, $actual, $message = null)
+ public function assertHtmlDomEquals($expected, $actual, $message = "")
{
$expectedDom = new DOMDocument();
$expectedDom->loadHTML($expected);
|