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;
 }
예제 #2
0
 public function testCanAddOperations()
 {
     $s = new ServiceDescription(array());
     $this->assertFalse($s->hasOperation('Foo'));
     $s->addOperation(new Operation(array('name' => 'Foo')));
     $this->assertTrue($s->hasOperation('Foo'));
 }