[DependencyInjection] Tests for AutowirePass with missing parent class
This commit is contained in:
parent
d1038c3421
commit
1735b85c04
@ -397,6 +397,21 @@ class AutowirePassTest extends \PHPUnit_Framework_TestCase
|
||||
$definition->getArguments()
|
||||
);
|
||||
}
|
||||
|
||||
public function testIgnoreServiceWithClassNotExisting()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
|
||||
$container->register('class_not_exist', __NAMESPACE__.'\OptionalServiceClass');
|
||||
|
||||
$barDefinition = $container->register('bar', __NAMESPACE__.'\Bar');
|
||||
$barDefinition->setAutowired(true);
|
||||
|
||||
$pass = new AutowirePass();
|
||||
$pass->process($container);
|
||||
|
||||
$this->assertTrue($container->hasDefinition('bar'));
|
||||
}
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
|
||||
|
||||
use Symfony\Bug\NotExistClass;
|
||||
|
||||
class OptionalServiceClass extends NotExistClass
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user