コード例 #1
0
ファイル: Period.test.php プロジェクト: nnnnathann/piwik
 public function test_getLabel()
 {
     $period = new Piwik_Period_Day(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertTrue(is_string($label) && !empty($label));
     $period = new Piwik_Period_Week(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertTrue(is_string($label) && !empty($label));
     $period = new Piwik_Period_Month(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertTrue(is_string($label) && !empty($label));
     $period = new Piwik_Period_Year(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertTrue(is_string($label) && !empty($label));
 }
コード例 #2
0
ファイル: PeriodTest.php プロジェクト: nnnnathann/piwik
 /**
  * @group Core
  * @group Period
  */
 public function testGetLabel()
 {
     $period = new Piwik_Period_Day(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
     $period = new Piwik_Period_Week(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
     $period = new Piwik_Period_Month(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
     $period = new Piwik_Period_Year(Piwik_Date::today());
     $label = $period->getLabel();
     $this->assertInternalType('string', $label);
     $this->assertNotEmpty($label);
 }