[ProxyManager] fix tests
This commit is contained in:
parent
604c68999e
commit
c5904be45d
@ -41,6 +41,8 @@ class LazyLoadingValueHolderGenerator extends BaseGenerator
|
||||
$method->getBody()
|
||||
);
|
||||
$body = str_replace('(new \ReflectionClass(get_class()))', '$reflection', $body);
|
||||
$body = str_replace('$reflection = $reflection ?: ', '$reflection = $reflection ?? ', $body);
|
||||
$body = str_replace('$reflection ?? $reflection = ', '$reflection ?? ', $body);
|
||||
|
||||
if ($originalClass->isInterface()) {
|
||||
$body = str_replace('get_parent_class($this)', var_export($originalClass->name, true), $body);
|
||||
|
@ -48,7 +48,7 @@ class SunnyInterface_1eff735 implements \ProxyManager\Proxy\VirtualProxyInterfac
|
||||
{
|
||||
static $reflection;
|
||||
|
||||
$reflection = $reflection ?? $reflection = new \ReflectionClass(__CLASS__);
|
||||
$reflection = $reflection ?? new \ReflectionClass(__CLASS__);
|
||||
$instance = $reflection->newInstanceWithoutConstructor();
|
||||
|
||||
$instance->initializer1eff735 = $initializer;
|
||||
|
@ -156,7 +156,6 @@ EOPHP;
|
||||
$implem = preg_replace('#\n /\*\*.*?\*/#s', '', $implem);
|
||||
$implem = str_replace('getWrappedValueHolderValue() : ?object', 'getWrappedValueHolderValue()', $implem);
|
||||
$implem = str_replace("array(\n \n );", "[\n \n ];", $implem);
|
||||
$implem = str_replace('$reflection ?: $reflection', '$reflection ?? $reflection', $implem);
|
||||
$this->assertStringEqualsFile(__DIR__.'/Fixtures/proxy-implem.php', $implem);
|
||||
$this->assertStringEqualsFile(__DIR__.'/Fixtures/proxy-factory.php', $factory);
|
||||
|
||||
|
Reference in New Issue
Block a user