"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

ResolveBindingsPassTest.php  (phplist-3.4.5.tgz):ResolveBindingsPassTest.php  (phplist-3.4.6.tgz)
skipping to change at line 51 skipping to change at line 51
$container->register('foo', CaseSensitiveClass::class) $container->register('foo', CaseSensitiveClass::class)
->setBindings($bindings); ->setBindings($bindings);
$pass = new ResolveBindingsPass(); $pass = new ResolveBindingsPass();
$pass->process($container); $pass->process($container);
$this->assertEquals([new Reference('foo'), '123'], $definition->getArgum ents()); $this->assertEquals([new Reference('foo'), '123'], $definition->getArgum ents());
$this->assertEquals([['setSensitiveClass', [new Reference('foo')]]], $de finition->getMethodCalls()); $this->assertEquals([['setSensitiveClass', [new Reference('foo')]]], $de finition->getMethodCalls());
} }
/**
* @expectedException \Symfony\Component\DependencyInjection\Exception\Inval
idArgumentException
* @expectedExceptionMessage Unused binding "$quz" in service "Symfony\Compo
nent\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy".
*/
public function testUnusedBinding() public function testUnusedBinding()
{ {
$this->expectException('Symfony\Component\DependencyInjection\Exception\
InvalidArgumentException');
$this->expectExceptionMessage('Unused binding "$quz" in service "Symfony
\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy".');
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$definition = $container->register(NamedArgumentsDummy::class, NamedArgu mentsDummy::class); $definition = $container->register(NamedArgumentsDummy::class, NamedArgu mentsDummy::class);
$definition->setBindings(['$quz' => '123']); $definition->setBindings(['$quz' => '123']);
$pass = new ResolveBindingsPass(); $pass = new ResolveBindingsPass();
$pass->process($container); $pass->process($container);
} }
/** /**
* @expectedException \Symfony\Component\DependencyInjection\Exception\Inval * @group issue-32995
idArgumentException *
* @expectedExceptionMessageRegexp Unused binding "$quz" in service [\s\S]+ * @runInSeparateProcess https://github.com/symfony/symfony/issues/32995
Invalid service ".*\\ParentNotExists": class NotExists not found\.
*/ */
public function testMissingParent() public function testMissingParent()
{ {
$this->expectException('Symfony\Component\DependencyInjection\Exception\
InvalidArgumentException');
$this->expectExceptionMessageRegExp('/Unused binding "\$quz" in service
[\s\S]+/');
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$definition = $container->register(ParentNotExists::class, ParentNotExis ts::class); $definition = $container->register(ParentNotExists::class, ParentNotExis ts::class);
$definition->setBindings(['$quz' => '123']); $definition->setBindings(['$quz' => '123']);
$pass = new ResolveBindingsPass(); $pass = new ResolveBindingsPass();
$pass->process($container); $pass->process($container);
} }
public function testTypedReferenceSupport() public function testTypedReferenceSupport()
skipping to change at line 117 skipping to change at line 119
$definition = $container->autowire('foo', ScalarSetter::class); $definition = $container->autowire('foo', ScalarSetter::class);
$definition->setBindings(['$defaultLocale' => 'fr']); $definition->setBindings(['$defaultLocale' => 'fr']);
(new AutowireRequiredMethodsPass())->process($container); (new AutowireRequiredMethodsPass())->process($container);
(new ResolveBindingsPass())->process($container); (new ResolveBindingsPass())->process($container);
$this->assertEquals([['setDefaultLocale', ['fr']]], $definition->getMeth odCalls()); $this->assertEquals([['setDefaultLocale', ['fr']]], $definition->getMeth odCalls());
} }
/** /**
* @expectedException \Symfony\Component\DependencyInjection\Exception\Runti meException
* @exceptedExceptionMessage Invalid service "Symfony\Component\DependencyIn jection\Tests\Fixtures\NamedArgumentsDummy": method "setLogger()" does not exist . * @exceptedExceptionMessage Invalid service "Symfony\Component\DependencyIn jection\Tests\Fixtures\NamedArgumentsDummy": method "setLogger()" does not exist .
*/ */
public function testWithNonExistingSetterAndBinding() public function testWithNonExistingSetterAndBinding()
{ {
$this->expectException('Symfony\Component\DependencyInjection\Exception\ RuntimeException');
$container = new ContainerBuilder(); $container = new ContainerBuilder();
$bindings = [ $bindings = [
'$c' => (new Definition('logger'))->setFactory('logger'), '$c' => (new Definition('logger'))->setFactory('logger'),
]; ];
$definition = $container->register(NamedArgumentsDummy::class, NamedArgu mentsDummy::class); $definition = $container->register(NamedArgumentsDummy::class, NamedArgu mentsDummy::class);
$definition->addMethodCall('setLogger'); $definition->addMethodCall('setLogger');
$definition->setBindings($bindings); $definition->setBindings($bindings);
 End of changes. 6 change blocks. 
11 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)