public function testSome() { $testDir = __DIR__ . '/ConfigFilesTest'; $pathProvider = $this->getMockBuilder('ShopwareCli\\Services\\PathProvider\\PathProvider')->disableOriginalConstructor()->getMock(); $pathProvider->expects($this->once())->method('getConfigPath')->will($this->returnValue(__DIR__)); $pathProvider->expects($this->once())->method('getExtensionPath')->will($this->returnValue($testDir)); $pathProvider->expects($this->once())->method('getCliToolPath')->will($this->returnValue($testDir)); $SUT = new ConfigFileCollector($pathProvider); $result = $SUT->collectConfigFiles(); $expectedResults = array($testDir . '/VendorA/ExtB/config.yaml', $testDir . '/VendorC/ExtA/config.yaml', $testDir . '/config.yaml.dist'); foreach ($expectedResults as $expectedResult) { $this->assertContains($expectedResult, $result); } }
/** * @param ConfigFileCollector $fileCollector */ public function __construct(ConfigFileCollector $fileCollector) { $config = $this->getMergedConfigs($fileCollector->collectConfigFiles()); $this->configArray = Yaml::parse($config, true); $this->validateConfig(); }