Inheritance: implements Sulu\Component\Content\Repository\ContentRepositoryInterface
Exemplo n.º 1
0
 public function testFindConcreteLanguages()
 {
     $this->initPhpcr();
     $page = $this->createShadowPage('test', 'de', 'en');
     $result = $this->contentRepository->find($page->getUuid(), 'de', 'sulu_io', MappingBuilder::create()->setResolveConcreteLocales(true)->getMapping());
     $this->assertEquals(['de'], $result->getConcreteLanguages());
 }
Exemplo n.º 2
0
 public function testFindByPaths()
 {
     $this->initPhpcr();
     $page1 = $this->createPage('test-1', 'de');
     $page11 = $this->createPage('test-1/test-1', 'de', [], $page1);
     $page2 = $this->createPage('test-2', 'de');
     $page3 = $this->createPage('test-3', 'de');
     $result = $this->contentRepository->findByPaths(['/cmf/sulu_io/contents', '/cmf/sulu_io/contents/test-1', '/cmf/sulu_io/contents/test-2'], 'de', MappingBuilder::create()->addProperties(['title'])->getMapping());
     $this->assertCount(3, $result);
     $this->assertEquals($this->sessionManager->getContentNode('sulu_io')->getIdentifier(), $result[0]->getId());
     $this->assertTrue($result[0]->hasChildren());
     $this->assertEmpty($result[0]->getChildren());
     $this->assertEquals($page1->getUuid(), $result[1]->getId());
     $this->assertTrue($result[1]->hasChildren());
     $this->assertEmpty($result[1]->getChildren());
     $this->assertEquals($page2->getUuid(), $result[2]->getId());
     $this->assertFalse($result[2]->hasChildren());
     $this->assertEmpty($result[2]->getChildren());
 }