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; }); }
public function testErrorCallbackShouldBeCallable() { $this->setExpectedException('\\InvalidArgumentException', 'Argument must be a callback'); $this->server->setOnErrorCallback(false); }