Skip to content

Commit

Permalink
Merge pull request #193 from Codeception/goaop-framework-v3
Browse files Browse the repository at this point in the history
Support  goaop/framework v3
  • Loading branch information
Naktibalda committed Apr 16, 2021
2 parents eef5e5e + ad4d80a commit b8658c6
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion src/AspectMock/Kernel.php
Expand Up @@ -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'] = [];
Expand Down
3 changes: 0 additions & 3 deletions tests/_data/php7.php
Expand Up @@ -2,9 +2,6 @@
namespace Test\ns1;
class TestPhp7Class
{

//

public function stringSth(string $arg) {}
public function floatSth(float $arg) {}
public function boolSth(bool $arg) {}
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/ClassProxyTest.php
Expand Up @@ -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();
}

Expand All @@ -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');
}

Expand Down
12 changes: 6 additions & 6 deletions tests/unit/FunctionInjectorTest.php
Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -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');
}

}
2 changes: 1 addition & 1 deletion tests/unit/VerifierTest.php
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/testDoubleTest.php
Expand Up @@ -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();

Expand Down

0 comments on commit b8658c6

Please sign in to comment.