Skip to content

Commit b9db698

Browse files
authored
Merge pull request #10 from nanasess/fix-final-private
PHP8-RC1 support
2 parents dd7ca37 + d9b2ad6 commit b9db698

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

src/Framework/TestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,11 @@ protected function runTest()
966966
$this->fail($e->getMessage());
967967
}
968968

969+
$testArguments = array_merge($this->data, $this->dependencyInput);
969970
try {
970971
$testResult = $method->invokeArgs(
971972
$this,
972-
array_merge($this->data, $this->dependencyInput)
973+
array_values($testArguments)
973974
);
974975
} catch (Throwable $_e) {
975976
$e = $_e;

src/Util/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ protected function __construct($filename)
162162
/**
163163
* @since Method available since Release 3.4.0
164164
*/
165-
final private function __clone()
165+
private function __clone()
166166
{
167167
}
168168

tests/Framework/Constraint/JsonMatches/ErrorMessageProviderTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ public function testDetermineJsonError($expected, $error, $prefix)
4242

4343
public static function determineJsonErrorDataprovider()
4444
{
45+
$unknown_error = null;
46+
if (PHP_VERSION_ID >= 80000) {
47+
$unknown_error = 'Unknown error';
48+
}
4549
return array(
4650
'JSON_ERROR_NONE' => array(
47-
null, 'json_error_none', ''
51+
$unknown_error, 'json_error_none', ''
4852
),
4953
'JSON_ERROR_DEPTH' => array(
5054
'Maximum stack depth exceeded', JSON_ERROR_DEPTH, ''

tests/Framework/ConstraintTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2882,7 +2882,12 @@ public function testConstraintArrayContainsCheckForObjectIdentity()
28822882
// Default case.
28832883
$constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo');
28842884

2885-
$this->assertTrue($constraint->evaluate(array(0), '', true));
2885+
if (PHP_VERSION_ID >= 80000) {
2886+
// see https://wiki.php.net/rfc/string_to_number_comparison
2887+
$this->assertFalse($constraint->evaluate(array(0), '', true));
2888+
} else {
2889+
$this->assertTrue($constraint->evaluate(array(0), '', true));
2890+
}
28862891
$this->assertTrue($constraint->evaluate(array(true), '', true));
28872892
}
28882893

tests/Regression/GitHub/873-php7.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
GH-873: PHPUnit suppresses exceptions thrown outside of test case function
33
--SKIPIF--
44
<?php
5-
if (PHP_MAJOR_VERSION < 7) {
5+
if (PHP_MAJOR_VERSION != 7) {
66
print 'skip: PHP 7 is required';
77
}
88
?>

tests/TextUI/fatal-isolation.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
--TEST--
22
phpunit FatalTest --process-isolation ../_files/FatalTest.php
3+
--SKIPIF--
4+
<?php
5+
if (PHP_VERSION_ID >= 80000) die('Skipped: xdebug_disable() is obsolete in PHP8 or later'); ?>
36
--FILE--
47
<?php
58
$_SERVER['argv'][1] = '--no-configuration';

tests/_files/FatalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class FatalTest extends PHPUnit_Framework_TestCase
44
{
55
public function testFatalError()
66
{
7-
if (extension_loaded('xdebug')) {
7+
if (extension_loaded('xdebug') && function_exists('xdebug_disable')) {
88
xdebug_disable();
99
}
1010

tests/_files/Singleton.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ protected function __construct()
77
{
88
}
99

10-
final private function __clone()
10+
private function __clone()
1111
{
1212
}
1313

0 commit comments

Comments
 (0)