コード例 #1
0
ファイル: PeriodTest.php プロジェクト: qiuai/piwik
 public function testGetLabel()
 {
     $period = new Day(Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
     $period = new Week(Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
     $period = new Month(Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
     $period = new Year(Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
 }
コード例 #2
0
ファイル: DayTest.php プロジェクト: diosmosis/piwik
 /**
  * @group Core
  */
 public function testGetPrettyString()
 {
     $month = new Day(Date::factory('2024-10-09'));
     $shouldBe = '2024-10-09';
     $this->assertEquals($shouldBe, $month->getPrettyString());
 }