ApiPlatform\Core\Tests\JsonLd\Action\ContextActionTest::testContextActionWithThrown PHP Method

testContextActionWithThrown() public method

    public function testContextActionWithThrown()
    {
        $contextBuilderProphecy = $this->prophesize(ContextBuilderInterface::class);
        $resourceNameCollectionFactoryProphecy = $this->prophesize(ResourceNameCollectionFactoryInterface::class);
        $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class);
        $resourceNameCollectionFactoryProphecy->create()->willReturn(new ResourceNameCollection(['gerard']));
        $contextAction = new ContextAction($contextBuilderProphecy->reveal(), $resourceNameCollectionFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal());
        $resourceMetadataFactoryProphecy->create('gerard')->shouldBeCalled()->willReturn(new ResourceMetadata('gerard', 'gerard', '#dummy', ['get' => ['method' => 'GET'], 'put' => ['method' => 'PUT']], ['get' => ['method' => 'GET'], 'post' => ['method' => 'POST'], 'custom' => ['method' => 'GET', 'path' => '/foo'], 'custom2' => ['method' => 'POST', 'path' => '/foo']], []));
        $contextAction('dummy');
    }