Inheritance: implements Sulu\Component\Content\Query\ContentQueryExecutorInterface
Exemplo n.º 1
0
 public function testOrder()
 {
     $this->executor->execute('default', ['en'], $this->builder)->willReturn([['uuid' => 1], ['uuid' => 2], ['uuid' => 3]]);
     $this->container = new InternalLinksContainer([2, 3, 1], $this->executor->reveal(), $this->builder->reveal(), [], new NullLogger(), 'default', 'en');
     $result = $this->container->getData();
     $this->assertEquals([['uuid' => 2], ['uuid' => 3], ['uuid' => 1]], $result);
 }
 public function testShadow()
 {
     $data = $this->shadowProvider();
     $builder = new SmartContentQueryBuilder($this->structureManager, $this->webspaceManager, $this->sessionManager, $this->languageNamespace);
     $builder->init(['ids' => [$data['en']['/team/thomas']->getUuid(), $data['en']['/team/daniel']->getUuid(), $data['en']['/team/johannes']->getUuid()]]);
     $result = $this->contentQuery->execute('sulu_io', ['en'], $builder);
     $this->assertEquals(1, sizeof($result));
     $this->assertEquals('/team/daniel', $result[0]['url']);
     $this->assertEquals('Daniel', $result[0]['title']);
     $result = $this->contentQuery->execute('sulu_io', ['de'], $builder);
     $this->assertEquals(2, sizeof($result));
     $this->assertEquals('/team/daniel', $result[0]['url']);
     $this->assertEquals('Daniel', $result[0]['title']);
     $this->assertEquals('/team/johannes', $result[1]['url']);
     $this->assertEquals('Johannes DE', $result[1]['title']);
 }