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:^11.0.0
- Loading branch information
1 parent
eb449d3
commit 1beb735
Showing
11 changed files
with
156 additions
and
25 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 |
---|---|---|
|
@@ -221,7 +221,7 @@ jobs: | |
run: ".phive/box info ${{ env.PHPUNIT_SLOW_TEST_DETECTOR_PHAR }} --ansi --list" | ||
|
||
- name: "Run phar tests with phpunit/phpunit" | ||
run: ".phive/phpunit --colors=always --configuration=test/Phar/phpunit.xml" | ||
run: ".phive/phpunit --colors=always --configuration=test/Phar/Version10/phpunit.xml" | ||
|
||
dependency-analysis: | ||
name: "Dependency Analysis" | ||
|
@@ -496,11 +496,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" | ||
|
||
|
@@ -543,13 +551,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: | ||
|
@@ -582,6 +586,6 @@ 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" |
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
File renamed without changes.
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\Version10; | ||
|
||
use Ergebnis\PHPUnit\SlowTestDetector\Test; | ||
use PHPUnit\Framework; | ||
|
||
#[Framework\Attributes\CoversClass(Test\Fixture\Sleeper::class)] | ||
final class SleeperTest extends Framework\TestCase | ||
Check failure on line 20 in test/Phar/Version11/SleeperTest.php GitHub Actions / Static Code Analysis (7.4, locked)UnusedClass
|
||
{ | ||
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,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> |