diff --git a/src/Codeception/Command/Run.php b/src/Codeception/Command/Run.php index 237af968d5..20db2b641e 100644 --- a/src/Codeception/Command/Run.php +++ b/src/Codeception/Command/Run.php @@ -350,7 +350,11 @@ public function execute(InputInterface $input, OutputInterface $output) if (strpos($suite, $include) === 0) { // Use include config $config = Configuration::config($projectDir.$include); - + + if(!empty($this->options['override'])) { + $config = $this->overrideConfig($this->options['override']); + } + if (!isset($config['paths']['tests'])) { throw new \RuntimeException( sprintf("Included '%s' has no tests path configured", $include) diff --git a/tests/cli/IncludedCest.php b/tests/cli/IncludedCest.php index e63371842e..789d0d1409 100644 --- a/tests/cli/IncludedCest.php +++ b/tests/cli/IncludedCest.php @@ -205,4 +205,19 @@ public function includedSuitesAreNotRunTwice (CliGuy $I) { $I->seeInShellOutput('2 tests'); $I->dontSeeInShellOutput('4 tests'); } + + /** + * @param CliGuy $I + * @before moveToIncluded + */ + public function overwrittenConfigurationIsAlsoAppliedWhenRunningAnIncludedAppFromTheRootApp(CliGuy $I) + { + if(PHP_VERSION_ID < 700100) { + $I->markTestSkipped('This test can only run on PHP >= 7.1 because of reporter type declarations.'); + } + $I->executeCommand('run jazz/tests/functional --report -o "reporters: report: Jazz\CustomReporter1"'); + $I->seeInShellOutput('CustomReporter1'); + } + + } diff --git a/tests/data/included/jazz/tests/_helpers/CustomReporter1.php b/tests/data/included/jazz/tests/_helpers/CustomReporter1.php new file mode 100644 index 0000000000..fa98e848f2 --- /dev/null +++ b/tests/data/included/jazz/tests/_helpers/CustomReporter1.php @@ -0,0 +1,14 @@ +write('CustomReporter1'); + } + +} \ No newline at end of file