예제 #1
0
파일: Date.php 프로젝트: Samshal/xsl
 /**
  * @return XsTime
  */
 public static function currentTime()
 {
     return XsTime::now();
 }
예제 #2
0
파일: Functions.php 프로젝트: Samshal/xsl
 /**
  * @param $value
  * @return XsTime
  */
 public static function xsTime($value)
 {
     $value = XsTime::castToNodeValue($value);
     return XsTime::fromString($value);
 }
예제 #3
0
 public function testTimeLanguage()
 {
     $xsTime = XsTime::fromString('15:37:00');
     $this->assertEquals('15:37:00', $this->transformFile('Stubs/Xsl/Formatting/format-time.xsl', ['time' => (string) $xsTime, 'picture' => '[H]:[m]:[s]', 'language' => 'en']));
 }
예제 #4
0
 public function testFormatTimeNoDayOfWeek()
 {
     $this->setExpectedException(InvalidArgumentException::class);
     $xsTime = XsTime::fromString('09:37:00');
     $this->transformFile('Stubs/Xsl/Formatting/format-time.xsl', ['time' => (string) $xsTime, 'picture' => '[F]']);
 }