-
-
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.
- Loading branch information
1 parent
8f2b043
commit 8075b00
Showing
4 changed files
with
62 additions
and
2 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
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,20 @@ | ||
<?php | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class Issue2085Test extends TestCase | ||
{ | ||
public function testShouldAbortSlowTestByEnforcingTimeLimit(): void | ||
{ | ||
$this->assertTrue(true); | ||
\sleep(2); | ||
$this->assertTrue(true); | ||
} | ||
} |
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,30 @@ | ||
--TEST-- | ||
https://github.com/sebastianbergmann/phpunit/issues/2085 | ||
--SKIPIF-- | ||
<?php | ||
if (false || !\class_exists(Invoker::class)) { | ||
print "Package phpunit/php-invoker is required for enforcing time limits"); | ||
} | ||
--FILE-- | ||
<?php | ||
$_SERVER['argv'][1] = '--no-configuration'; | ||
$_SERVER['argv'][2] = '--enforce-time-limit'; | ||
$_SERVER['argv'][3] = '--default-time-limit=1'; | ||
$_SERVER['argv'][4] = __DIR__ . '/Issue2085Test.php'; | ||
|
||
require __DIR__ . '/../../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
R 1 / 1 (100%) | ||
|
||
Time: %s, Memory: %s | ||
|
||
There was 1 risky test: | ||
|
||
1) Issue2085Test::testShouldAbortSlowTestByEnforcingTimeLimit | ||
Execution aborted after 1 second | ||
|
||
OK, but incomplete, skipped, or risky tests! | ||
Tests: 1, Assertions: 1, Risky: 1. |