Example #1
0
	/**
	 * @todo Implement testGetOverwrite().
	 */
	public function testGetAndSetOverwrite()
	{
		$this->saveFactoryState();

		$newDbo = $this->getMock('test');

		JFactory::$database = &$newDbo;

		$this->object = JInstaller::getInstance();
		$this->object->setOverwrite(false);

		$this->assertThat(
			$this->object->getOverwrite(),
			$this->equalTo(false),
			'Get or Set overwrite failed'
		);

		$this->assertThat(
			$this->object->setOverwrite(true),
			$this->equalTo(false),
			'setOverwrite did not return the old value properly.'
		);

		$this->assertThat(
			$this->object->getOverwrite(),
			$this->equalTo(true),
			'getOverwrite did not return the expected value.'
		);

		$this->restoreFactoryState();
	}