-
-
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.
Improved test coverage when php-invoker is not available
- Loading branch information
1 parent
9a987cb
commit 586fe31
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
tests/Regression/GitHub/2085/issue-2085-test-missing-invoker.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,32 @@ | ||
--TEST-- | ||
Test CLI flags --enforce-time-limit --default-time-limit when missing php-invoker, has pcntl | ||
--DESCRIPTION-- | ||
https://github.com/sebastianbergmann/phpunit/issues/2085 | ||
--SKIPIF-- | ||
<?php | ||
if (\class_exists(Invoker::class)) { | ||
print "Skip: package phpunit/php-invoker is installed" . PHP_EOL; | ||
} | ||
|
||
if (!\extension_loaded('pcntl') || \strpos(\ini_get('disable_functions'), 'pcntl') !== false) { | ||
print "Skip: extension pcntl is required for enforcing time limits" . PHP_EOL; | ||
} | ||
--FILE-- | ||
<?php | ||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][2] = '--enforce-time-limit'; | ||
$_SERVER['argv'][3] = '--default-time-limit=10'; | ||
$_SERVER['argv'][4] = __DIR__ . '/Issue2085Test.php'; | ||
|
||
require __DIR__ . '/../../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
|
||
Error: Package phpunit/php-invoker is required for enforcing time limits | ||
. 1 / 1 (100%) | ||
|
||
Time: %s, Memory: %s | ||
|
||
OK (1 test, 2 assertions) |
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