private function initPages() { $this->team = $this->savePage('simple', ['title' => 'Team', 'url' => '/team'], $this->session->getNode('/cmf/sulu_io/contents')->getIdentifier()); $this->johannes = $this->savePage('simple', ['title' => 'Johannes', 'url' => '/team/johannes'], $this->team->getUuid(), [$this->tag1->getId()]); $this->daniel = $this->savePage('simple', ['title' => 'Daniel', 'url' => '/team/daniel'], $this->team->getUuid()); $this->thomas = $this->savePage('simple', ['title' => 'Thomas', 'url' => '/team/thomas'], $this->team->getUuid()); }
public function testTagsBoth() { $root = $this->sessionManager->getContentNode('sulu_io'); list($nodes, $t1, $t2, $t1t2) = $this->tagsProvider(); $builder = new SmartContentQueryBuilder($this->structureManager, $this->webspaceManager, $this->sessionManager, $this->languageNamespace); $builder->init(['config' => ['dataSource' => $root->getIdentifier(), 'tags' => [$this->tag1->getId()], 'tagOperator' => 'and', 'websiteTags' => [$this->tag2->getId()], 'websiteTagsOperator' => 'and']]); $result = $this->contentQuery->execute('sulu_io', ['en'], $builder); $this->assertEquals($t1t2, count($result)); $builder->init(['config' => ['dataSource' => $root->getIdentifier(), 'tags' => [$this->tag1->getId()], 'tagOperator' => 'and', 'websiteTags' => [$this->tag1->getId(), $this->tag2->getId()], 'websiteTagsOperator' => 'OR']]); $result = $this->contentQuery->execute('sulu_io', ['en'], $builder); $this->assertEquals($t1t2 + $t2, count($result)); }