Skip to content

Commit efb6d7f

Browse files
committed
Forward compatibility with PHPUnit 5 and PHPUnit 6
1 parent 07ffcfb commit efb6d7f

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ provide alternate implementations.
2323
* [Fallback get](#fallback-get)
2424
* [Fallback-get-and-set](#fallback-get-and-set)
2525
* [Install](#install)
26+
* [Tests](#tests)
2627
* [License](#license)
2728

2829
## Usage
@@ -150,6 +151,21 @@ $ composer require "react/cache:~0.4.0|~0.3.0"
150151

151152
More details and upgrade guides can be found in the [CHANGELOG](CHANGELOG.md).
152153

154+
## Tests
155+
156+
To run the test suite, you first need to clone this repo and then install all
157+
dependencies [through Composer](https://getcomposer.org):
158+
159+
```bash
160+
$ composer install
161+
```
162+
163+
To run the test suite, go to the project root and run:
164+
165+
```bash
166+
$ php vendor/bin/phpunit
167+
```
168+
153169
## License
154170

155171
MIT, see [LICENSE file](LICENSE).

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
"psr-4": { "React\\Tests\\Cache\\": "tests/" }
1515
},
1616
"require-dev": {
17-
"phpunit/phpunit": "~4.8"
17+
"phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
1818
}
1919
}

tests/TestCase.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace React\Tests\Cache;
44

5-
class TestCase extends \PHPUnit_Framework_TestCase
5+
use PHPUnit\Framework\TestCase as BaseTestCase;
6+
7+
class TestCase extends BaseTestCase
68
{
79
protected function expectCallableExactly($amount)
810
{
@@ -36,6 +38,6 @@ protected function expectCallableNever()
3638

3739
protected function createCallableMock()
3840
{
39-
return $this->getMock('React\Tests\Cache\CallableStub');
41+
return $this->getMockBuilder('React\Tests\Cache\CallableStub')->getMock();
4042
}
4143
}

0 commit comments

Comments
 (0)