function testGetEra()
 {
     unset($GLOBALS['_Ethna_controller']);
     $tmp_ctl =& new Ethna_Controller();
     //  昭和63年
     $last_showa_t = mktime(0, 0, 0, 12, 31, 1988);
     $r = Ethna_Util::getEra($last_showa_t);
     $this->assertEqual('昭和', $r[0]);
     $this->assertEqual(63, $r[1]);
     //  平成元年
     $first_heisei_t = mktime(0, 0, 0, 1, 1, 1989);
     $r = Ethna_Util::getEra($first_heisei_t);
     $this->assertEqual('平成', $r[0]);
     $this->assertEqual(1, $r[1]);
 }
예제 #2
0
파일: UtilTest.php 프로젝트: t-f-m/ethna
 public function testGetEra()
 {
     unset($GLOBALS['_Ethna_controller']);
     // NOTE(chobie): Ethna_Utilは内部的にControllerを使う
     $controller = new Ethna_Controller_Dummy();
     //  昭和63年
     $last_showa_t = mktime(0, 0, 0, 12, 31, 1988);
     $r = Ethna_Util::getEra($last_showa_t);
     $this->assertEquals('昭和', $r[0]);
     $this->assertEquals(63, $r[1]);
     //  平成元年
     $first_heisei_t = mktime(0, 0, 0, 1, 1, 1989);
     $r = Ethna_Util::getEra($first_heisei_t);
     $this->assertEquals('平成', $r[0]);
     $this->assertEquals(1, $r[1]);
 }