Skip to content

Commit 50afc5f

Browse files
committed
Reject matching mocks
1 parent 40304de commit 50afc5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MockMiddleware.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ public function pre(
4040
): CancellablePromiseInterface {
4141
foreach ($this->mocks as $mock) {
4242
if ($mock->match($request)) {
43-
return resolve($mock->response($request));
43+
return reject($mock->response($request));
4444
}
4545
}
4646

47-
return reject(InternalServerErrorException::create(new Response(500, [], self::ERROR_MESSAGE), new \RuntimeException(self::ERROR_MESSAGE)));
47+
return reject(new Response(500, [], self::ERROR_MESSAGE));
4848
}
4949
}

0 commit comments

Comments
 (0)