예제 #1
0
파일: WeekTest.php 프로젝트: a4tunado/piwik
 /**
  * @group Core
  */
 public function testGetLocalizedShortString()
 {
     $this->loadEnglishTranslation();
     $week = new Week(Date::factory('2024-10-09'));
     $shouldBe = '7 Oct - 13 Oct 24';
     $this->assertEquals($shouldBe, $week->getLocalizedShortString());
 }
예제 #2
0
파일: WeekTest.php 프로젝트: jniebuhr/piwik
 /**
  * @group Core
  * @dataProvider getLocalizedShortStrings
  */
 public function testGetLocalizedShortString($language, $shouldBe)
 {
     StaticContainer::get('Piwik\\Translation\\Translator')->setCurrentLanguage($language);
     // a week within a month
     $week = new Week(Date::factory('2024-10-09'));
     $this->assertEquals($shouldBe[0], $week->getLocalizedShortString());
     // a week ending in another month
     $week = new Week(Date::factory('2024-12-01'));
     $this->assertEquals($shouldBe[1], $week->getLocalizedShortString());
     // a week ending in another year
     $week = new Week(Date::factory('2024-12-31'));
     $this->assertEquals($shouldBe[2], $week->getLocalizedShortString());
 }