@@ -70,7 +70,7 @@ public function test_initialize_generates_client_id_and_sends_endpoint(): void
7070 // Assert
7171 $ expectedClientId = $ this ->getProtectedProperty ($ this ->instance , 'clientId ' );
7272 $ expectedOutput = 'event: endpoint ' .PHP_EOL
73- .'data: /default-path/message ?sessionId= ' .$ expectedClientId .PHP_EOL .PHP_EOL ;
73+ .'data: /default-path/messages ?sessionId= ' .$ expectedClientId .PHP_EOL .PHP_EOL ;
7474
7575 $ this ->assertNotNull ($ expectedClientId );
7676 $ this ->assertEquals ($ expectedOutput , $ output );
@@ -97,7 +97,7 @@ public function test_initialize_does_not_overwrite_existing_client_id(): void
9797 // Assert
9898 $ currentClientId = $ this ->getProtectedProperty ($ this ->instance , 'clientId ' );
9999 $ expectedOutput = 'event: endpoint ' .PHP_EOL
100- .'data: /default-path/message ?sessionId= ' .$ existingClientId .PHP_EOL .PHP_EOL ;
100+ .'data: /default-path/messages ?sessionId= ' .$ existingClientId .PHP_EOL .PHP_EOL ;
101101
102102 $ this ->assertSame ($ existingClientId , $ currentClientId );
103103 $ this ->assertEquals ($ expectedOutput , $ output );
@@ -631,7 +631,7 @@ private function setProtectedProperty(SseTransport $instance, string $propertyNa
631631 public function test_set_ping_interval_updates_correctly (): void
632632 {
633633 // Arrange
634- $ validPingInterval = 120 ; // A valid interval in secondes
634+ $ validPingInterval = 10 ; // A valid interval in secondes
635635 $ reflection = new \ReflectionClass ($ this ->instance );
636636 $ method = $ reflection ->getMethod ('setPingInterval ' );
637637
@@ -649,7 +649,7 @@ public function test_set_ping_interval_updates_correctly(): void
649649 public function test_set_ping_interval_with_less_than_minimum_value (): void
650650 {
651651 // Arrange
652- $ invalidPingInterval = 10 ; // Less than the minimum allowed value (60s )
652+ $ invalidPingInterval = 1 ; // Less than the minimum allowed value (5s )
653653 $ reflection = new \ReflectionClass ($ this ->instance );
654654 $ method = $ reflection ->getMethod ('setPingInterval ' );
655655
@@ -658,7 +658,7 @@ public function test_set_ping_interval_with_less_than_minimum_value(): void
658658 $ updatedPingInterval = $ reflection ->getProperty ('pingInterval ' )->getValue ($ this ->instance );
659659
660660 // Assert
661- $ this ->assertEquals (60 , $ updatedPingInterval );
661+ $ this ->assertEquals (5 , $ updatedPingInterval );
662662 }
663663
664664 /**
@@ -667,7 +667,7 @@ public function test_set_ping_interval_with_less_than_minimum_value(): void
667667 public function test_set_ping_interval_with_more_than_maximum_value (): void
668668 {
669669 // Arrange
670- $ invalidPingInterval = 240 ; // More than the maximum allowed value (180 s)
670+ $ invalidPingInterval = 60 ; // More than the maximum allowed value (30 s)
671671 $ reflection = new \ReflectionClass ($ this ->instance );
672672 $ method = $ reflection ->getMethod ('setPingInterval ' );
673673
@@ -676,7 +676,7 @@ public function test_set_ping_interval_with_more_than_maximum_value(): void
676676 $ updatedPingInterval = $ reflection ->getProperty ('pingInterval ' )->getValue ($ this ->instance );
677677
678678 // Assert
679- $ this ->assertEquals (180 , $ updatedPingInterval );
679+ $ this ->assertEquals (30 , $ updatedPingInterval );
680680 }
681681
682682 /**
@@ -779,7 +779,7 @@ public function test_is_connected_triggers_a_ping_message_if_needed(): void
779779 }
780780
781781 // Assert
782- $ this ->assertTrue ($ result , 'Expected isConnected to return false when connection is not active. ' );
782+ $ this ->assertFalse ($ result , 'Expected isConnected to return false when connection is not active. ' );
783783 $ this ->assertStringContainsString ('"method":"ping" ' , $ output );
784784 }
785785}
0 commit comments