Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke "BrowserTestCase::onTestSuiteEnded" method only for executed tests #130

Merged
merged 1 commit into from Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
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
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