Submit
Path:
~
/
/
opt
/
psa
/
admin
/
plib
/
vendor
/
plesk
/
ratchetphp
/
tests
/
unit
/
Wamp
/
File Content:
WampServerTest.php
<?php namespace Ratchet\Wamp; use Ratchet\AbstractMessageComponentTestCase; /** * @covers Ratchet\Wamp\WampServer */ class WampServerTest extends AbstractMessageComponentTestCase { public function getConnectionClassString() { return '\Ratchet\Wamp\WampConnection'; } public function getDecoratorClassString() { return 'Ratchet\Wamp\WampServer'; } public function getComponentClassString() { return '\Ratchet\Wamp\WampServerInterface'; } public function testOnMessageToEvent() { $published = 'Client published this message'; $this->app->expects($this->once())->method('onPublish')->with( $this->isExpectedConnection(), new \PHPUnit\Framework\Constraint\IsInstanceOf('\Ratchet\Wamp\Topic'), $published, [], [], ); $this->serv->onMessage($this->conn, json_encode(array(7, 'topic', $published))); } public function testGetSubProtocols() { // todo: could expand on this $this->assertIsArray($this->serv->getSubProtocols()); } public function testConnectionClosesOnInvalidJson() { $this->conn->expects($this->once())->method('close'); $this->serv->onMessage($this->conn, 'invalid json'); } public function testConnectionClosesOnProtocolError() { $this->conn->expects($this->once())->method('close'); $this->serv->onMessage($this->conn, json_encode(array('valid' => 'json', 'invalid' => 'protocol'))); } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
ServerProtocolTest.php
8917 bytes
0644
TopicManagerTest.php
7373 bytes
0644
TopicTest.php
5908 bytes
0644
WampConnectionTest.php
2343 bytes
0644
WampServerTest.php
1560 bytes
0644
N4ST4R_ID | Naxtarrr