ApiPlatform\Core\Tests\Bridge\Symfony\Action\SwaggerUiActionTest::testInvoke PHP Method

testInvoke() public method

public testInvoke ( Request $request, Prophecy\Prophecy\ProphecyInterface $twigProphecy )
$request Symfony\Component\HttpFoundation\Request
$twigProphecy Prophecy\Prophecy\ProphecyInterface
    public function testInvoke(Request $request, ProphecyInterface $twigProphecy)
    {
        $resourceNameCollectionFactoryProphecy = $this->prophesize(ResourceNameCollectionFactoryInterface::class);
        $resourceNameCollectionFactoryProphecy->create()->willReturn(new ResourceNameCollection(['Foo', 'Bar']))->shouldBeCalled();
        $resourceMetadataFactoryProphecy = $this->prophesize(ResourceMetadataFactoryInterface::class);
        $resourceMetadataFactoryProphecy->create('Foo')->willReturn(new ResourceMetadata('F'))->shouldBeCalled();
        $serializerProphecy = $this->prophesize(SerializerInterface::class);
        $serializerProphecy->serialize(Argument::type(Documentation::class), 'json')->willReturn('hello')->shouldBeCalled();
        $action = new SwaggerUiAction($resourceNameCollectionFactoryProphecy->reveal(), $resourceMetadataFactoryProphecy->reveal(), $serializerProphecy->reveal(), $twigProphecy->reveal());
        $action($request);
    }