setUp() protected method

protected setUp ( )
 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();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->purgeDatabase();
     $this->em = $this->db('ORM')->getOm();
     $this->initOrm();
 }
Esempio n. 3
0
 protected function setUp()
 {
     parent::setUp();
     $this->em = $this->db('ORM')->getOm();
     $this->purgeDatabase();
     $this->setUpOperators();
     $this->client = $this->createAuthenticatedClient();
 }
Esempio n. 4
0
 protected function setUp()
 {
     parent::setUp();
     $this->purgeDatabase();
     $this->em = $this->db('ORM')->getOm();
     $this->setUpCollection();
     $this->setUpMedia();
 }
Esempio n. 5
0
 public function setUp()
 {
     parent::setUp();
     $this->documentManager = $this->getContainer()->get('sulu_document_manager.document_manager');
     $this->phpcrSession = $this->getContainer()->get('doctrine_phpcr')->getConnection();
     $this->initPhpcr();
     $this->loadFixtures();
     $this->client = $this->createAuthenticatedClient();
 }
Esempio n. 6
0
 public function setUp()
 {
     parent::setUp();
     $this->db('ORM')->purgeDatabase();
     $this->client = $this->createAuthenticatedClient();
     $this->searchManager = $this->client->getContainer()->get('massive_search.search_manager');
     $this->entityManager = $this->getContainer()->get('doctrine.orm.entity_manager');
     $this->createUser();
     $this->indexProducts();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->purgeDatabase();
     $this->em = $this->db('ORM')->getOm();
     $this->initOrm();
     $this->systemCollectionCache = $this->getContainer()->get('sulu_media.system_collections.cache');
     $this->systemCollectionConfig = $this->getContainer()->getParameter('sulu_media.system_collections');
     // to be sure that the system collections will rebuild after purge database
     $this->systemCollectionCache->invalidate();
 }
Esempio n. 8
0
 public function setUp()
 {
     parent::setUp();
     /** @var ObjectManager $em */
     $em = $this->getContainer()->get('doctrine.orm.entity_manager');
     foreach ($this->mediaTypes as $mediaTypeData) {
         $mediaType = new MediaType();
         $mediaType->setName($mediaTypeData['type']);
         $em->persist($mediaType);
     }
     $em->flush();
     $this->typeManager = new TypeManager($em, $this->mediaTypes, ['file/exe']);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->purgeDatabase();
     $this->em = $this->db('ORM')->getOm();
     $this->fileVersionMetaRepository = $this->em->getRepository('SuluMediaBundle:FileVersionMeta');
     $this->collectionType = new CollectionType();
     $this->collectionType->setName('image');
     $this->collection = new Collection();
     $this->collection->setType($this->collectionType);
     $this->mediaType = new MediaType();
     $this->mediaType->setName('image');
     $this->em->persist($this->collectionType);
     $this->em->persist($this->mediaType);
     $this->em->persist($this->collection);
     $this->em->flush();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->purgeDatabase();
     $this->em = $this->db('ORM')->getOm();
     $collectionType = new CollectionType();
     $collectionType->setName('Default Type');
     $collectionType->setDescription('Default Collection Type');
     $this->em->persist($collectionType);
     foreach ($this->collectionData as $collection) {
         $this->collections[] = $this->createCollection($collection[0], $collection[1], $collectionType);
     }
     $this->em->flush();
     /** @var CollectionRepository $repository */
     $repository = $this->getContainer()->get('sulu_media.collection_repository');
     $repository->recover();
     $this->em->flush();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->purgeDatabase();
     $this->em = $this->db('ORM')->getOm();
     foreach ($this->collectionData as $collection) {
         $this->collections[] = $this->createCollection($collection[0], $collection[1]);
     }
     $this->em->flush();
     foreach ($this->mediaTypeData as $type) {
         $this->mediaTypes[$type] = $this->createType($type);
     }
     $this->em->flush();
     foreach ($this->tagData as $tag) {
         $this->tags[] = $this->createTag($tag);
     }
     $this->em->flush();
     foreach ($this->mediaData as $media) {
         $this->medias[] = $this->createMediaWithTags($media[0], $media[1], $media[2], $media[3], $media[4]);
     }
     $this->em->flush();
 }
 public function setUp()
 {
     parent::setUp();
     $this->initOrm();
 }
Esempio n. 13
0
 public function setUp()
 {
     parent::setUp();
     $this->command = $this->getContainer()->get($this->commandServiceName);
 }