Sulu\Bundle\TestBundle\Testing\SuluTestCase::setUp PHP Method

setUp() protected method

protected setUp ( )
    protected function setUp()
    {
        parent::setUp();
        $this->importer = new PHPCRImporter($this->getContainer()->get('sulu_document_manager.default_session'), $this->getContainer()->get('sulu_document_manager.live_session'));
    }

Usage Example

 public function setUp()
 {
     parent::setUp();
     $this->purgeDatabase();
     $this->initPhpcr();
     $this->mapper = $this->getContainer()->get('sulu.content.mapper');
     $this->structureManager = $this->getContainer()->get('sulu.content.structure_manager');
     $this->webspaceManager = $this->getContainer()->get('sulu_core.webspace.webspace_manager');
     $this->sessionManager = $this->getContainer()->get('sulu.phpcr.session');
     $this->contentQuery = $this->getContainer()->get('sulu.content.query_executor');
     $this->languageNamespace = $this->getContainer()->getParameter('sulu.content.language.namespace');
     $em = $this->getContainer()->get('doctrine')->getManager();
     $user = $em->getRepository('Sulu\\Bundle\\SecurityBundle\\Entity\\User')->findOneByUsername('test');
     $this->tag1 = new Tag();
     $this->tag1->setName('test1');
     $this->tag1->setCreator($user);
     $this->tag1->setChanger($user);
     $em->persist($this->tag1);
     $this->tag2 = new Tag();
     $this->tag2->setName('test2');
     $this->tag2->setCreator($user);
     $this->tag2->setChanger($user);
     $em->persist($this->tag2);
     $this->tag3 = new Tag();
     $this->tag3->setName('test3');
     $this->tag3->setCreator($user);
     $this->tag3->setChanger($user);
     $em->persist($this->tag3);
     $em->flush();
 }
All Usage Examples Of Sulu\Bundle\TestBundle\Testing\SuluTestCase::setUp