Skip to content

Commit 1c7a6e2

Browse files
committed
Iterate PHPUnit test suite correctly
1 parent fe5911c commit 1c7a6e2

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1919

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

2324
## [2.3.0] - 2022-11-24
2425
### Changed

library/aik099/PHPUnit/TestSuite/AbstractTestSuite.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,24 +134,24 @@ public function runCompat($result = null)
134134
/**
135135
* Report back suite ending to each it's test.
136136
*
137-
* @param array $tests Tests to process.
137+
* @param \IteratorAggregate|null $test_suite Test suite.
138138
*
139139
* @return void
140140
*/
141-
protected function triggerTestSuiteEnded(array $tests = null)
141+
protected function triggerTestSuiteEnded(\IteratorAggregate $test_suite = null)
142142
{
143-
if ( !isset($tests) ) {
144-
$tests = $this->tests();
143+
if ( $test_suite === null ) {
144+
$test_suite = $this;
145145
}
146146

147-
foreach ( $tests as $test ) {
147+
foreach ( $test_suite as $test ) {
148148
if ( $test instanceof DataProviderTestSuite ) {
149149
/*
150150
* Use our test suite method to tear down
151151
* supported test suites wrapped in a data
152152
* provider test suite.
153153
*/
154-
$this->triggerTestSuiteEnded($test->tests());
154+
$this->triggerTestSuiteEnded($test);
155155
}
156156
else {
157157
/*

0 commit comments

Comments
 (0)