Example #1
0
	/**
	 * Test for reset method.
	 *
	 * @covers JTable::reset
	 *
	 * @return  void
	 *
	 * @since   12.3
	 */
	public function testReset()
	{
		$this->object->title = 'My Title';
		$this->object->id1 = 25;
		$this->object->id2 = 50;

		$this->object->reset();

		// The regular fields should get reset
		$this->assertEquals(
			'\'\'',
			$this->object->title
		);

		// The primary keys should be left alone.
		$this->assertEquals(
			25,
			$this->object->id1
		);

		$this->assertEquals(
				50,
				$this->object->id2
		);
	}
Example #2
0
 /**
  * Method to reset class properties to the defaults set in the class
  * definition. It will ignore the primary key as well as any private class
  * properties.
  */
 public function reset()
 {
     parent::reset();
     if (!$this->onAfterReset()) {
         return false;
     }
 }
Example #3
0
 /**
  * Method to reset class properties to the defaults set in the class
  * definition. It will ignore the primary key as well as any private class
  * properties (except $_errors).
  *
  * @return  void
  *
  * @since   3.2.1
  */
 public function reset()
 {
     parent::reset();
     // Reset the location properties.
     $this->setLocation(0);
 }