Skip to content

Commit 5cec69b

Browse files
committed
renames "assertSentNotification"
1 parent fe7b67a commit 5cec69b

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

src/Server/Testing/TestResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function assertNotificationCount(int $count): static
8282
/**
8383
* @param array<string, mixed>|null $params
8484
*/
85-
public function assertNotification(string $method, ?array $params = null): static
85+
public function assertSentNotification(string $method, ?array $params = null): static
8686
{
8787
foreach ($this->notifications as $notification) {
8888
$content = $notification->toArray();

tests/Feature/Testing/Prompts/AssertNotificationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function handle(Request $request): Generator
4949
$response = RestaurantP::prompt(ReservationPrompt::class);
5050

5151
$response->assertNotificationCount(2)
52-
->assertNotification('booking/starting', ['step' => 1])
53-
->assertNotification('booking/completed', ['step' => 2]);
52+
->assertSentNotification('booking/starting', ['step' => 1])
53+
->assertSentNotification('booking/completed', ['step' => 2]);
5454
});
5555

5656
it('may fail to assert the notification count is wrong', function (): void {
@@ -62,11 +62,11 @@ public function handle(Request $request): Generator
6262
it('may fail to assert a notification that was not sent', function (): void {
6363
$response = RestaurantP::prompt(ReservationPrompt::class);
6464

65-
$response->assertNotification('booking/unknown');
65+
$response->assertSentNotification('booking/unknown');
6666
})->throws(AssertionFailedError::class);
6767

6868
it('may fail to assert a notification that was sent with wrong params', function (): void {
6969
$response = RestaurantP::prompt(ReservationPrompt::class);
7070

71-
$response->assertNotification('booking/starting', ['step' => 2]);
71+
$response->assertSentNotification('booking/starting', ['step' => 2]);
7272
})->throws(AssertionFailedError::class);

tests/Feature/Testing/Resources/AssertNotificationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function handle(Request $request): Generator
4949
$response = RestaurantR::resource(ReservationResource::class);
5050

5151
$response->assertNotificationCount(2)
52-
->assertNotification('booking/starting', ['step' => 1])
53-
->assertNotification('booking/completed', ['step' => 2]);
52+
->assertSentNotification('booking/starting', ['step' => 1])
53+
->assertSentNotification('booking/completed', ['step' => 2]);
5454
});
5555

5656
it('may fail to assert the notification count is wrong', function (): void {
@@ -62,11 +62,11 @@ public function handle(Request $request): Generator
6262
it('may fail to assert a notification that was not sent', function (): void {
6363
$response = RestaurantR::resource(ReservationResource::class);
6464

65-
$response->assertNotification('booking/unknown');
65+
$response->assertSentNotification('booking/unknown');
6666
})->throws(AssertionFailedError::class);
6767

6868
it('may fail to assert a notification that was sent with wrong params', function (): void {
6969
$response = RestaurantR::resource(ReservationResource::class);
7070

71-
$response->assertNotification('booking/starting', ['step' => 2]);
71+
$response->assertSentNotification('booking/starting', ['step' => 2]);
7272
})->throws(AssertionFailedError::class);

tests/Feature/Testing/Tools/AssertNotificationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function handle(Request $request): Generator
4949
$response = RestaurantT::tool(ReservationTool::class);
5050

5151
$response->assertNotificationCount(2)
52-
->assertNotification('booking/starting', ['step' => 1])
53-
->assertNotification('booking/completed', ['step' => 2]);
52+
->assertSentNotification('booking/starting', ['step' => 1])
53+
->assertSentNotification('booking/completed', ['step' => 2]);
5454
});
5555

5656
it('may fail to assert the notification count is wrong', function (): void {
@@ -62,11 +62,11 @@ public function handle(Request $request): Generator
6262
it('may fail to assert a notification that was not sent', function (): void {
6363
$response = RestaurantT::tool(ReservationTool::class);
6464

65-
$response->assertNotification('booking/unknown');
65+
$response->assertSentNotification('booking/unknown');
6666
})->throws(AssertionFailedError::class);
6767

6868
it('may fail to assert a notification that was sent with wrong params', function (): void {
6969
$response = RestaurantT::tool(ReservationTool::class);
7070

71-
$response->assertNotification('booking/starting', ['step' => 2]);
71+
$response->assertSentNotification('booking/starting', ['step' => 2]);
7272
})->throws(AssertionFailedError::class);

0 commit comments

Comments
 (0)