Skip to content

Commit d80d16c

Browse files
committed
Resolves #22
1 parent 6eb468d commit d80d16c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/AssertsPromise.php

+2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ public function assertPromiseRejectsWith(PromiseInterface $promise, string $reas
107107
$this->assertInstanceOf(
108108
$reasonExceptionClass, $reason, 'Failed asserting that promise rejects with a specified reason.'
109109
);
110+
111+
return;
110112
}
111113

112114
$this->fail('Failed asserting that promise rejects. Promise was fulfilled.');

tests/PromiseRejectsWithTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public function promise_rejects_with_a_specified_reason(): void
1313
{
1414
try {
1515
$deferred = new Deferred();
16-
$deferred->reject(new \LogicException());
17-
$this->assertPromiseRejectsWith($deferred->promise(), \InvalidArgumentException::class);
16+
$deferred->reject(new \InvalidArgumentException());
17+
$this->assertPromiseRejectsWith($deferred->promise(), \LogicException::class);
1818
} catch (Exception $exception) {
1919
$this->assertMatchesRegularExpression('/Failed asserting that promise rejects with a specified reason/', $exception->getMessage());
2020
$this->assertMatchesRegularExpression(

0 commit comments

Comments
 (0)