コード例 #1
0
ファイル: MacroTest.php プロジェクト: titon/utility-old
 /**
  * Test that macros aren't shared between classes.
  */
 public function testInheritance()
 {
     $this->assertFalse(Format::hasMethod('foobar'));
     $this->assertFalse(Path::hasMethod('foobar'));
     Format::macro('foobar', function () {
     });
     $this->assertTrue(Format::hasMethod('foobar'));
     $this->assertFalse(Path::hasMethod('foobar'));
 }
コード例 #2
0
ファイル: FormatTest.php プロジェクト: titon/utility-old
 /**
  * Test that time() formats a timestamp to time.
  */
 public function testTime()
 {
     $time = mktime(16, 35, 0, 2, 26, 1988);
     $this->assertEquals('16:35:00', Format::time($time));
     $this->assertEquals('04:35PM', Format::time($time, '%I:%M%p'));
 }
コード例 #3
0
ファイル: Format.php プロジェクト: titon/g11n
 /**
  * {@inheritdoc}
  */
 public static function time($time, $format = '%H:%M:%S')
 {
     return parent::time($time, self::get('time', $format));
 }