Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to new testing library #9

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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']);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php namespace com\amazon\aws\lambda\unittest;

use com\amazon\aws\lambda\{HttpApi, Environment, Context};
use io\streams\{StringWriter, MemoryOutputStream};
use com\amazon\aws\lambda\{Context, Environment, HttpApi};
use io\streams\{MemoryOutputStream, StringWriter};
use lang\MethodNotImplementedException;
use unittest\{Assert, Before, Test, Values};
use test\{Assert, Before, Test, Values};
use web\{Application, Cookie, Error};

class HttpApiTest {
Expand Down
2 changes: 1 addition & 1 deletion src/test/php/com/amazon/aws/lambda/unittest/InvocationEventsTest.class.php
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace com\amazon\aws\lambda\unittest;

use com\amazon\aws\lambda\FromApiGateway;
use unittest\{Assert, Test, Values};
use test\{Assert, Test, Values};
use util\Bytes;
use web\Request;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace com\amazon\aws\lambda\unittest;

use com\amazon\aws\lambda\RequestContext;
use unittest\{Assert, Test};
use test\{Assert, Test};

class RequestContextTest {
const CONTEXT = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace com\amazon\aws\lambda\unittest;

use com\amazon\aws\lambda\ResponseDocument;
use unittest\{Assert, Test, Values};
use test\{Assert, Test, Values};
use web\Error;

class ResponseDocumentTest {
Expand Down