1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/objects/cboden/ratchet/tests/unit/Server/IoConnectionTest.php
DanielnetoDotCom 730f4893f2 Adding socket support
-- When upload a video to a certain category, this video will be part of a user group automatically
-- one category can add your video in more than one user group
-- Allow user add some extra info in JSON format, for example bank info and other thing
-- This is based on users_extra_info table 
-- add full text search https://github.com/WWBN/AVideo/issues/4343
2021-01-14 14:24:07 -03:00

32 lines
867 B
PHP

<?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'));
}
}