コード例 #1
0
 public function setUp()
 {
     parent::setUp();
     $this->getResponseEvent = $this->prophesize('Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent');
     $this->requestAnalyzer = $this->prophesize('Sulu\\Component\\Webspace\\Analyzer\\RequestAnalyzerInterface');
     $this->requestListener = new RequestListener($this->requestAnalyzer->reveal());
 }
コード例 #2
0
 public function setUp()
 {
     $this->requestAnalyzer = $this->prophesize(RequestAnalyzerInterface::class);
     $this->contentPath = $this->prophesize(ContentPathInterface::class);
     $this->seoTwigExtension = new SeoTwigExtension($this->requestAnalyzer->reveal(), $this->contentPath->reveal());
 }
コード例 #3
0
 public function testLoadParentStartPage()
 {
     $this->setExpectedException('Sulu\\Bundle\\WebsiteBundle\\Twig\\Exception\\ParentNotFoundException', 'Parent for "321-321-321" not found (perhaps it is the startpage?)');
     $extension = new ContentTwigExtension($this->contentMapper->reveal(), $this->structureResolver, $this->sessionManager->reveal(), $this->requestAnalyzer->reveal());
     $extension->loadParent('321-321-321');
 }
コード例 #4
0
 /**
  * Seo titel.
  */
 public function testGetSeoMetaTagsFallback()
 {
     $extension = new MetaTwigExtension($this->requestAnalyzer->reveal(), $this->contentPath->reveal());
     $metaTags = $extension->getSeoMetaTags(['seo' => ['title' => 'SEO Title', 'noIndex' => false, 'noFollow' => false, 'keywords' => 'SEO, Keywords'], 'excerpt' => ['description' => 'Excerpt Description']], ['title' => 'Page Title']);
     $this->assertEquals(['<meta name="description" content="Excerpt Description">', '<meta name="keywords" content="SEO, Keywords">', '<meta name="robots" content="INDEX, FOLLOW">'], explode(PHP_EOL, $metaTags));
 }