Skip to content

Commit a2f3f93

Browse files
committed
Use codeception/verify 2.1 in tests
1 parent eef5e5e commit a2f3f93

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"require-dev": {
2222
"codeception/codeception": "^4.0",
23-
"codeception/verify": "^1.2",
23+
"codeception/verify": "^2.1",
2424
"codeception/specify": "^1.0"
2525
},
2626
"license": "MIT"

tests/unit/ClassProxyTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public function testSimpleClassValidations()
1717
verify($class->hasMethod('setNothing'))->false();
1818
verify($class->hasProperty('name'))->true();
1919
verify($class->hasProperty('otherName'))->false();
20-
verify($class->traits())->isEmpty();
21-
verify($class->interfaces())->isEmpty();
20+
verify($class->traits())->empty();
21+
verify($class->interfaces())->empty();
2222
verify($class->parent())->null();
2323
}
2424

@@ -28,8 +28,8 @@ public function testMegaClassValidations()
2828
/** @var $class ClassProxy **/
2929
verify($class->isDefined())->true();
3030
verify($class->hasMethod('setName'))->false();
31-
verify($class->traits())->contains('Codeception\Specify');
32-
verify($class->interfaces())->contains('Iterator');
31+
verify($class->traits())->arrayContains('Codeception\Specify');
32+
verify($class->interfaces())->arrayContains('Iterator');
3333
verify($class->parent())->equals('stdClass');
3434
}
3535

tests/unit/FunctionInjectorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function testReimplementFunc()
7474
public function testVerifier()
7575
{
7676
$func = test::func('demo', 'strlen', 10);
77-
expect(strlen('hello'))->equals(10);
77+
verify(strlen('hello'))->equals(10);
7878
$func->verifyInvoked();
7979
$func->verifyInvoked(['hello']);
8080
$func->verifyInvokedOnce();
@@ -86,7 +86,7 @@ public function testVerifier()
8686
public function testVerifierFullyQualifiedNamespace()
8787
{
8888
$func = test::func('\demo', 'strlen', 10);
89-
expect(strlen('hello'))->equals(10);
89+
verify(strlen('hello'))->equals(10);
9090
$func->verifyInvoked();
9191
$func->verifyInvoked(['hello']);
9292
$func->verifyInvokedOnce();
@@ -102,17 +102,17 @@ public function testFailedVerification()
102102
{
103103
$this->expectException(ExpectationFailedException::class);
104104
$func = test::func('demo', 'strlen', function() { return 10; });
105-
expect(strlen('hello'))->equals(10);
105+
verify(strlen('hello'))->equals(10);
106106
$func->verifyNeverInvoked();
107107
}
108108

109109
public function testReferencedParameter()
110110
{
111111
$func = test::func('\demo', 'preg_match', 10);
112-
expect(preg_match('@[0-9]+@', '1234', $match))->equals(10);
112+
verify(preg_match('@[0-9]+@', '1234', $match))->equals(10);
113113
test::clean();
114-
expect(preg_match('@[0-9]+@', '1234#', $match))->equals(1);
115-
expect($match[0])->equals('1234');
114+
verify(preg_match('@[0-9]+@', '1234#', $match))->equals(1);
115+
verify($match[0])->equals('1234');
116116
}
117117

118118
}

tests/unit/VerifierTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testVerifyInvocationClosures()
3434
$empty = $params[1][0]; // second call, first arg
3535

3636
verify($info)->equals($args);
37-
verify($empty)->isEmpty();
37+
verify($empty)->empty();
3838
};
3939

4040
$this->specify('closure was called', function() use ($user, $info, $matcher) {

tests/unit/testDoubleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testSpecUndefinedClass()
6767
$this->assertFalse($class->isDefined());
6868
$this->assertFalse($class->hasMethod('__toString'));
6969
$this->assertFalse($class->hasMethod('edit'));
70-
verify($class->interfaces())->isEmpty();
70+
verify($class->interfaces())->empty();
7171
$this->any = $class->make();
7272
$this->any = $class->construct();
7373

0 commit comments

Comments
 (0)