/** * Returns not paged content. * * @param SmartContentContainer $container * @param string $excludeUuid * * @return \Sulu\Component\Content\Compat\StructureInterface[] */ private function getNotPagedContentData(SmartContentContainer $container, $excludeUuid) { return $container->getData([$excludeUuid]); }
public function testReadPreview() { $smartContentContainerPreview = new SmartContentContainer($this->contentQuery, $this->contentQueryBuilder, $this->tagManager, ['page_parameter' => 'p', 'properties' => []], 'test', 'en', 's'); $smartContentContainerPreview->setConfig(['tags' => ['Tag1', 'Tag2'], 'limitResult' => '2']); $node = $this->getMockForAbstractClass('Sulu\\Bundle\\ContentBundle\\Tests\\Unit\\Content\\Types\\NodeInterface', [], '', true, true, true, ['getPropertyValueWithDefault']); $property = $this->getMockForAbstractClass('Sulu\\Component\\Content\\Compat\\PropertyInterface', [], '', true, true, true, ['setValue']); $node->expects($this->any())->method('getPropertyValueWithDefault')->will($this->returnValueMap([['property', '{}', '{"tags":[1,2],"limitResult":"2"}']])); $property->expects($this->any())->method('getName')->will($this->returnValue('property')); $property->expects($this->any())->method('getParams')->will($this->returnValue([])); $property->expects($this->exactly(1))->method('setValue')->with($smartContentContainerPreview->getConfig()); $this->smartContent->readForPreview(['tags' => ['Tag1', 'Tag2'], 'limitResult' => 2], $property, 'test', 'en', 's'); }