mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 11:48:08 +08:00
test: test #1771
This commit is contained in:
parent
8141df2f2d
commit
7b68a3e9c3
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user