Skip to content

Commit 76d36f8

Browse files
committed
Added PHPUnit 5 and 6 support
1 parent a4fb173 commit 76d36f8

5 files changed

Lines changed: 19 additions & 13 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.35"
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
}

0 commit comments

Comments
 (0)