Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit fc69319

Browse files
committed
Adds separate file for \PHPUnit_Framework_TestCase shim.
1 parent 07eaefc commit fc69319

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
/**
4+
* The `PHPUnit_Framework_TestCase` class was added in PHPUnit v2.0 and
5+
* removed in PHPUnit v6.0, where it was replaced by the namespaced
6+
* `\PHPUnit\Framework\TestCase`.
7+
*
8+
* In order to allow developers to migrate their code before PHPUnit v6 was
9+
* released a "Forward Compatibility Layer" was added to PHPUnit v4.8 and v5.4
10+
* which also contained the `PHPUnit\Framework\TestCase` class.
11+
*
12+
* This means that for projects that use an older version of PHPUnit, the
13+
* namespaced class is not available and for newer projects the "underscored"
14+
* version is missing.
15+
*
16+
* This file makes sure that `\PHPUnit_Framework_TestCase` always exist.
17+
*/
18+
namespace {
19+
if (class_exists('\PHPUnit\Framework\TestCase') === true
20+
&& class_exists('\PHPUnit_Framework_TestCase') === false
21+
) {
22+
abstract class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase {}
23+
}
24+
}
25+
26+
/*EOF*/

0 commit comments

Comments
 (0)