Skip to content

Commit

Permalink
Merge pull request #9 from xp-forge/refactor/migrate-testing
Browse files Browse the repository at this point in the history
Migrate to new testing library
  • Loading branch information
thekid committed Mar 7, 2023
2 parents e619b64 + 4f5c675 commit d060b01
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
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

0 comments on commit d060b01

Please sign in to comment.