ApiPlatform\SchemaGenerator\Tests\TypesGeneratorTest::testGenerate PHP 메소드

testGenerate() 공개 메소드

public testGenerate ( )
    public function testGenerate()
    {
        $twigProphecy = $this->prophesize('Twig_Environment');
        $classes = $this->getClasses();
        foreach ($classes as $class) {
            $twigProphecy->render('class.php.twig', Argument::that($this->getContextMatcher($class)))->willReturn()->shouldBeCalled();
        }
        $twigProphecy->render('class.php.twig', Argument::type('array'))->willReturn();
        $twig = $twigProphecy->reveal();
        $cardinalitiesExtractorProphecy = $this->prophesize('ApiPlatform\\SchemaGenerator\\CardinalitiesExtractor');
        $cardinalities = $this->getCardinalities();
        $cardinalitiesExtractorProphecy->extract()->willReturn($cardinalities)->shouldBeCalled();
        $cardinalitiesExtractor = $cardinalitiesExtractorProphecy->reveal();
        $goodRelationsBridgeProphecy = $this->prophesize('ApiPlatform\\SchemaGenerator\\GoodRelationsBridge');
        $goodRelationsBridge = $goodRelationsBridgeProphecy->reveal();
        $typesGenerator = new TypesGenerator($twig, new NullLogger(), $this->getGraphs(), $cardinalitiesExtractor, $goodRelationsBridge);
        $typesGenerator->generate($this->getConfig());
    }