当前位置: 首页>>代码示例>>PHP>>正文


PHP JDocument::getMetaData方法代码示例

本文整理汇总了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'
		);


	}
开发者ID:realityking,项目名称:JAJAX,代码行数:63,代码来源:JDocumentTest.php

示例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'));
 }
开发者ID:n3t,项目名称:joomla-cms,代码行数:8,代码来源:JDocumentTest.php


注:本文中的JDocument::getMetaData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。