You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
867 B
32 lines
867 B
<?php |
|
namespace Ratchet\Application\Server; |
|
use Ratchet\Server\IoConnection; |
|
|
|
/** |
|
* @covers Ratchet\Server\IoConnection |
|
*/ |
|
class IoConnectionTest extends \PHPUnit_Framework_TestCase { |
|
protected $sock; |
|
protected $conn; |
|
|
|
public function setUp() { |
|
$this->sock = $this->getMock('\\React\\Socket\\ConnectionInterface'); |
|
$this->conn = new IoConnection($this->sock); |
|
} |
|
|
|
public function testCloseBubbles() { |
|
$this->sock->expects($this->once())->method('end'); |
|
$this->conn->close(); |
|
} |
|
|
|
public function testSendBubbles() { |
|
$msg = '6 hour rides are productive'; |
|
|
|
$this->sock->expects($this->once())->method('write')->with($msg); |
|
$this->conn->send($msg); |
|
} |
|
|
|
public function testSendReturnsSelf() { |
|
$this->assertSame($this->conn, $this->conn->send('fluent interface')); |
|
} |
|
}
|
|
|