Exemplo n.º 1
0
 /**
  * @dataProvider getFormatAndBody
  */
 public function testCreateDeleteRequest($format, $expectedBody, $parameters, $requirements, $expectedQueryString)
 {
     $blog = new Blog();
     $blog->id = 42;
     $this->factory->setFormat($format);
     $this->urlGenerator->expects($this->once())->method('getRemoveUrl')->with('blogs', 42, $parameters, $requirements)->will($this->returnValue('/blogs/42' . $expectedQueryString));
     $request = $this->factory->createDeleteRequest($blog, $parameters);
     $this->assertEquals('DELETE', $request->getMethod());
     $this->assertEquals('application/' . $format, $request->getHeaderLine('Content-Type'));
     $this->assertEquals('/blogs/42' . $expectedQueryString, $request->getUri());
     $this->assertEquals('', (string) $request->getBody());
 }