Skip to content

Commit

Permalink
Merge pull request #6482 from Codeception/5.0-merge-4.2
Browse files Browse the repository at this point in the history
Merge 4.2 to 5.0
  • Loading branch information
Naktibalda committed Jun 22, 2022
2 parents 522c7f0 + a3a2775 commit 4a5f2f4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG-4.x.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#### 4.2.1

* Execute setupBeforeClass/tearDownAfterClass only once (#6481)
* Handle action with intersection return type correctly in dry-run command

#### 4.2.0

* Improved multi-application experience, allow filtering suites by name (#6435) by @calvinalkan
Expand Down
2 changes: 2 additions & 0 deletions src/Codeception/Subscriber/BeforeAfterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class BeforeAfterTest implements EventSubscriberInterface

public function beforeClass(SuiteEvent $event): void
{
$this->hooks = [];

foreach ($event->getSuite()->getTests() as $test) {
$testClass = $test::class;
if (PHPUnitVersion::series() < 10) {
Expand Down
8 changes: 8 additions & 0 deletions tests/cli/OrderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,12 @@ public function checkBootstrapIsLoadedBeforeTests(CliGuy $I)
$I->seeFileFound('order.txt', 'tests/_output');
$I->seeInThisFile('BIBP(T)');
}

public function checkAfterBeforeHooksAreExecutedOnlyOnce(CliGuy $I)
{
$I->amInPath('tests/data/sandbox');
$I->executeCommand('run math,order,scenario,skipped :BeforeAfterClassTest');
$I->seeFileFound('order.txt', 'tests/_output');
$I->seeInThisFile('BIBP({[1][2]})');
}
}

0 comments on commit 4a5f2f4

Please sign in to comment.