You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #9816 [DependencyInjection] fixes#9815 Syntax error in PHP dumper (realityking)
This PR was merged into the 2.5-dev branch.
Discussion
----------
[DependencyInjection] fixes#9815 Syntax error in PHP dumper
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #9815
| License | MIT
| Doc PR | -
I also updated the unit tests to test a namespaces class to prevent future issues like this one.
Commits
-------
e00b0f3 [DependencyInjection] fixes#9815 Syntax error in PHP dumper
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
+24-24Lines changed: 24 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ public function testDefinitions()
40
40
{
41
41
$builder = newContainerBuilder();
42
42
$definitions = array(
43
-
'foo' => newDefinition('FooClass'),
43
+
'foo' => newDefinition('Bar\FooClass'),
44
44
'bar' => newDefinition('BarClass'),
45
45
);
46
46
$builder->setDefinitions($definitions);
@@ -69,7 +69,7 @@ public function testDefinitions()
69
69
publicfunctiontestRegister()
70
70
{
71
71
$builder = newContainerBuilder();
72
-
$builder->register('foo', 'FooClass');
72
+
$builder->register('foo', 'Bar\FooClass');
73
73
$this->assertTrue($builder->hasDefinition('foo'), '->register() registers a new service definition');
74
74
$this->assertInstanceOf('Symfony\Component\DependencyInjection\Definition', $builder->getDefinition('foo'), '->register() returns the newly created Definition instance');
75
75
}
@@ -81,7 +81,7 @@ public function testHas()
81
81
{
82
82
$builder = newContainerBuilder();
83
83
$this->assertFalse($builder->has('foo'), '->has() returns false if the service does not exist');
84
-
$builder->register('foo', 'FooClass');
84
+
$builder->register('foo', 'Bar\FooClass');
85
85
$this->assertTrue($builder->has('foo'), '->has() returns true if a service definition exists');
86
86
$builder->set('bar', new \stdClass());
87
87
$this->assertTrue($builder->has('bar'), '->has() returns true if a service exists');
@@ -259,11 +259,11 @@ public function testAddGetCompilerPass()
$this->assertInstanceOf('\FooClass', $builder->get('foo2'), '->createService() replaces parameters in the file provided by the service definition');
266
+
$this->assertInstanceOf('\Bar\FooClass', $builder->get('foo2'), '->createService() replaces parameters in the file provided by the service definition');
267
267
}
268
268
269
269
/**
@@ -273,13 +273,13 @@ public function testCreateProxyWithRealServiceInstantiator()
$this->assertEquals(array('foo' => 'bar', 'bar' => 'foo', $builder->get('bar'), '%unescape_it%'), $builder->get('foo1')->arguments, '->createService() replaces parameters and service references in the arguments provided by the service definition');
306
306
}
@@ -312,7 +312,7 @@ public function testCreateServiceFactoryMethod()
$this->assertEquals(array('bar', $builder->get('bar')), $builder->get('foo1')->bar, '->createService() replaces the values in the method calls arguments');
343
343
}
@@ -348,23 +348,23 @@ public function testCreateServiceMethodCalls()
$this->fail('->createService() throws an InvalidArgumentException if the configure callable is not a valid callable');
366
366
} catch (\InvalidArgumentException$e) {
367
-
$this->assertEquals('The configure callable for class "FooClass" is not a callable.', $e->getMessage(), '->createService() throws an InvalidArgumentException if the configure callable is not a valid callable');
367
+
$this->assertEquals('The configure callable for class "Bar\FooClass" is not a callable.', $e->getMessage(), '->createService() throws an InvalidArgumentException if the configure callable is not a valid callable');
368
368
}
369
369
}
370
370
@@ -375,7 +375,7 @@ public function testCreateServiceConfigurator()
@@ -394,7 +394,7 @@ public function testCreateServiceWithExpression()
394
394
publicfunctiontestResolveServices()
395
395
{
396
396
$builder = newContainerBuilder();
397
-
$builder->register('foo', 'FooClass');
397
+
$builder->register('foo', 'Bar\FooClass');
398
398
$this->assertEquals($builder->get('foo'), $builder->resolveServices(newReference('foo')), '->resolveServices() resolves service references to service instances');
399
399
$this->assertEquals(array('foo' => array('foo', $builder->get('foo'))), $builder->resolveServices(array('foo' => array('foo', newReference('foo')))), '->resolveServices() resolves service references to service instances in nested arrays');
0 commit comments