diff --git a/src/socketio-server/tests/Cases/SocketTest.php b/src/socketio-server/tests/Cases/SocketTest.php index c7ad946ab..998a34c1f 100644 --- a/src/socketio-server/tests/Cases/SocketTest.php +++ b/src/socketio-server/tests/Cases/SocketTest.php @@ -98,4 +98,17 @@ class SocketTest extends AbstractTestCase $socket1->to('room')->emit('hello'); $this->assertTrue(true); } + + public function testBroadcast() + { + $socket1 = make(Socket::class, [ + 'fd' => 1, + 'nsp' => '/', + ]); + $reflection = new \ReflectionClass(Socket::class); + $prop = $reflection->getProperty('broadcast'); + $prop->setAccessible(true); + $this->assertFalse($prop->getValue($socket1)); + $this->assertTrue($prop->getValue($socket1->broadcast)); + } }