-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inline SKIPIF evaluation without side-effects
- Loading branch information
Showing
9 changed files
with
213 additions
and
15 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,14 @@ | ||
--TEST-- | ||
PHPT uses a subprocess when --INI-- is present, even if --SKIPIF-- has no side-effect | ||
--INI-- | ||
error_reporting=-1 | ||
--SKIPIF-- | ||
<?php declare(strict_types=1); | ||
if (1 == 2) { | ||
echo "skip this test\n"; | ||
} | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
echo "Hello, World!\n"; | ||
--EXPECT-- | ||
Hello, World! |
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,9 @@ | ||
--TEST-- | ||
PHPT skip condition which exits the subprocess (side-effect) | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
--SKIPIF-- | ||
<?php declare(strict_types=1); | ||
echo "skip this test\n"; | ||
exit(1); | ||
--EXPECT-- |
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,33 @@ | ||
--TEST-- | ||
The right events are emitted in the right order for a PHPT test using a subprocess via --INI-- | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/phpt-ini-subprocess.phpt'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Configured | ||
Event Facade Sealed | ||
Test Suite Loaded (1 test) | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (%s%ephpt-ini-subprocess.phpt, 1 test) | ||
Test Preparation Started (%s%ephpt-ini-subprocess.phpt) | ||
Test Prepared (%s%ephpt-ini-subprocess.phpt) | ||
Child Process Started | ||
Child Process Finished | ||
Child Process Started | ||
Child Process Finished | ||
Test Passed (%s%ephpt-ini-subprocess.phpt) | ||
Test Finished (%s%ephpt-ini-subprocess.phpt) | ||
Test Suite Finished (%s%ephpt-ini-subprocess.phpt, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) |
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,32 @@ | ||
--TEST-- | ||
The right events are emitted in the right order for a skipped PHPT test using a skipif subprocess | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/phpt-skipif-exit-subprocess.phpt'; | ||
|
||
require __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Configured | ||
Event Facade Sealed | ||
Test Suite Loaded (1 test) | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (%s%ephpt-skipif-exit-subprocess.phpt, 1 test) | ||
Test Preparation Started (%s%ephpt-skipif-exit-subprocess.phpt) | ||
Test Prepared (%s%ephpt-skipif-exit-subprocess.phpt) | ||
Child Process Started | ||
Child Process Finished | ||
Test Skipped (%s%ephpt-skipif-exit-subprocess.phpt) | ||
is test | ||
Test Finished (%s%ephpt-skipif-exit-subprocess.phpt) | ||
Test Suite Finished (%s%ephpt-skipif-exit-subprocess.phpt, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) |
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