/** * Test the creation methods. */ function test_creation() { // class methods - instance creation // current() // epoch() // starting() // startingDuration() // startingEnding() $timespan = Timespan::current(); $this->assertEqual($timespan->startYear(), intval(date('Y'))); $this->assertEqual($timespan->startMonth(), intval(date('n'))); $this->assertEqual($timespan->dayOfMonth(), intval(date('j'))); $duration = $timespan->duration(); $this->assertTrue($duration->isEqualTo(Duration::zero())); $this->assertEqual(strtolower(get_class($timespan)), 'timespan'); $timespan = Timespan::epoch(); $this->assertEqual($timespan->startYear(), 1901); $this->assertEqual($timespan->startMonth(), 1); $this->assertEqual($timespan->dayOfMonth(), 1); $duration = $timespan->duration(); $this->assertTrue($duration->isEqualTo(Duration::zero())); $this->assertEqual(strtolower(get_class($timespan)), 'timespan'); }
/** * Answer a Month starting on the Squeak epoch: 1 January 1901 * * @param optional string $class DO NOT USE OUTSIDE OF PACKAGE. * This parameter is used to get around the limitations of not being * able to find the class of the object that recieved the initial * method call. * @return object Month * @access public * @since 5/5/05 * @static */ static function epoch($class = 'Month') { $obj = parent::epoch($class); return $obj; }
/** * Answer a Month starting on the Squeak epoch: 1 January 1901 * * @param optional string $class DO NOT USE OUTSIDE OF PACKAGE. * This parameter is used to get around the limitations of not being * able to find the class of the object that recieved the initial * method call. * @return object Schedule * @access public * @since 5/5/05 * @static */ static function epoch($class = 'Schedule') { $obj = parent::epoch($class); return $obj; }