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.
Merge pull request #485 from ergebnis/feature/phpunit-11
Enhancement: Add support for `phpunit/phpunit:^11.0.0`
- Loading branch information
Showing
10 changed files
with
127 additions
and
20 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 |
---|---|---|
|
@@ -504,11 +504,19 @@ jobs: | |
php-version: "8.3" | ||
dependencies: "highest" | ||
|
||
- phpunit-version: "11.0.x-dev" | ||
- phpunit-version: "11.0.0" | ||
php-version: "8.2" | ||
dependencies: "lowest" | ||
|
||
- phpunit-version: "11.0.0" | ||
php-version: "8.2" | ||
dependencies: "highest" | ||
|
||
- phpunit-version: "11.0.x-dev" | ||
- phpunit-version: "11.0.0" | ||
php-version: "8.3" | ||
dependencies: "lowest" | ||
|
||
- phpunit-version: "11.0.0" | ||
php-version: "8.3" | ||
dependencies: "highest" | ||
|
||
|
@@ -554,13 +562,9 @@ jobs: | |
run: "composer remove ergebnis/php-cs-fixer-config psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress" | ||
|
||
- name: "Require phpunit/phpunit:^${{ matrix.phpunit-version }}" | ||
if: "matrix.dependencies != 'locked' && matrix.phpunit-version != '11.0.x-dev'" | ||
if: "matrix.dependencies != 'locked'" | ||
run: "composer require phpunit/phpunit:^${{ matrix.phpunit-version }} --ansi --no-interaction --no-progress --update-with-all-dependencies" | ||
|
||
- name: "Require phpunit/phpunit:${{ matrix.phpunit-version }}" | ||
if: "matrix.dependencies != 'locked' && matrix.phpunit-version == '11.0.x-dev'" | ||
run: "composer require phpunit/phpunit:${{ matrix.phpunit-version }} --ansi --no-interaction --no-progress --update-with-all-dependencies" | ||
|
||
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
with: | ||
|
@@ -593,8 +597,8 @@ jobs: | |
if: "matrix.phpunit-version == '10.0.0'" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version10/phpunit.xml" | ||
|
||
- name: "Run end-to-end tests with phpunit/phpunit:11.0.x-dev" | ||
if: "matrix.phpunit-version == '11.0.x-dev'" | ||
- name: "Run end-to-end tests with phpunit/phpunit:11.0.0" | ||
if: "matrix.phpunit-version == '11.0.0'" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/EndToEnd/Version11/phpunit.xml" | ||
|
||
- name: "Download Phar" | ||
|
@@ -621,3 +625,7 @@ jobs: | |
- name: "Run phar tests with phpunit/phpunit:10.0.0" | ||
if: "matrix.phpunit-version == '10.0.0'" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/Phar/Version10/phpunit.xml" | ||
|
||
- name: "Run phar tests with phpunit/phpunit:11.0.0" | ||
if: "matrix.phpunit-version == '11.0.0'" | ||
run: "vendor/bin/phpunit --colors=always --configuration=test/Phar/Version11/phpunit.xml" |
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
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,43 @@ | ||
<?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\Version11; | ||
|
||
use Ergebnis\PHPUnit\SlowTestDetector\Test; | ||
use PHPUnit\Framework; | ||
|
||
#[Framework\Attributes\CoversClass(Test\Fixture\Sleeper::class)] | ||
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,33 @@ | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" | ||
beStrictAboutChangesToGlobalState="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutTodoAnnotatedTests="true" | ||
bootstrap="bootstrap.php" | ||
cacheResult="false" | ||
colors="true" | ||
columns="max" | ||
displayDetailsOnIncompleteTests="true" | ||
displayDetailsOnSkippedTests="true" | ||
displayDetailsOnTestsThatTriggerDeprecations="true" | ||
displayDetailsOnTestsThatTriggerErrors="true" | ||
displayDetailsOnTestsThatTriggerNotices="true" | ||
displayDetailsOnTestsThatTriggerWarnings="true" | ||
executionOrder="random" | ||
extensionsDirectory="../../../.build/phar/" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
> | ||
<extensions> | ||
<bootstrap class="Ergebnis\PHPUnit\SlowTestDetector\Extension"/> | ||
</extensions> | ||
<testsuites> | ||
<testsuite name="Unit Tests"> | ||
<directory>.</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |