Submit
Path:
~
/
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
vendor
/
plesk
/
ratchetphp
/
tests
/
unit
/
Server
/
File Content:
EchoServerTest.php
<?php namespace Ratchet\Server; /** * @covers Ratchet\Server\EchoServer */ class EchoServerTest extends \PHPUnit\Framework\TestCase { protected $conn; protected $comp; public function setUp(): void { $this->conn = $this->createMock('\Ratchet\ConnectionInterface'); $this->comp = new EchoServer(); } public function testMessageEchod() { $message = 'Tillsonburg, my back still aches when I hear that word.'; $this->conn->expects($this->once())->method('send')->with($message); $this->comp->onMessage($this->conn, $message); } public function testErrorClosesConnection() { ob_start(); $this->conn->expects($this->once())->method('close'); $this->comp->onError($this->conn, new \Exception()); ob_end_clean(); } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
EchoServerTest.php
832 bytes
0644
IoConnectionTest.php
894 bytes
0644
IoServerTest.php
3474 bytes
0644
IpBlackListComponentTest.php
3547 bytes
0644
N4ST4R_ID | Naxtarrr