protected function getMockedClient(Response $response) { $operation = new Operation(array('httpMethod' => 'GET', 'name' => 'Mock')); $service = new ServiceDescription(); $service->addOperation($operation); $plugin = new MockPlugin(); $plugin->addResponse($response); $client = new Client(); $client->setDescription($service); $client->addSubscriber($plugin); return $client; }
public function testCanAddOperations() { $s = new ServiceDescription(array()); $this->assertFalse($s->hasOperation('Foo')); $s->addOperation(new Operation(array('name' => 'Foo'))); $this->assertTrue($s->hasOperation('Foo')); }