SensioLabs\Deptrac\Tests\ClassNameLayerResolverTest::testGetLayersByClassName PHP Метод

testGetLayersByClassName() публичный Метод

public testGetLayersByClassName ( $collectA, $collectB1, $collectB2, array $expectedLayers )
$collectA
$collectB1
$collectB2
$expectedLayers array
    public function testGetLayersByClassName($collectA, $collectB1, $collectB2, array $expectedLayers)
    {
        $configuration = $this->prophesize(Configuration::class);
        $configuration->getLayers()->willReturn([ConfigurationLayer::fromArray(['name' => 'LayerA', 'collectors' => [['type' => 'CollectorA']]]), ConfigurationLayer::fromArray(['name' => 'LayerB', 'collectors' => [['type' => 'CollectorB1'], ['type' => 'CollectorB2']]])]);
        $astMap = $this->prophesize(AstMap::class);
        $collectorFactory = $this->prophesize(CollectorFactory::class);
        $collectorFactory->getCollector('CollectorA')->willReturn($this->getCollector($collectA, ['type' => 'CollectorA', 'foo' => 'bar']));
        $collectorFactory->getCollector('CollectorB1')->willReturn($this->getCollector($collectB1, ['type' => 'CollectorB', 'foo' => 'bar']));
        $collectorFactory->getCollector('CollectorB2')->willReturn($this->getCollector($collectB2, ['type' => 'CollectorB', 'foo' => 'bar']));
        $resolver = new ClassNameLayerResolver($configuration->reveal(), $astMap->reveal(), $collectorFactory->reveal(), $this->prophesize(AstParserInterface::class)->reveal());
        $this->assertEquals($expectedLayers, $resolver->getLayersByClassName('classA'));
    }