Esempio n. 1
0
 protected function setUp()
 {
     $this->serializer = $this->getMockForAbstractClass('Wookieb\\ZorroRPC\\Serializer\\ServerSerializerInterface');
     $this->transport = $this->getMockForAbstractClass('Wookieb\\ZorroRPC\\Transport\\ServerTransportInterface');
     if ($this->useFalseWaitingForResponse) {
         $this->transport->expects($this->any())->method('isWaitingForResponse')->will($this->returnValue(false));
     }
     $this->rpcTarget = $this->getMock('\\stdClass', $this->methods);
     $this->object = new Server($this->transport, $this->serializer);
     $this->object->setOnErrorCallback(function ($e) {
         throw $e;
     });
 }
Esempio n. 2
0
 public function testErrorCallbackShouldBeCallable()
 {
     $this->setExpectedException('\\InvalidArgumentException', 'Argument must be a callback');
     $this->server->setOnErrorCallback(false);
 }