diff --git a/composer.json b/composer.json index cec5bf92..23ca679b 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4" }, "autoload": { "psr-4": { diff --git a/tests/FulfilledPromiseTest.php b/tests/FulfilledPromiseTest.php index c70bbcc4..9692f1d9 100644 --- a/tests/FulfilledPromiseTest.php +++ b/tests/FulfilledPromiseTest.php @@ -37,11 +37,12 @@ public function getPromiseTestAdapter(callable $canceller = null) ]); } - /** @test */ + /** + * @test + * @expectedException InvalidArgumentException + */ public function shouldThrowExceptionIfConstructedWithAPromise() { - $this->setExpectedException('\InvalidArgumentException'); - return new FulfilledPromise(new FulfilledPromise()); } } diff --git a/tests/Internal/CancellationQueueTest.php b/tests/Internal/CancellationQueueTest.php index c8b80031..5ea20fdd 100644 --- a/tests/Internal/CancellationQueueTest.php +++ b/tests/Internal/CancellationQueueTest.php @@ -74,11 +74,13 @@ public function doesNotCallCancelTwiceWhenStartedTwice() $cancellationQueue(); } - /** @test */ + /** + * @test + * @expectedException Exception + * @expectedExceptionMessage test + */ public function rethrowsExceptionsThrownFromCancel() { - $this->setExpectedException('\Exception', 'test'); - $mock = $this->createCallableMock(); $mock ->expects($this->once()) diff --git a/tests/Internal/QueueTest.php b/tests/Internal/QueueTest.php index 2586299d..3789a408 100644 --- a/tests/Internal/QueueTest.php +++ b/tests/Internal/QueueTest.php @@ -29,11 +29,13 @@ public function excutesNestedEnqueuedTasks() $queue->enqueue($task); } - /** @test */ + /** + * @test + * @expectedException Exception + * @expectedException test + */ public function rethrowsExceptionsThrownFromTasks() { - $this->setExpectedException('\Exception', 'test'); - $mock = $this->createCallableMock(); $mock ->expects($this->once()) diff --git a/tests/RejectedPromiseTest.php b/tests/RejectedPromiseTest.php index bc2e11bd..13af87aa 100644 --- a/tests/RejectedPromiseTest.php +++ b/tests/RejectedPromiseTest.php @@ -37,11 +37,12 @@ public function getPromiseTestAdapter(callable $canceller = null) ]); } - /** @test */ + /** + * @test + * @expectedException InvalidArgumentException + */ public function shouldThrowExceptionIfConstructedWithAPromise() { - $this->setExpectedException('\InvalidArgumentException'); - return new RejectedPromise(new RejectedPromise()); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 6fcb5afd..b774c86c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,7 +2,9 @@ namespace React\Promise; -class TestCase extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase as BaseTestCase; + +class TestCase extends BaseTestCase { public function expectCallableExactly($amount) {