4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DependencyInjection\Tests\LazyProxy\Instantiator;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\DependencyInjection\Definition;
16 use Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator;
19 * Tests for {@see \Symfony\Component\DependencyInjection\Instantiator\RealServiceInstantiator}.
21 * @author Marco Pivetta <ocramius@gmail.com>
23 class RealServiceInstantiatorTest extends TestCase
25 public function testInstantiateProxy()
27 $instantiator = new RealServiceInstantiator();
28 $instance = new \stdClass();
29 $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
30 $callback = function () use ($instance) {
34 $this->assertSame($instance, $instantiator->instantiateProxy($container, new Definition(), 'foo', $callback));