Skip to content

Commit 532cbb7

Browse files
Fix cleanup of included test directories.
* Fix the loading of project configuration before cleanup * Add test to run clean command with include functionality * Fix directory separator in clean command test Co-authored-by: Roland Kalocsaven <roland.kalocsaven@itech.media>
1 parent 516d1d4 commit 532cbb7

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Codeception/Command/Clean.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
3232

3333
private function cleanProjectsRecursively(OutputInterface $output, $projectDir)
3434
{
35+
$config = Configuration::config($projectDir);
36+
3537
$logDir = Configuration::logDir();
3638
$output->writeln("<info>Cleaning up output " . $logDir . "...</info>");
3739
FileSystem::doEmptyDir($logDir);
3840

39-
$config = Configuration::config($projectDir);
4041
$subProjects = $config['include'];
4142
foreach ($subProjects as $subProject) {
4243
$subProjectDir = $projectDir . $subProject;

tests/cli/IncludedCest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,21 @@ public function buildIncluded(\CliGuy $I)
166166
$I->seeInShellOutput('Jazz\\Pianist\\TestGuy');
167167
$I->seeInShellOutput('Shire\\TestGuy');
168168
}
169+
170+
/**
171+
* @before moveToIncluded
172+
* @param CliGuy $I
173+
*/
174+
public function cleanIncluded(\CliGuy $I)
175+
{
176+
$ds = DIRECTORY_SEPARATOR;
177+
178+
$I->executeCommand('clean');
179+
$I->seeInShellOutput("included{$ds}_log");
180+
$I->seeInShellOutput("included{$ds}jazz{$ds}tests/_log");
181+
$I->seeInShellOutput("included{$ds}jazz{$ds}pianist{$ds}tests/_log");
182+
$I->seeInShellOutput("included{$ds}shire{$ds}tests/_log");
183+
$I->seeInShellOutput('Done');
184+
}
185+
169186
}

0 commit comments

Comments
 (0)