 986edd9562
			
		
	
	
		986edd9562
		
	
	
	
	
		
			
			BC break: Updated the `WampServerInterface` to have a strict API Exclude and Eligible are now always arrays acting like black/white list Changed `uri` to `topic` to be more generic with Pub/Sub Added unit tests for `onPublish`
		
			
				
	
	
		
			43 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| namespace Ratchet\Tests\Mock;
 | |
| use Ratchet\Wamp\WampServerInterface;
 | |
| use Ratchet\WebSocket\WsServerInterface;
 | |
| use Ratchet\ConnectionInterface;
 | |
| 
 | |
| class WampComponent implements WampServerInterface, WsServerInterface {
 | |
|     public $last = array();
 | |
| 
 | |
|     public $protocols = array();
 | |
| 
 | |
|     public function getSubProtocols() {
 | |
|         return $this->protocols;
 | |
|     }
 | |
| 
 | |
|     public function onCall(ConnectionInterface $conn, $id, $procURI, array $params) {
 | |
|         $this->last[__FUNCTION__] = func_get_args();
 | |
|     }
 | |
| 
 | |
|     public function onSubscribe(ConnectionInterface $conn, $topic) {
 | |
|         $this->last[__FUNCTION__] = func_get_args();
 | |
|     }
 | |
| 
 | |
|     public function onUnSubscribe(ConnectionInterface $conn, $topic) {
 | |
|         $this->last[__FUNCTION__] = func_get_args();
 | |
|     }
 | |
| 
 | |
|     public function onPublish(ConnectionInterface $conn, $topic, $event, array $exclude = array(), array $eligible = array()) {
 | |
|         $this->last[__FUNCTION__] = func_get_args();
 | |
|     }
 | |
| 
 | |
|     public function onOpen(ConnectionInterface $conn) {
 | |
|         $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();
 | |
|     }
 | |
| } |