Beispiel #1
0
	/**
	 * @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'
		);


	}
Beispiel #2
0
 /**
  * @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'));
 }