本文整理汇总了PHP中JDocument::getMetaData方法的典型用法代码示例。如果您正苦于以下问题:PHP JDocument::getMetaData方法的具体用法?PHP JDocument::getMetaData怎么用?PHP JDocument::getMetaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JDocument
的用法示例。
在下文中一共展示了JDocument::getMetaData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetMetaData
/**
* @todo Implement testGetMetaData().
*/
public function testGetMetaData() {
$this->object = new JDocument;
$this->assertThat(
$this->object->getMetaData('generator'),
$this->equalTo('Joomla! 1.7 - Open Source Content Management'),
'JDocument::getMetaData did not return generator properly'
);
$this->object->setMetaData('generator', 'My Custom Generator');
$this->assertThat(
$this->object->getMetaData('generator'),
$this->equalTo('My Custom Generator'),
'JDocument::getMetaData did not return generator properly or setMetaData with generator did not work'
);
$this->assertThat(
$this->object->getMetaData('description'),
$this->equalTo(''),
'JDocument::getMetaData did not return description properly'
);
$this->object->setMetaData('description', 'My Description');
$this->assertThat(
$this->object->getMetaData('description'),
$this->equalTo('My Description'),
'JDocument::getMetaData did not return description properly or setMetaData with description didn not set properly'
);
$this->object->setMetaData('myMetaTag', 'myMetaContent');
$this->assertThat(
$this->object->getMetaData('myMetaTag'),
$this->equalTo('myMetaContent'),
'JDocument::getMetaData or setMetaData failed'
);
$this->assertThat(
$this->object->getMetaData('myMetaTag', true),
$this->logicalNot($this->equalTo('myMetaContent')),
'JDocument::getMetaData or setMetaData returned http_equiv when it should not have'
);
$this->object->setMetaData('myOtherMetaTag', 'myOtherMetaContent', true);
$this->assertThat(
$this->object->getMetaData('myOtherMetaTag', true),
$this->equalTo('myOtherMetaContent'),
'JDocument::getMetaData or setMetaData failed'
);
$this->assertThat(
$this->object->getMetaData('myOtherMetaTag'),
$this->logicalNot($this->equalTo('myOtherMetaContent')),
'JDocument::getMetaData or setMetaData returned http_equiv when it should not have'
);
}
示例2: testTheReturnForGetMetaDataWithCustomParamAndHttpEquivFalseAndDataSet
/**
* @testdox Test the return for getMetaData with a custom param and HTTP-Equiv flag false with data not set to HTTP-Equiv
*/
public function testTheReturnForGetMetaDataWithCustomParamAndHttpEquivFalseAndDataSet()
{
$this->object->setMetaData('myMetaTag', 'myMetaContent');
$this->assertSame('myMetaContent', $this->object->getMetaData('myMetaTag'));
}