Project

General

Profile

Feature #22992 » 14860_test.diff

Version 4 of the unit tests - Jigal van Hemert, 2016-06-09 14:27

View differences:

tests/t3lib/t3lib_pagerendererTest.php (working copy)
}
/**
* test add meta tag
* test add meta tags
*
*/
public function testAddMetaTag() {
public function testAddMetaTags() {
$expectedReturnValue = '<meta name="author" content="Anna Lyse">';
$this->fixture->addMetaTag('<meta name="author" content="Anna Lyse">');
$expectedReturnValues = array(
'<meta name="author" content="Anna Lyse" />',
'<meta name="author" content="John Doe" lang="en" />',
'<meta name="robots" content="noindex" />',
'<meta name="DC.format" content="text/html" scheme="DCTERMS.IMT" />',
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />',
'<meta http-equiv="refresh" content="5; URL=http://www.example.org/" />',
);
$this->fixture->addMetaTag('<meta name="author" content="Anna Lyse" />');
$this->fixture->addMetaTag('author', 'John Doe', array('lang' => 'en'));
$this->fixture->addMetaTag('robots', 'noindex');
$this->fixture->addMetaTag('DC.format', 'text/html', array('scheme' => 'DCTERMS.IMT'));
$this->fixture->addMetaTagHttpEquiv('Content-Type', 'text/html; charset=utf-8');
$this->fixture->addMetaTagHttpEquiv('refresh', '5; URL=http://www.example.org/');
$out = $this->fixture->render();
$this->assertContains(
$expectedReturnValue,
$out
);
foreach ($expectedReturnValues as $metaTag) {
$this->assertContains(
$metaTag,
$out,$out
);
}
}
/**
(4-4/4)