Issue104Test.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Gedmo\Sluggable;
  3. use Doctrine\Common\EventManager;
  4. use Tool\BaseTestCaseORM;
  5. use Sluggable\Fixture\Issue104\Car;
  6. /**
  7. * These are tests for Sluggable behavior
  8. *
  9. * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
  10. * @package Gedmo.Sluggable
  11. * @link http://www.gediminasm.org
  12. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  13. */
  14. class Issue104Test extends BaseTestCaseORM
  15. {
  16. const CAR = 'Sluggable\\Fixture\\Issue104\\Car';
  17. protected function setUp()
  18. {
  19. parent::setUp();
  20. }
  21. /**
  22. * @test
  23. * @expectedException Gedmo\Exception\InvalidMappingException
  24. */
  25. public function shouldThrowAnExceptionWhenMappedSuperclassProtectedProperty()
  26. {
  27. $evm = new EventManager;
  28. $evm->addEventSubscriber(new SluggableListener);
  29. $this->getMockSqliteEntityManager($evm);
  30. $audi = new Car;
  31. $audi->setDescription('audi car');
  32. $audi->setTitle('Audi');
  33. $this->em->persist($audi);
  34. $this->em->flush();
  35. }
  36. protected function getUsedEntityFixtures()
  37. {
  38. return array(
  39. self::CAR
  40. );
  41. }
  42. }