vendor/bundles/Symfony/Bundle/DoctrineFixturesBundle/Tests/Common/DataFixtures/LoaderTest.php
author cavaliet
Mon, 07 Jul 2014 17:23:47 +0200
changeset 122 d672f7dd74dc
parent 58 624e5900f5a4
permissions -rw-r--r--
Added tag V00.17 for changeset ada5f3d8b5b4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
namespace Symfony\Bundle\DoctrineFixturesBundle\Tests\Common\DataFixtures;
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use Symfony\Bundle\DoctrineFixturesBundle\Tests\TestCase;
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
use Symfony\Bundle\DoctrineFixturesBundle\Tests\Common\ContainerAwareFixture;
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
use Symfony\Bundle\DoctrineFixturesBundle\Common\DataFixtures\Loader;
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
class LoaderTest extends TestCase
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
{
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    public function testShouldSetContainerOnContainerAwareFixture()
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
    {
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
        $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
        $loader    = new Loader($container);
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
        $fixture   = new ContainerAwareFixture();
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
        $loader->addFixture($fixture);
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
        $this->assertSame($container, $fixture->container);
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
    }
624e5900f5a4 add tests and fixtures
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
}