MyInheritenceTest

<?php

namespace Gedmo\Sluggable;

use Doctrine\Common\EventManager;
use Tool\BaseTestCaseORM;
use Sluggable\Fixture\test\Car;
use Sluggable\Fixture\test\Vehicle;
use Sluggable\Fixture\test\Batmobile;


class MyInheritenceTest extends BaseTestCaseORM
{
    const VEHICLE = 'Sluggable\\Fixture\\Test\\Vehicle';
    const CAR = 'Sluggable\\Fixture\\Test\\Car';
    const BATMOBILE = 'Sluggable\\Fixture\\Test\\Batmobile';


    protected function setUp()
    {
        parent::setUp();

        $evm = new EventManager;
        $evm->addEventSubscriber(new SluggableListener);

        $this->getMockSqliteEntityManager($evm);
    }

    public function testSlugGeneration()
    {
        $tab =array();
        $audi = new Car;
        $audi->setDescription('audi car');
        $audi->setTitle('Audi');


        $this->em->persist($audi);

        $audi2 = new Car;
        $audi2->setDescription('audi2 car');
        $audi2->setTitle('Audi');



        $this->em->persist($audi2);

        $audi3 = new Batmobile;
        $audi3->setTitle('Audi');


        $this->em->persist($audi3);


        $audi4 = new Car;
        $audi4->setDescription('audi4 car');
        $audi4->setTitle('Audi');

        $this->em->persist($audi4);



        $audi5 = new Batmobile;
        $audi5->setTitle('Audi');
        $audi5->setDescription('audi5 car');

        $this->em->persist($audi5);


        $audi6 = new Car;
        $audi6->setDescription('audi6 car');
        $audi6->setTitle('Audi');

        $this->em->persist($audi6);



        $this->em->flush();
        $tab[] = $audi->getSlug();
        $tab[] = $audi2->getSlug();
        $tab[] = $audi3->getSlug();
        $tab[] = $audi4->getSlug();
        $tab[] = $audi5->getSlug();
        $tab[] = $audi6->getSlug();


        var_dump($tab);

    }

    protected function getUsedEntityFixtures()
    {
        return array(
            self::VEHICLE,
            self::CAR,
            self::BATMOBILE
        );
    }
}