Issue104Test.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * @link http://www.gediminasm.org
  11. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  12. */
  13. class Issue104Test extends BaseTestCaseORM
  14. {
  15. const CAR = 'Sluggable\\Fixture\\Issue104\\Car';
  16. protected function setUp()
  17. {
  18. parent::setUp();
  19. }
  20. /**
  21. * @test
  22. * @expectedException Gedmo\Exception\InvalidMappingException
  23. */
  24. public function shouldThrowAnExceptionWhenMappedSuperclassProtectedProperty()
  25. {
  26. $evm = new EventManager;
  27. $evm->addEventSubscriber(new SluggableListener);
  28. $this->getMockSqliteEntityManager($evm);
  29. $audi = new Car;
  30. $audi->setDescription('audi car');
  31. $audi->setTitle('Audi');
  32. $this->em->persist($audi);
  33. $this->em->flush();
  34. }
  35. protected function getUsedEntityFixtures()
  36. {
  37. return array(
  38. self::CAR
  39. );
  40. }
  41. }