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();
 }
Example #2
0
 /**
  * Returns system collections.
  *
  * @return array
  */
 private function getSystemCollections()
 {
     if (!$this->systemCollections) {
         if (!$this->cache->isFresh()) {
             $systemCollections = $this->buildSystemCollections($this->locale, $this->getUserId());
             $this->cache->write($systemCollections);
         }
         $this->systemCollections = $this->cache->read();
     }
     return $this->systemCollections;
 }
Example #3
0
 /**
  * @depends testWrite
  */
 public function testRead(CacheInterface $cache)
 {
     $this->assertEquals(['test' => 'test'], $cache->read());
 }