Skip to content

Commit 069e909

Browse files
fix(tests): Update notifier tests for clarity and functionality
1 parent 4e2cc08 commit 069e909

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

tests/Unit/RegistryTest.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ function getRegistryProperty(Registry $reg, string $propName)
378378

379379
// --- Notifier Tests ---
380380

381-
it('default notifiers send messages via ClientStateManager', function () {
381+
it('sends notifications when tools, resources, and prompts are registered', function () {
382382
// Arrange
383383
$tool = createTestTool('notify-tool');
384384
$resource = createTestResource('notify://res');
@@ -392,18 +392,12 @@ function getRegistryProperty(Registry $reg, string $propName)
392392
$this->registry->registerPrompt($prompt);
393393
});
394394

395-
it('custom notifiers can be set and are called', function () {
395+
it('does not send notifications when notifications are disabled', function () {
396396
// Arrange
397-
$toolNotifierCalled = false;
398-
$this->registry->setToolsChangedNotifier(function () use (&$toolNotifierCalled) {
399-
$toolNotifierCalled = true;
400-
});
397+
$this->registry->disableNotifications();
401398

402399
$this->clientStateManager->shouldNotReceive('queueMessageForAll');
403400

404401
// Act
405-
$this->registry->registerTool(createTestTool('custom-notify'));
406-
407-
// Assert
408-
expect($toolNotifierCalled)->toBeTrue();
402+
$this->registry->registerTool(createTestTool('notify-tool'));
409403
});

0 commit comments

Comments
 (0)