From f1e1bb85085222ec23de4189c3df9981e8e5c172 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 10 Mar 2024 11:25:21 +0100 Subject: [PATCH] Migrate to new testing library See xp-framework/rfc#344 --- .github/workflows/ci.yml | 2 +- ChangeLog.md | 1 + composer.json | 2 +- src/test/php/util/cmd/unittest/AbstractRunnerTest.class.php | 3 +-- src/test/php/util/cmd/unittest/CmdRunnerTest.class.php | 4 ++-- src/test/php/util/cmd/unittest/CommandsTest.class.php | 6 +++--- src/test/php/util/cmd/unittest/ConfigTest.class.php | 4 ++-- src/test/php/util/cmd/unittest/ParamStringTest.class.php | 4 ++-- src/test/php/util/cmd/unittest/RunnerTest.class.php | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 751e7b7..48a5639 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,4 +53,4 @@ jobs: echo "vendor/autoload.php" > composer.pth - name: Run test suite - run: sh xp-run xp.unittest.TestRunner src/test/php + run: sh xp-run xp.test.Runner -r Dots src/test/php diff --git a/ChangeLog.md b/ChangeLog.md index c564369..f5adeff 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,7 @@ Commands ChangeLog ## ?.?.? / ????-??-?? +* Implemented xp-framework/rfc#344: New testing library - @thekid * Added PHP 8.2, 8.3 and 8.4 to the test matrix - @thekid ## 11.0.0 / 2021-10-21 diff --git a/composer.json b/composer.json index 8a37708..e337238 100755 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "php" : ">=7.0.0" }, "require-dev" : { - "xp-framework/unittest": "^11.0 | ^10.0" + "xp-framework/test": "^1.0" }, "bin": ["bin/xp.xp-framework.command.cmd"], "autoload" : { diff --git a/src/test/php/util/cmd/unittest/AbstractRunnerTest.class.php b/src/test/php/util/cmd/unittest/AbstractRunnerTest.class.php index 96c9c65..90dc89a 100755 --- a/src/test/php/util/cmd/unittest/AbstractRunnerTest.class.php +++ b/src/test/php/util/cmd/unittest/AbstractRunnerTest.class.php @@ -1,8 +1,7 @@ IllegalArgumentException::class, 'withMessage' => '/CommandsTest is not runnable/'])] + #[Test, Expect(class: IllegalArgumentException::class, message: '/CommandsTest is not runnable/')] public function name_non_runnable() { Commands::named(nameof($this)); } - #[Test, Expect(['class' => IllegalArgumentException::class, 'withMessage' => '/CommandsTest is not runnable/'])] + #[Test, Expect(class: IllegalArgumentException::class, message: '/CommandsTest is not runnable/')] public function file_not_runnable() { Commands::named(__FILE__); } diff --git a/src/test/php/util/cmd/unittest/ConfigTest.class.php b/src/test/php/util/cmd/unittest/ConfigTest.class.php index d1e3d21..9adf82c 100755 --- a/src/test/php/util/cmd/unittest/ConfigTest.class.php +++ b/src/test/php/util/cmd/unittest/ConfigTest.class.php @@ -1,8 +1,8 @@