From 4f5c675c3a505413b416e22de2f0513f9eaec000 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Tue, 7 Mar 2023 20:53:35 +0100 Subject: [PATCH] Migrate to new testing library --- .github/workflows/ci.yml | 2 +- composer.json | 2 +- .../amazon/aws/lambda/unittest/FromApiGatewayTest.class.php | 6 +++--- .../com/amazon/aws/lambda/unittest/HttpApiTest.class.php | 6 +++--- .../aws/lambda/unittest/InvocationEventsTest.class.php | 2 +- .../amazon/aws/lambda/unittest/RequestContextTest.class.php | 2 +- .../aws/lambda/unittest/ResponseDocumentTest.class.php | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) mode change 100644 => 100755 src/test/php/com/amazon/aws/lambda/unittest/InvocationEventsTest.class.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 467278b..a0d4db5 100755 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,4 +56,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 src/test/php diff --git a/composer.json b/composer.json index 1a3a0b5..872e4e8 100755 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "php": ">=7.0.0" }, "require-dev" : { - "xp-framework/unittest": "^11.0 | ^10.0 | ^9.0 | ^8.0 |^7.0" + "xp-framework/test": "^1.0" }, "autoload" : { "files" : ["src/main/php/autoload.php"] diff --git a/src/test/php/com/amazon/aws/lambda/unittest/FromApiGatewayTest.class.php b/src/test/php/com/amazon/aws/lambda/unittest/FromApiGatewayTest.class.php index 674a871..31c4259 100755 --- a/src/test/php/com/amazon/aws/lambda/unittest/FromApiGatewayTest.class.php +++ b/src/test/php/com/amazon/aws/lambda/unittest/FromApiGatewayTest.class.php @@ -3,7 +3,7 @@ use com\amazon\aws\lambda\FromApiGateway; use io\streams\Streams; use lang\IllegalArgumentException; -use unittest\{Assert, Test, Values}; +use test\{Assert, Expect, Test, Values}; use util\Bytes; use web\io\Part; @@ -48,12 +48,12 @@ public function can_create() { $this->fixture(); } - #[Test, Expect(class: IllegalArgumentException::class, withMessage: '/Cannot handle API gateway without version/')] + #[Test, Expect(class: IllegalArgumentException::class, message: '/Cannot handle API gateway without version/')] public function cannot_create_without_version() { new FromApiGateway([]); } - #[Test, Expect(class: IllegalArgumentException::class, withMessage: '/Cannot handle API gateway version 1.0/')] + #[Test, Expect(class: IllegalArgumentException::class, message: '/Cannot handle API gateway version 1.0/')] public function cannot_create_with_version1() { new FromApiGateway(['version' => '1.0']); } diff --git a/src/test/php/com/amazon/aws/lambda/unittest/HttpApiTest.class.php b/src/test/php/com/amazon/aws/lambda/unittest/HttpApiTest.class.php index f752d09..5052644 100755 --- a/src/test/php/com/amazon/aws/lambda/unittest/HttpApiTest.class.php +++ b/src/test/php/com/amazon/aws/lambda/unittest/HttpApiTest.class.php @@ -1,9 +1,9 @@