Skip to content
This repository was archived by the owner on Oct 19, 2020. It is now read-only.

Commit 6f8bb89

Browse files
committed
Use Assert DSL
1 parent 837c0c8 commit 6f8bb89

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use lang\Runnable;
55
use lang\ast\Errors;
66
use lang\ast\unittest\emit\EmittingTest;
7+
use unittest\Assert;
78

89
class SwitchExpressionTest extends EmittingTest {
910

@@ -32,35 +33,35 @@ public function run($arg) {
3233
# [null, 'void'],
3334
#])]
3435
public function exact_comparison($arg, $expected) {
35-
$this->assertEquals($expected, $this->typeFixture()->newInstance()->run($arg));
36+
Assert::equals($expected, $this->typeFixture()->newInstance()->run($arg));
3637
}
3738

3839
#[@test, @values([
3940
# [1, 'integer'],
4041
# ['Test', 'string'],
4142
#])]
4243
public function native_type_comparison($arg, $expected) {
43-
$this->assertEquals($expected, $this->typeFixture()->newInstance()->run($arg));
44+
Assert::equals($expected, $this->typeFixture()->newInstance()->run($arg));
4445
}
4546

4647
#[@test, @values([
4748
# [[1], 'integers'],
4849
# [['Test'], 'strings'],
4950
#])]
5051
public function array_type_comparison($arg, $expected) {
51-
$this->assertEquals($expected, $this->typeFixture()->newInstance()->run($arg));
52+
Assert::equals($expected, $this->typeFixture()->newInstance()->run($arg));
5253
}
5354

5455
#[@test]
5556
public function value_type_comparison() {
56-
$this->assertEquals('runnable-instance', $this->typeFixture()->newInstance()->run(newinstance(Runnable::class, [], [
57+
Assert::equals('runnable-instance', $this->typeFixture()->newInstance()->run(newinstance(Runnable::class, [], [
5758
'run' => function() { }
5859
])));
5960
}
6061

6162
#[@test]
6263
public function function_type_comparison() {
63-
$this->assertEquals('runnable-function', $this->typeFixture()->newInstance()->run(function(Runnable $a) { }));
64+
Assert::equals('runnable-function', $this->typeFixture()->newInstance()->run(function(Runnable $a) { }));
6465
}
6566

6667
#[@test, @expect(IllegalArgumentException::class)]
@@ -99,6 +100,6 @@ public function run() {
99100
};
100101
}
101102
}');
102-
$this->assertEquals(2, $r);
103+
Assert::equals(2, $r);
103104
}
104105
}

0 commit comments

Comments
 (0)