2020use Workbunny \WebmanPushServer \PublishTypes \AbstractPublishType ;
2121use Workbunny \WebmanPushServer \PushServer ;
2222use Workerman \Worker ;
23+ use function Workbunny \WebmanPushServer \ms_timestamp ;
2324use const Workbunny \WebmanPushServer \EVENT_CONNECTION_ESTABLISHED ;
2425use const Workbunny \WebmanPushServer \EVENT_ERROR ;
2526use const Workbunny \WebmanPushServer \EVENT_PONG ;
@@ -442,9 +443,10 @@ public function testPushServerSubscribeResponse()
442443
443444 // 模拟服务广播响应 非忽略的channel广播
444445 PushServer::_subscribeResponse (AbstractPublishType::PUBLISH_TYPE_CLIENT , [
445- 'appKey ' => PushServer::getConnectionProperty ($ channelConnection , 'appKey ' ),
446- 'event ' => EVENT_PONG ,
447- 'channel ' => 'public-test '
446+ 'appKey ' => PushServer::getConnectionProperty ($ channelConnection , 'appKey ' ),
447+ 'timestamp ' => ms_timestamp (),
448+ 'event ' => EVENT_PONG ,
449+ 'channel ' => 'public-test '
448450 ]);
449451 // 断言检测回执buffer 仅合法channel连接接收到广播回执
450452 $ this ->assertNull ($ tcpConnection ->getSendBuffer ());
@@ -457,10 +459,11 @@ public function testPushServerSubscribeResponse()
457459
458460 // 模拟服务广播响应 指定忽略socketId的channel广播
459461 PushServer::_subscribeResponse (AbstractPublishType::PUBLISH_TYPE_CLIENT , [
460- 'appKey ' => PushServer::getConnectionProperty ($ channelConnection , 'appKey ' ),
461- 'event ' => EVENT_PONG ,
462- 'channel ' => 'public-test ' ,
463- 'socketId ' => PushServer::getConnectionProperty ($ channelConnection , 'socketId ' ),
462+ 'appKey ' => PushServer::getConnectionProperty ($ channelConnection , 'appKey ' ),
463+ 'socketId ' => PushServer::getConnectionProperty ($ channelConnection , 'socketId ' ),
464+ 'timestamp ' => ms_timestamp (),
465+ 'event ' => EVENT_PONG ,
466+ 'channel ' => 'public-test ' ,
464467 ]);
465468 // 断言检测回执buffer 所有连接不应接收到回执
466469 $ this ->assertNull ($ tcpConnection ->getSendBuffer ());
@@ -473,9 +476,10 @@ public function testPushServerSubscribeResponse()
473476
474477 // 模拟服务广播响应 向未知连接广播
475478 PushServer::_subscribeResponse (AbstractPublishType::PUBLISH_TYPE_CLIENT , [
476- 'appKey ' => PushServer::$ unknownTag ,
477- 'event ' => EVENT_PONG ,
478- 'channel ' => 'public-test ' ,
479+ 'appKey ' => PushServer::$ unknownTag ,
480+ 'timestamp ' => ms_timestamp (),
481+ 'event ' => EVENT_PONG ,
482+ 'channel ' => 'public-test ' ,
479483 ]);
480484 // 断言检测回执buffer 所有连接不应接收到回执
481485 $ this ->assertNull ($ tcpConnection ->getSendBuffer ());
0 commit comments