Lemon\RestBundle\Tests\Controller\ResourceControllerTest::testOptions PHP Method

testOptions() public method

public testOptions ( )
    public function testOptions()
    {
        $registry = $this->container->get('lemon_rest.object_registry');
        $definition = new Definition('place', 'Lemon\\RestBundle\\Tests\\Fixtures\\Place', true, false, false, true, false);
        $registry->add($definition);
        $request = $this->makeRequest('OPTIONS', '/place');
        /** @var \Symfony\Component\HttpFoundation\Response $response */
        $response = $this->controller->optionsAction($request, 'place');
        $this->assertEquals('OPTIONS, GET', $response->headers->get('Allowed'));
        $request = $this->makeRequest('OPTIONS', '/place/1');
        /** @var \Symfony\Component\HttpFoundation\Response $response */
        $response = $this->controller->optionsAction($request, 'place', 1);
        $this->assertEquals('OPTIONS, DELETE, GET', $response->headers->get('Allowed'));
        $request = $this->makeRequest('OPTIONS', '/person');
        /** @var \Symfony\Component\HttpFoundation\Response $response */
        $response = $this->controller->optionsAction($request, 'person');
        $this->assertEquals('OPTIONS, POST, GET', $response->headers->get('Allowed'));
        $request = $this->makeRequest('OPTIONS', '/person/1');
        /** @var \Symfony\Component\HttpFoundation\Response $response */
        $response = $this->controller->optionsAction($request, 'person', 1);
        $this->assertEquals('OPTIONS, PUT, DELETE, GET', $response->headers->get('Allowed'));
    }