コード例 #1
0
ファイル: TimestampTest.php プロジェクト: alphadevx/alpha
 /**
  * Testing the setValue method with a bad timestamp value (out of range).
  *
  * @since 1.0
  */
 public function testSetValueInvalidValue()
 {
     try {
         $this->timestamp1->setTimestampValue(2000, 13, 1, 0, 0, 0);
         $this->fail('testing the setValue method with a bad timestamp value (out of range)');
     } catch (IllegalArguementException $e) {
         $this->assertEquals('The day value 2000-13-1 provided is invalid!', $e->getMessage(), 'testing the setValue method with a bad timestamp value (out of range)');
     }
 }
コード例 #2
0
ファイル: Controller.php プロジェクト: alphadevx/alpha
 /**
  * Setter for the unit end time (value will be stored in the session as key unitEndTime).
  *
  * @param int $year
  * @param int $month
  * @param int $day
  * @param int $hour
  * @param int $minute
  * @param int $second
  *
  * @since 1.0
  */
 public function setUnitEndTime($year, $month, $day, $hour, $minute, $second)
 {
     self::$logger->debug('>>setUnitEndTime(year=[' . $year . '], month=[' . $month . '], day=[' . $day . '], hour=[' . $hour . '], minute=[' . $minute . '],
      second=[' . $second . '])');
     $config = ConfigProvider::getInstance();
     $sessionProvider = $config->get('session.provider.name');
     $session = SessionProviderFactory::getInstance($sessionProvider);
     $this->unitEndTime->setTimestampValue($year, $month, $day, $hour, $minute, $second);
     $session->set('unitEndTime', $this->unitEndTime->getValue());
     self::$logger->debug('<<setUnitEndTime');
 }