/** * @return XsTime */ public static function currentTime() { return XsTime::now(); }
/** * @param $value * @return XsTime */ public static function xsTime($value) { $value = XsTime::castToNodeValue($value); return XsTime::fromString($value); }
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'])); }
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]']); }