Skip to content

Commit

Permalink
Merge pull request #130 from aik099/test-suite-filters-fix
Browse files Browse the repository at this point in the history
Invoke "BrowserTestCase::onTestSuiteEnded" method only for executed tests
  • Loading branch information
aik099 committed Mar 16, 2024
2 parents fe5911c + 1c7a6e2 commit 1054f33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed
- Don't set remote code coverage collection cookies, when the remote code coverage script URL isn't specified.
- The `BrowserTestCase::onTestSuiteEnded` method was called for tests, excluded through the `--filter` option of the PHPUnit.

## [2.3.0] - 2022-11-24
### Changed
Expand Down
12 changes: 6 additions & 6 deletions library/aik099/PHPUnit/TestSuite/AbstractTestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,24 @@ public function runCompat($result = null)
/**
* Report back suite ending to each it's test.
*
* @param array $tests Tests to process.
* @param \IteratorAggregate|null $test_suite Test suite.
*
* @return void
*/
protected function triggerTestSuiteEnded(array $tests = null)
protected function triggerTestSuiteEnded(\IteratorAggregate $test_suite = null)
{
if ( !isset($tests) ) {
$tests = $this->tests();
if ( $test_suite === null ) {
$test_suite = $this;
}

foreach ( $tests as $test ) {
foreach ( $test_suite as $test ) {
if ( $test instanceof DataProviderTestSuite ) {
/*
* Use our test suite method to tear down
* supported test suites wrapped in a data
* provider test suite.
*/
$this->triggerTestSuiteEnded($test->tests());
$this->triggerTestSuiteEnded($test);
}
else {
/*
Expand Down

0 comments on commit 1054f33

Please sign in to comment.