Skip to content

Commit

Permalink
[TesterBundle] php doc to strong type asserMessageMatch return value
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoiriert committed Dec 7, 2023
1 parent 80cd3e8 commit d92919a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions packages/tester-bundle/Messenger/TransportTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ public function getTransport(): TransportInterface
return $this->transport;
}

/**
* @template T of object
* @param class-string<T> $messageClass the name of the class
*
* @return array<T>
*/
public function assertMessageMatch(
string $messageClass,
?Expression $expression = null,
$count = 1,
$message = ''
int $count = 1,
string $message = ''
): array {
$messages = [];
foreach ($this->transport->get() as $envelope) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public function testAssertMatchFailed(): void

$this->expectException(ExpectationFailedException::class);

$this->transportTester->assertMessageMatch('test');
$this->transportTester->assertMessageMatch(\Exception::class);
}
}

0 comments on commit d92919a

Please sign in to comment.