Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4fe8889

Browse files
Merge branch '2.7' into 2.8
* 2.7: [DI] Remove unused props from the PhpDumper [ProxyManager] Cleanup fixtures [Debug] HTML-escape array key Add some phpdocs for IDE autocompletion and better SCA
2 parents ee345ee + 27a6c1f commit 4fe8889

File tree

9 files changed

+40
-404
lines changed

9 files changed

+40
-404
lines changed

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,9 @@ class PhpDumperTest extends TestCase
2626
{
2727
public function testDumpContainerWithProxyService()
2828
{
29-
$container = new ContainerBuilder();
30-
31-
$container->register('foo', 'stdClass');
32-
$container->getDefinition('foo')->setLazy(true);
33-
$container->compile();
34-
35-
$dumper = new PhpDumper($container);
36-
37-
$dumper->setProxyDumper(new ProxyDumper());
38-
39-
$dumpedString = $dumper->dump();
40-
4129
$this->assertStringMatchesFormatFile(
4230
__DIR__.'/../Fixtures/php/lazy_service_structure.txt',
43-
$dumpedString,
31+
$this->dumpLazyServiceProjectServiceContainer(),
4432
'->dump() does generate proxy lazy loading logic.'
4533
);
4634
}
@@ -50,18 +38,15 @@ public function testDumpContainerWithProxyService()
5038
*/
5139
public function testDumpContainerWithProxyServiceWillShareProxies()
5240
{
53-
// detecting ProxyManager v2
54-
if (class_exists('ProxyManager\ProxyGenerator\LazyLoading\MethodGenerator\StaticProxyConstructor')) {
55-
require_once __DIR__.'/../Fixtures/php/lazy_service_with_hints.php';
56-
} else {
57-
require_once __DIR__.'/../Fixtures/php/lazy_service.php';
41+
if (!class_exists('LazyServiceProjectServiceContainer', false)) {
42+
eval('?>'.$this->dumpLazyServiceProjectServiceContainer());
5843
}
5944

6045
$container = new \LazyServiceProjectServiceContainer();
6146

62-
/* @var $proxy \stdClass_c1d194250ee2e2b7d2eab8b8212368a8 */
6347
$proxy = $container->get('foo');
64-
$this->assertInstanceOf('stdClass_c1d194250ee2e2b7d2eab8b8212368a8', $proxy);
48+
$this->assertInstanceOf('stdClass', $proxy);
49+
$this->assertInstanceOf('ProxyManager\Proxy\LazyLoadingInterface', $proxy);
6550
$this->assertSame($proxy, $container->get('foo'));
6651

6752
$this->assertFalse($proxy->isProxyInitialized());
@@ -71,4 +56,19 @@ public function testDumpContainerWithProxyServiceWillShareProxies()
7156
$this->assertTrue($proxy->isProxyInitialized());
7257
$this->assertSame($proxy, $container->get('foo'));
7358
}
59+
60+
private function dumpLazyServiceProjectServiceContainer()
61+
{
62+
$container = new ContainerBuilder();
63+
64+
$container->register('foo', 'stdClass');
65+
$container->getDefinition('foo')->setLazy(true);
66+
$container->compile();
67+
68+
$dumper = new PhpDumper($container);
69+
70+
$dumper->setProxyDumper(new ProxyDumper());
71+
72+
return $dumper->dump(array('class' => 'LazyServiceProjectServiceContainer'));
73+
}
7474
}

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php

Lines changed: 0 additions & 185 deletions
This file was deleted.

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
use %a
4-
class ProjectServiceContainer extends Container
4+
class LazyServiceProjectServiceContainer extends Container
55
{%a
66
public function getFooService($lazyLoad = true)
77
{

0 commit comments

Comments
 (0)