Skip to content

Commit dd0b43d

Browse files
committed
Migrate to new test framework
1 parent 8d6b5cc commit dd0b43d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"php" : ">=7.0.0"
1313
},
1414
"require-dev" : {
15-
"xp-framework/unittest": "^11.0"
15+
"xp-framework/test": "^1.0"
1616
},
1717
"autoload" : {
1818
"files" : ["src/main/php/autoload.php"]

src/test/php/lang/ast/syntax/php/unittest/GenericsTest.class.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php namespace lang\ast\syntax\php\unittest;
22

33
use lang\ast\unittest\emit\EmittingTest;
4-
use lang\{Primitive, Nullable, ArrayType, MapType, TypeUnion, FunctionType, IllegalArgumentException};
5-
use unittest\{Assert, Test, Values};
4+
use lang\{ArrayType, FunctionType, IllegalArgumentException, MapType, Nullable, Primitive, TypeUnion};
5+
use test\{Assert, Expect, Test, Values};
66

77
class GenericsTest extends EmittingTest {
88

@@ -207,7 +207,7 @@ public function run() {
207207
Assert::equals(['A', 'B'], $r->remaining());
208208
}
209209

210-
#[Test, Expect(class: IllegalArgumentException::class, withMessage: '/Argument 1 .+ must be of string, int given/')]
210+
#[Test, Expect(class: IllegalArgumentException::class, message: '/Argument 1 .+ must be of string, int given/')]
211211
public function incorrect_parameter_type() {
212212
$this->run('class <T><E> {
213213
public function push(E $element) { /* Never run */ }
@@ -218,7 +218,7 @@ public function run() {
218218
}');
219219
}
220220

221-
#[Test, Expect(class: IllegalArgumentException::class, withMessage: '/Vararg 1 .+ must be of string.*, var.* given/')]
221+
#[Test, Expect(class: IllegalArgumentException::class, message: '/Vararg 1 .+ must be of string.*, var.* given/')]
222222
public function incorrect_variadic_parameter_type() {
223223
$this->run('class <T><E> {
224224
public function push(E... $elements) { /* Never run */ }
@@ -229,7 +229,7 @@ public function run() {
229229
}');
230230
}
231231

232-
#[Test, Expect(class: IllegalArgumentException::class, withMessage: '/Argument 1 .+ must be of .+, .+ given/')]
232+
#[Test, Expect(class: IllegalArgumentException::class, message: '/Argument 1 .+ must be of .+, .+ given/')]
233233
public function incorrect_function_type() {
234234
$this->run('class <T><E> {
235235
public function comparing(function(E, E): int $comparator) { /* Never run */ }

0 commit comments

Comments
 (0)