Esempio n. 1
0
 /**
  * Test core Meta tag values
  */
 public function testMetaOutput()
 {
     SEO::init();
     $page = new SiteTree(['MetaTitle' => 'test_title', 'MetaDescription' => 'test_description', 'Canonical' => 'test_canonical', 'Robots' => 'test_index,follow', 'OGtype' => 'test_ogtype', 'OGlocale' => 'test_locale', 'TwitterCard' => 'test_summary']);
     $page->write();
     $page->publish('Stage', 'Live');
     SEO::setPage($page);
     $tags = SEO::HeadTags();
     $this->assertContains('<title>test_title</title>', $tags);
     $this->assertContains('<meta property="og:title" content="test_title">', $tags);
     $this->assertContains('<meta name="twitter:title" content="test_title">', $tags);
     $this->assertContains('<meta name="description" content="test_description">', $tags);
     $this->assertContains('<meta property="og:description" content="test_description">', $tags);
     $this->assertContains('<meta name="twitter:description" content="test_description">', $tags);
     $this->assertContains('<link rel="canonical" href="test_canonical">', $tags);
     $this->assertContains('<meta name="robots" content="test_index,follow">', $tags);
     $this->assertContains('<meta property="og:type" content="test_ogtype">', $tags);
     $this->assertContains('<meta property="og:locale" content="test_locale">', $tags);
     $this->assertContains('<meta name="twitter:card" content="test_summary">', $tags);
 }