ContainerAwareLoaderTest.php 907 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bridge\Doctrine\Tests\DataFixtures;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
  13. use Symfony\Bridge\Doctrine\Tests\Fixtures\ContainerAwareFixture;
  14. class ContainerAwareLoaderTest extends TestCase
  15. {
  16. public function testShouldSetContainerOnContainerAwareFixture()
  17. {
  18. $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
  19. $loader = new ContainerAwareLoader($container);
  20. $fixture = new ContainerAwareFixture();
  21. $loader->addFixture($fixture);
  22. $this->assertSame($container, $fixture->container);
  23. }
  24. }