Skip to content

Commit

Permalink
autoloading splitter
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Dec 18, 2021
1 parent 616747b commit 87390e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,12 @@ class CustomFilter extends DefaultFilter {
The TestFileSplitterTask.php pushes an array of SplFileInfo Objects to the filter.
The TestsSplitterTask.php pushes an array of SelfDescribing Objects to the filter.

## Configuration

Load Codeception config file to specify the path to Codeception before split* tasks:

```php
\Codeception\Configuration::config('tests/codeception.yml');
```

### License MIT
7 changes: 7 additions & 0 deletions src/Splitter/TestsSplitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,13 @@ protected function claimCodeceptionLoaded(): void
}
// autoload PHPUnit files
\Codeception\PHPUnit\Init::init();

try {
// load Codeception config to set base directory
\Codeception\Configuration::config();
} catch (\Exception $e) {
$this->output()->writeln('Codeception config was not loaded, please load it manually');
}
}

/**
Expand Down

0 comments on commit 87390e0

Please sign in to comment.