File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535class RegistryTest extends TestCase
3636{
3737 private Registry $ registry ;
38- private Protocol $ protocol ;
38+ private Protocol | MockObject $ protocol ;
3939 private LoggerInterface |MockObject $ logger ;
4040
4141 protected function setUp (): void
@@ -583,6 +583,21 @@ public function testUnsubscribeRemovesOnlyTargetSession(): void
583583 $ this ->registry ->unsubscribe ($ session1 , $ uri );
584584 }
585585
586+ public function testUnsubscribeStopsNotifications (): void
587+ {
588+ $ protocol = $ this ->createMock (Protocol::class);
589+ $ session = $ this ->createMock (SessionInterface::class);
590+ $ session ->method ('getId ' )->willReturn (Uuid::v4 ());
591+ $ uri = 'test://resource ' ;
592+
593+ $ this ->registry ->subscribe ($ session , $ uri );
594+ $ this ->registry ->unsubscribe ($ session , $ uri );
595+
596+ $ protocol ->expects ($ this ->never ())->method ('sendNotification ' );
597+
598+ $ this ->registry ->notifyResourceChanged ($ protocol , $ uri );
599+ }
600+
586601 public function testDuplicateSubscribeDoesNotTriggerDuplicateNotifications (): void
587602 {
588603 $ session = $ this ->createMock (SessionInterface::class);
You can’t perform that action at this time.
0 commit comments