Skip to content

Commit b8658c6

Browse files
authored
Merge pull request #193 from Codeception/goaop-framework-v3
Support goaop/framework v3
2 parents eef5e5e + ad4d80a commit b8658c6

File tree

8 files changed

+21
-24
lines changed

8 files changed

+21
-24
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php: [7.0, 7.1, 7.2, 7.3, 7.4]
11+
php: [7.4]
1212

1313
steps:
1414
- name: Checkout code

composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
}
1414
},
1515
"require": {
16-
"php": "^7.0",
17-
"goaop/framework": "^2.2.0",
18-
"phpunit/phpunit": "> 6.0.0",
19-
"symfony/finder": ">=2.4 <6.0"
16+
"php": "^7.4",
17+
"goaop/framework": "^3.0",
18+
"phpunit/phpunit": "^9.5",
19+
"symfony/finder": ">=4.4 <6.0"
2020
},
2121
"require-dev": {
22-
"codeception/codeception": "^4.0",
23-
"codeception/verify": "^1.2",
24-
"codeception/specify": "^1.0"
22+
"codeception/codeception": "^4.1",
23+
"codeception/verify": "^2.1",
24+
"codeception/specify": "^1.4"
2525
},
2626
"license": "MIT"
2727
}

src/AspectMock/Kernel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class Kernel extends AspectKernel
1717
{
18-
public function init(array $options = [])
18+
public function init(array $options = []): void
1919
{
2020
if (!isset($options['excludePaths'])) {
2121
$options['excludePaths'] = [];

tests/_data/php7.php

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
namespace Test\ns1;
33
class TestPhp7Class
44
{
5-
6-
//
7-
85
public function stringSth(string $arg) {}
96
public function floatSth(float $arg) {}
107
public function boolSth(bool $arg) {}

tests/unit/ClassProxyTest.php

+4-4
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

+6-6
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

+1-1
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

+1-1
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)