[ProxyManager] fix tests

This commit is contained in:
Nicolas Grekas 2018-09-02 06:58:46 +02:00
parent 604c68999e
commit c5904be45d
3 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);