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