Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 2049b1b

Browse files
committed
fixed 6.0
1 parent 980c4a6 commit 2049b1b

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
2-
vendor
2+
composer.lock
3+
vendor

src/Constraint/JsonType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function matches($jsonArray)
3939
}
4040
} else {
4141
if ($matched === true) {
42-
throw new \PHPUnit\Framework\ExpectationFailedException('Unexpectedly response matched: ' . json\encode($jsonArray));
42+
throw new \PHPUnit\Framework\ExpectationFailedException('Unexpectedly response matched: ' . json_encode($jsonArray));
4343
}
4444
}
4545
return true;

src/shim.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// @codingStandardsIgnoreStart
33
// Add aliases for PHPUnit 6
44
namespace {
5+
56
if (!class_exists('PHPUnit\Framework\Assert') && class_exists('PHPUnit_Framework_Assert')) {
67
class_alias('PHPUnit_Framework_Assert', 'PHPUnit\Framework\Assert');
78
}
@@ -39,12 +40,14 @@ class_alias('PHPUnit_Util_Test', 'PHPUnit\Util\Test');
3940
class_alias('PHPUnit_Util_TestDox_ResultPrinter', 'PHPUnit\Util\TestDox\ResultPrinter');
4041

4142
}
42-
if (!class_exists('\PHPUnit\Util\Log\JSON') || !class_exists('\PHPUnit\Util\Log\TAP')) {
43-
require_once __DIR__ . '/phpunit5-loggers.php'; // TAP and JSON loggers were removed in PHPUnit 6
43+
if (!class_exists('PHPUnit\Util\Log\JSON') || !class_exists('PHPUnit\Util\Log\TAP')) {
44+
if (class_exists('PHPUnit\Util\Printer')) {
45+
require_once __DIR__ . '/phpunit5-loggers.php'; // TAP and JSON loggers were removed in PHPUnit 6
46+
}
4447
}
4548

4649
// phpunit codecoverage updates
47-
if (!class_exists('SebastianBergmann\CodeCoverage\CodeCoverage')) {
50+
if (class_exists('PHP_CodeCoverage' && !class_exists('SebastianBergmann\CodeCoverage\CodeCoverage'))) {
4851
class_alias('PHP_CodeCoverage', 'SebastianBergmann\CodeCoverage\CodeCoverage');
4952
class_alias('PHP_CodeCoverage_Report_Text', 'SebastianBergmann\CodeCoverage\Report\Text');
5053
class_alias('PHP_CodeCoverage_Report_PHP', 'SebastianBergmann\CodeCoverage\Report\PHP');
@@ -54,6 +57,14 @@ class_alias('PHP_CodeCoverage_Report_HTML', 'SebastianBergmann\CodeCoverage\Repo
5457
class_alias('PHP_CodeCoverage_Report_XML', 'SebastianBergmann\CodeCoverage\Report\Xml\Facade');
5558
class_alias('PHP_CodeCoverage_Exception', 'SebastianBergmann\CodeCoverage\Exception');
5659
}
60+
61+
if (class_exists('PHP_Timer') && !class_exists('SebastianBergmann\Timer\Timer')) {
62+
class_alias('PHP_Timer', 'SebastianBergmann\Timer\Timer');
63+
}
64+
65+
if (!class_exists('\PHPUnit\Framework\Constraint\LogicalNot') && class_exists('\PHPUnit\Framework\Constraint\Not')) {
66+
class_alias('\PHPUnit\Framework\Constraint\Not', '\PHPUnit\Framework\Constraint\LogicalNot');
67+
}
5768
}
5869

59-
// @codingStandardsIgnoreEnd
70+
// @codingStandardsIgnoreEnd

0 commit comments

Comments
 (0)