generated from ergebnis/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Add support for phpunit/phpunit:^8.5.36
- Loading branch information
1 parent
fa9cc29
commit 68ad1fc
Showing
19 changed files
with
631 additions
and
41 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
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
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
66 changes: 66 additions & 0 deletions
66
test/EndToEnd/Version8/DefaultConfiguration/SleeperTest.php
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,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2021-2023 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/ergebnis/phpunit-slow-test-detector | ||
*/ | ||
|
||
namespace Ergebnis\PHPUnit\SlowTestDetector\Test\EndToEnd\Version8\DefaultConfiguration; | ||
|
||
use Ergebnis\PHPUnit\SlowTestDetector\Test; | ||
use PHPUnit\Framework; | ||
|
||
/** | ||
* @covers \Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Sleeper | ||
*/ | ||
final class SleeperTest extends Framework\TestCase | ||
{ | ||
use Test\Util\Helper; | ||
|
||
public function testSleeperDoesNotSleepAtAll(): void | ||
{ | ||
$milliseconds = 0; | ||
|
||
$sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); | ||
|
||
$sleeper->sleep(); | ||
|
||
self::assertSame($milliseconds, $sleeper->milliseconds()); | ||
} | ||
|
||
/** | ||
* @dataProvider provideMillisecondsGreaterThanDefaultMaximumDuration | ||
*/ | ||
public function testSleeperSleepsLongerThanDefaultMaximumDurationWithDataProvider(int $milliseconds): void | ||
{ | ||
$sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); | ||
|
||
$sleeper->sleep(); | ||
|
||
self::assertSame($milliseconds, $sleeper->milliseconds()); | ||
} | ||
|
||
/** | ||
* @return \Generator<int, array{0: int}> | ||
*/ | ||
public static function provideMillisecondsGreaterThanDefaultMaximumDuration(): iterable | ||
{ | ||
$values = \range( | ||
550, | ||
1050, | ||
50, | ||
); | ||
|
||
foreach ($values as $value) { | ||
yield $value => [ | ||
$value, | ||
]; | ||
} | ||
} | ||
} |
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,28 @@ | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd" | ||
beStrictAboutChangesToGlobalState="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
bootstrap="../../../../vendor/autoload.php" | ||
cacheResult="false" | ||
colors="true" | ||
columns="max" | ||
forceCoversAnnotation="true" | ||
executionOrder="random" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
verbose="true" | ||
> | ||
<extensions> | ||
<extension class="Ergebnis\PHPUnit\SlowTestDetector\Extension"/> | ||
</extensions> | ||
<testsuites> | ||
<testsuite name="Unit Tests"> | ||
<directory>.</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
Oops, something went wrong.