Skip to content

Commit

Permalink
fix aop tests error
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Sep 13, 2020
1 parent 039b5ee commit dfb31ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/aop/test/unit/AopTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ public function testProxyCode(): void
$visitor = new ProxyVisitor('proxy_id');
$className = AopClass::class;


$visitorClassName = get_class($visitor);
$parser->addNodeVisitor($visitorClassName, $visitor);

$proxyCode = $parser->parse($className);

// Proxy file and proxy code
$proxyCode = sprintf('<?php %s %s', PHP_EOL, $proxyCode);

$proxyCode = sprintf("<?php%s %s\n", PHP_EOL, $proxyCode);
// \vdump($proxyCode);
$tpFile = __DIR__ . '/template/aop.tp';

$codeMd5 = md5($proxyCode);
Expand Down
16 changes: 12 additions & 4 deletions src/aop/test/unit/template/aop.tp
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?php
<?php
declare (strict_types=1);
/**
* This file is part of Swoft.
*
* @link https://swoft.org
* @document https://swoft.org/docs
* @contact [email protected]
* @license https://github.com/swoft-cloud/swoft/blob/master/LICENSE
*/
namespace SwoftTest\Aop\Testing;

class AopClass_PROXY_proxy_id extends \SwoftTest\Aop\Testing\AopClass
Expand All @@ -21,8 +29,8 @@ class AopClass_PROXY_proxy_id extends \SwoftTest\Aop\Testing\AopClass
{
$this->__proxyCall('SwoftTest\\Aop\\Testing\\AopClass', 'MethodVoid', func_get_args());
}
public function MethodNull($int, $str, $float, $aopClass)
public function MethodNull($int, $str, $float, $aopClass) : void
{
return $this->__proxyCall('SwoftTest\\Aop\\Testing\\AopClass', 'MethodNull', func_get_args());
$this->__proxyCall('SwoftTest\\Aop\\Testing\\AopClass', 'MethodNull', func_get_args());
}
}
}

0 comments on commit dfb31ac

Please sign in to comment.