/** * @test * @group small * @covers ::put * @covers ::<private> */ public function put() { $payload = 'payload'; $response = new Response('content'); $this->curl->expects($this->once())->method('sendRequest')->with($this->equalTo($this->mockControllerUrl), $this->equalTo('PUT'), $this->equalTo(array()), $this->equalTo($payload))->will($this->returnValue($response)); $this->assertSame($response, $this->restClient->put($this->mockControllerUrl, $payload)); }
/** * @test * @group small * @covers ::put * @covers ::<private> */ public function putOnError() { $response = $this->restClient->put($this->getHTTP404Route(), 'payload'); $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response); $this->assertEquals(404, $response->getStatusCode()); }