mxmbsocket/tests/Ratchet/Tests/Mock/Component.php
Chris Boden 47e7059ed6 Mock MessageComponent common access
Updated class to match the WAMP component
2012-04-29 12:38:37 -04:00

29 lines
873 B
PHP

<?php
namespace Ratchet\Tests\Mock;
use Ratchet\Component\MessageComponentInterface;
use Ratchet\Tests\Mock\Socket as MockSocket;
use Ratchet\Resource\ConnectionInterface;
class Component implements MessageComponentInterface {
public $last = array();
public function __construct(ComponentInterface $app = null) {
$this->last[__FUNCTION__] = func_get_args();
}
public function onOpen(ConnectionInterface $conn) {
$this->last[__FUNCTION__] = func_get_args();
}
public function onMessage(ConnectionInterface $from, $msg) {
$this->last[__FUNCTION__] = func_get_args();
}
public function onClose(ConnectionInterface $conn) {
$this->last[__FUNCTION__] = func_get_args();
}
public function onError(ConnectionInterface $conn, \Exception $e) {
$this->last[__FUNCTION__] = func_get_args();
}
}