diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08d5c89..e1e1fce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [7.0, 7.1, 7.2, 7.3, 7.4] + php: [7.4] steps: - name: Checkout code diff --git a/composer.json b/composer.json index 35f6479..1af9473 100644 --- a/composer.json +++ b/composer.json @@ -13,15 +13,15 @@ } }, "require": { - "php": "^7.0", - "goaop/framework": "^2.2.0", - "phpunit/phpunit": "> 6.0.0", - "symfony/finder": ">=2.4 <6.0" + "php": "^7.4", + "goaop/framework": "^3.0", + "phpunit/phpunit": "^9.5", + "symfony/finder": ">=4.4 <6.0" }, "require-dev": { - "codeception/codeception": "^4.0", - "codeception/verify": "^1.2", - "codeception/specify": "^1.0" + "codeception/codeception": "^4.1", + "codeception/verify": "^2.1", + "codeception/specify": "^1.4" }, "license": "MIT" } diff --git a/src/AspectMock/Kernel.php b/src/AspectMock/Kernel.php index 0a017e6..7f831c0 100644 --- a/src/AspectMock/Kernel.php +++ b/src/AspectMock/Kernel.php @@ -15,7 +15,7 @@ class Kernel extends AspectKernel { - public function init(array $options = []) + public function init(array $options = []): void { if (!isset($options['excludePaths'])) { $options['excludePaths'] = []; diff --git a/tests/_data/php7.php b/tests/_data/php7.php index c016ef2..acf52fc 100644 --- a/tests/_data/php7.php +++ b/tests/_data/php7.php @@ -2,9 +2,6 @@ namespace Test\ns1; class TestPhp7Class { - - // - public function stringSth(string $arg) {} public function floatSth(float $arg) {} public function boolSth(bool $arg) {} diff --git a/tests/unit/ClassProxyTest.php b/tests/unit/ClassProxyTest.php index baddb53..9769e1a 100644 --- a/tests/unit/ClassProxyTest.php +++ b/tests/unit/ClassProxyTest.php @@ -17,8 +17,8 @@ public function testSimpleClassValidations() verify($class->hasMethod('setNothing'))->false(); verify($class->hasProperty('name'))->true(); verify($class->hasProperty('otherName'))->false(); - verify($class->traits())->isEmpty(); - verify($class->interfaces())->isEmpty(); + verify($class->traits())->empty(); + verify($class->interfaces())->empty(); verify($class->parent())->null(); } @@ -28,8 +28,8 @@ public function testMegaClassValidations() /** @var $class ClassProxy **/ verify($class->isDefined())->true(); verify($class->hasMethod('setName'))->false(); - verify($class->traits())->contains('Codeception\Specify'); - verify($class->interfaces())->contains('Iterator'); + verify($class->traits())->arrayContains('Codeception\Specify'); + verify($class->interfaces())->arrayContains('Iterator'); verify($class->parent())->equals('stdClass'); } diff --git a/tests/unit/FunctionInjectorTest.php b/tests/unit/FunctionInjectorTest.php index cf898ed..6ea6368 100644 --- a/tests/unit/FunctionInjectorTest.php +++ b/tests/unit/FunctionInjectorTest.php @@ -74,7 +74,7 @@ public function testReimplementFunc() public function testVerifier() { $func = test::func('demo', 'strlen', 10); - expect(strlen('hello'))->equals(10); + verify(strlen('hello'))->equals(10); $func->verifyInvoked(); $func->verifyInvoked(['hello']); $func->verifyInvokedOnce(); @@ -86,7 +86,7 @@ public function testVerifier() public function testVerifierFullyQualifiedNamespace() { $func = test::func('\demo', 'strlen', 10); - expect(strlen('hello'))->equals(10); + verify(strlen('hello'))->equals(10); $func->verifyInvoked(); $func->verifyInvoked(['hello']); $func->verifyInvokedOnce(); @@ -102,17 +102,17 @@ public function testFailedVerification() { $this->expectException(ExpectationFailedException::class); $func = test::func('demo', 'strlen', function() { return 10; }); - expect(strlen('hello'))->equals(10); + verify(strlen('hello'))->equals(10); $func->verifyNeverInvoked(); } public function testReferencedParameter() { $func = test::func('\demo', 'preg_match', 10); - expect(preg_match('@[0-9]+@', '1234', $match))->equals(10); + verify(preg_match('@[0-9]+@', '1234', $match))->equals(10); test::clean(); - expect(preg_match('@[0-9]+@', '1234#', $match))->equals(1); - expect($match[0])->equals('1234'); + verify(preg_match('@[0-9]+@', '1234#', $match))->equals(1); + verify($match[0])->equals('1234'); } } diff --git a/tests/unit/VerifierTest.php b/tests/unit/VerifierTest.php index f995395..d380e0e 100644 --- a/tests/unit/VerifierTest.php +++ b/tests/unit/VerifierTest.php @@ -34,7 +34,7 @@ public function testVerifyInvocationClosures() $empty = $params[1][0]; // second call, first arg verify($info)->equals($args); - verify($empty)->isEmpty(); + verify($empty)->empty(); }; $this->specify('closure was called', function() use ($user, $info, $matcher) { diff --git a/tests/unit/testDoubleTest.php b/tests/unit/testDoubleTest.php index 77a577b..6465b3d 100644 --- a/tests/unit/testDoubleTest.php +++ b/tests/unit/testDoubleTest.php @@ -67,7 +67,7 @@ public function testSpecUndefinedClass() $this->assertFalse($class->isDefined()); $this->assertFalse($class->hasMethod('__toString')); $this->assertFalse($class->hasMethod('edit')); - verify($class->interfaces())->isEmpty(); + verify($class->interfaces())->empty(); $this->any = $class->make(); $this->any = $class->construct();