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 using Phar with phpunit/phpunit:^9.0.0
- Loading branch information
1 parent
03b8466
commit 7a6038e
Showing
9 changed files
with
124 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="humbug/box" version="^4.4.0" installed="4.4.0" location="./.phive/box" copy="false"/> | ||
<phar name="composer-require-checker" version="~3.8.0" installed="3.8.0" location="./.phive/composer-require-checker" copy="false"/> | ||
<phar name="humbug/box" version="~3.16.0" installed="3.16.0" location="./.phive/box" copy="false"/> | ||
<phar name="composer-require-checker" version="~3.8.0" installed="3.8.0" location="./.phive/composer-require-checker" copy="false"/> | ||
</phive> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2021-2024 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\Phar\Version09; | ||
|
||
use Ergebnis\PHPUnit\SlowTestDetector\Test; | ||
use PHPUnit\Framework; | ||
|
||
/** | ||
* @covers \Ergebnis\PHPUnit\SlowTestDetector\Test\Fixture\Sleeper | ||
*/ | ||
final class SleeperTest extends Framework\TestCase | ||
{ | ||
public function testSleeperDoesNotSleepAtAll(): void | ||
{ | ||
$milliseconds = 0; | ||
|
||
$sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); | ||
|
||
$sleeper->sleep(); | ||
|
||
self::assertSame($milliseconds, $sleeper->milliseconds()); | ||
} | ||
|
||
public function testSleeperSleepsJustAboveDefaultMaximumDuration(): void | ||
{ | ||
$milliseconds = 600; | ||
|
||
$sleeper = Test\Fixture\Sleeper::fromMilliseconds($milliseconds); | ||
|
||
$sleeper->sleep(); | ||
|
||
self::assertSame($milliseconds, $sleeper->milliseconds()); | ||
} | ||
} |
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 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2021-2024 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 | ||
*/ | ||
|
||
require_once __DIR__ . '/../../Fixture/Sleeper.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,28 @@ | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.0/phpunit.xsd" | ||
beStrictAboutChangesToGlobalState="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
bootstrap="bootstrap.php" | ||
cacheResult="false" | ||
colors="true" | ||
columns="max" | ||
executionOrder="random" | ||
extensionsDirectory="../../../.build/phar/" | ||
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> |