FixtureTest.php 669 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Doctrine\Tests\Common\DataFixtures;
  3. use Doctrine\Common\DataFixtures\FixtureInterface;
  4. use Doctrine\Common\Persistence\ObjectManager;
  5. /**
  6. * Test Fixture interface.
  7. *
  8. * @author Jonathan H. Wage <jonwage@gmail.com>
  9. */
  10. class FixtureTest extends BaseTest
  11. {
  12. public function testFixtureInterface()
  13. {
  14. $em = $this->createMock(ObjectManager::class);
  15. $fixture = new MyFixture2();
  16. $fixture->load($em);
  17. self::assertTrue($fixture->loaded);
  18. }
  19. }
  20. class MyFixture2 implements FixtureInterface
  21. {
  22. public $loaded = false;
  23. public function load(ObjectManager $manager)
  24. {
  25. $this->loaded = true;
  26. }
  27. }