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

Commit 07eaefc

Browse files
committed
Adds separate file for \PHPUnit\Framework\TestCase shim.
1 parent f44f96a commit 07eaefc

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 PHPUnit\Framework {
19+
if (class_exists('\PHPUnit\Framework\TestCase') === false
20+
&& class_exists('\PHPUnit_Framework_TestCase') === true
21+
) {
22+
abstract class TestCase extends \PHPUnit_Framework_TestCase {}
23+
}
24+
}
25+
26+
/*EOF*/

0 commit comments

Comments
 (0)