/**
  * @dataProvider getDataProvider
  *
  * @param string $method
  * @param array  $tests
  */
 public function testParse($method, array $tests)
 {
     $this->requestMock->getMethod()->willReturn($method)->shouldBeCalled();
     foreach ($tests as $test) {
         $this->requestMock->addTest($test)->shouldBeCalledTimes(1);
     }
     $this->parser->parse($this->requestMock->reveal());
 }
 /**
  * @dataProvider getDataProvider
  *
  * @param string $method
  * @param string $name
  * @param string $url
  */
 public function testParse($method, $name, $url = null)
 {
     $resourceMock = $this->prophesize('Dunglas\\ApiBundle\\Api\\ResourceInterface');
     $this->requestMock->getResource()->willReturn($resourceMock->reveal())->shouldBeCalledTimes(1);
     $resourceMock->getShortName()->willReturn('User')->shouldBeCalledTimes(1);
     $this->requestMock->getMethod()->willReturn($method)->shouldBeCalledTimes(1);
     $this->requestMock->setName($name)->shouldBeCalledTimes(1);
     if ('GET' === $method) {
         $this->requestMock->getUrl()->willReturn($url)->shouldBeCalledTimes(1);
     }
     $this->parser->parse($this->requestMock->reveal());
 }
 public function testNoSupports()
 {
     $this->requestMock->getMethod()->willReturn('GET', 'DELETE');
     $this->assertFalse($this->parser->supports($this->requestMock->reveal()));
     $this->assertFalse($this->parser->supports($this->requestMock->reveal()));
 }