Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not emit Test\ConsideredRisky event twice when a test is run in is…
…olated process
- Loading branch information
1 parent
850bd7f
commit cbd0ac1
Showing
2 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
tests/end-to-end/event/test-risky-no-assertions-isolation.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--TEST-- | ||
The right events are emitted in the right order for a test that is run in an isolated process and is considered risky because it did not perform assertions | ||
--SKIPIF-- | ||
<?php declare(strict_types=1); | ||
if (DIRECTORY_SEPARATOR === '\\') { | ||
print "skip: this test does not work on Windows / GitHub Actions\n"; | ||
} | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$traceFile = tempnam(sys_get_temp_dir(), __FILE__); | ||
|
||
$_SERVER['argv'][] = '--process-isolation'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-output'; | ||
$_SERVER['argv'][] = '--log-events-text'; | ||
$_SERVER['argv'][] = $traceFile; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/RiskyBecauseNoAssertionsTest.php'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
|
||
PHPUnit\TextUI\Application::main(false); | ||
|
||
print file_get_contents($traceFile); | ||
|
||
unlink($traceFile); | ||
--EXPECTF-- | ||
Test Runner Started (PHPUnit %s using %s) | ||
Test Runner Configured | ||
Test Suite Loaded (1 test) | ||
Test Suite Sorted | ||
Event Facade Sealed | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (PHPUnit\TestFixture\Event\RiskyBecauseNoAssertionsTest, 1 test) | ||
Test Preparation Started (PHPUnit\TestFixture\Event\RiskyBecauseNoAssertionsTest::testOne) | ||
Test Prepared (PHPUnit\TestFixture\Event\RiskyBecauseNoAssertionsTest::testOne) | ||
Test Passed (PHPUnit\TestFixture\Event\RiskyBecauseNoAssertionsTest::testOne) | ||
Test Considered Risky (PHPUnit\TestFixture\Event\RiskyBecauseNoAssertionsTest::testOne) | ||
This test did not perform any assertions | ||
Test Finished (PHPUnit\TestFixture\Event\RiskyBecauseNoAssertionsTest::testOne) | ||
Test Suite Finished (PHPUnit\TestFixture\Event\RiskyBecauseNoAssertionsTest, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished |