bug #24365 [DependencyInjection] fix tests (xabbuh)
This PR was merged into the 4.0-dev branch.
Discussion
----------
[DependencyInjection] fix tests
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | adapt tests from #22200
| License | MIT
| Doc PR |
Commits
-------
08deb372f1
[DependencyInjection] fix tests
This commit is contained in:
commit
73ef4a909b
@ -274,8 +274,8 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
|
||||
// Returns the public 'tagged_iterator' shared service.
|
||||
|
||||
return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
|
||||
yield 0 => ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->load(__DIR__.'/getFooService.php')) && false ?: '_'};
|
||||
yield 1 => ${($_ = isset($this->services['tagged_iterator_foo']) ? $this->services['tagged_iterator_foo'] : $this->services['tagged_iterator_foo'] = new \Bar()) && false ?: '_'};
|
||||
yield 0 => ($this->services['foo'] ?? $this->load(__DIR__.'/getFooService.php'));
|
||||
yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
|
||||
}, 2));
|
||||
|
||||
[Container%s/getTaggedIteratorFooService.php] => <?php
|
||||
@ -285,7 +285,7 @@ use Symfony\Component\DependencyInjection\Argument\RewindableGenerator;
|
||||
// This file has been auto-generated by the Symfony Dependency Injection Component for internal use.
|
||||
// Returns the private 'tagged_iterator_foo' shared service.
|
||||
|
||||
return $this->services['tagged_iterator_foo'] = new \Bar();
|
||||
return $this->privates['tagged_iterator_foo'] = new \Bar();
|
||||
|
||||
[Container%s/Container.php] => <?php
|
||||
|
||||
@ -348,7 +348,6 @@ class Container%s extends Container
|
||||
'new_factory_service' => __DIR__.'/getNewFactoryServiceService.php',
|
||||
'service_from_static_method' => __DIR__.'/getServiceFromStaticMethodService.php',
|
||||
'tagged_iterator' => __DIR__.'/getTaggedIteratorService.php',
|
||||
'tagged_iterator_foo' => __DIR__.'/getTaggedIteratorFooService.php',
|
||||
);
|
||||
$this->aliases = array(
|
||||
'alias_for_alias' => 'foo',
|
||||
|
@ -53,7 +53,6 @@ class ProjectServiceContainer extends Container
|
||||
'new_factory_service' => 'getNewFactoryServiceService',
|
||||
'service_from_static_method' => 'getServiceFromStaticMethodService',
|
||||
'tagged_iterator' => 'getTaggedIteratorService',
|
||||
'tagged_iterator_foo' => 'getTaggedIteratorFooService',
|
||||
);
|
||||
$this->aliases = array(
|
||||
'alias_for_alias' => 'foo',
|
||||
@ -382,8 +381,8 @@ class ProjectServiceContainer extends Container
|
||||
protected function getTaggedIteratorService()
|
||||
{
|
||||
return $this->services['tagged_iterator'] = new \Bar(new RewindableGenerator(function () {
|
||||
yield 0 => ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->getFooService()) && false ?: '_'};
|
||||
yield 1 => ${($_ = isset($this->services['tagged_iterator_foo']) ? $this->services['tagged_iterator_foo'] : $this->services['tagged_iterator_foo'] = new \Bar()) && false ?: '_'};
|
||||
yield 0 => ($this->services['foo'] ?? $this->getFooService());
|
||||
yield 1 => ($this->privates['tagged_iterator_foo'] ?? $this->privates['tagged_iterator_foo'] = new \Bar());
|
||||
}, 2));
|
||||
}
|
||||
|
||||
@ -401,16 +400,6 @@ class ProjectServiceContainer extends Container
|
||||
return $this->privates['factory_simple'] = new \SimpleFactoryClass('foo');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the private 'tagged_iterator_foo' shared service.
|
||||
*
|
||||
* @return \Bar
|
||||
*/
|
||||
protected function getTaggedIteratorFooService()
|
||||
{
|
||||
return $this->services['tagged_iterator_foo'] = new \Bar();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user