Skip to content

Commit e44d759

Browse files
authored
Merge pull request #105 from gabriel-caruso/phpunit
Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase
2 parents 9dcffcc + 76d36f8 commit e44d759

6 files changed

Lines changed: 22 additions & 14 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"php": ">=5.4.0"
1010
},
1111
"require-dev": {
12-
"phpunit/phpunit": "~4.8"
12+
"phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4"
1313
},
1414
"autoload": {
1515
"psr-4": {

tests/FulfilledPromiseTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ public function getPromiseTestAdapter(callable $canceller = null)
3737
]);
3838
}
3939

40-
/** @test */
40+
/**
41+
* @test
42+
* @expectedException InvalidArgumentException
43+
*/
4144
public function shouldThrowExceptionIfConstructedWithAPromise()
4245
{
43-
$this->setExpectedException('\InvalidArgumentException');
44-
4546
return new FulfilledPromise(new FulfilledPromise());
4647
}
4748
}

tests/Internal/CancellationQueueTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,13 @@ public function doesNotCallCancelTwiceWhenStartedTwice()
7474
$cancellationQueue();
7575
}
7676

77-
/** @test */
77+
/**
78+
* @test
79+
* @expectedException Exception
80+
* @expectedExceptionMessage test
81+
*/
7882
public function rethrowsExceptionsThrownFromCancel()
7983
{
80-
$this->setExpectedException('\Exception', 'test');
81-
8284
$mock = $this->createCallableMock();
8385
$mock
8486
->expects($this->once())

tests/Internal/QueueTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ public function excutesNestedEnqueuedTasks()
2929
$queue->enqueue($task);
3030
}
3131

32-
/** @test */
32+
/**
33+
* @test
34+
* @expectedException Exception
35+
* @expectedException test
36+
*/
3337
public function rethrowsExceptionsThrownFromTasks()
3438
{
35-
$this->setExpectedException('\Exception', 'test');
36-
3739
$mock = $this->createCallableMock();
3840
$mock
3941
->expects($this->once())

tests/RejectedPromiseTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ public function getPromiseTestAdapter(callable $canceller = null)
3737
]);
3838
}
3939

40-
/** @test */
40+
/**
41+
* @test
42+
* @expectedException InvalidArgumentException
43+
*/
4144
public function shouldThrowExceptionIfConstructedWithAPromise()
4245
{
43-
$this->setExpectedException('\InvalidArgumentException');
44-
4546
return new RejectedPromise(new RejectedPromise());
4647
}
4748
}

tests/TestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace React\Promise;
44

5-
class TestCase extends \PHPUnit_Framework_TestCase
5+
use PHPUnit\Framework\TestCase as BaseTestCase;
6+
7+
class TestCase extends BaseTestCase
68
{
79
public function expectCallableExactly($amount)
810
{

0 commit comments

Comments
 (0)