Пример #1
0
 /**
  * TimeLibTest::testAgeByHoroscop()
  *
  * @return void
  */
 public function testAgeByHoroscop()
 {
     App::uses('ZodiacLib', 'Tools.Misc');
     $this->skipIf(php_sapi_name() === 'cli', 'Fix these tests');
     $is = TimeLib::ageByHoroscope(2000, ZodiacLib::SIGN_VIRGO);
     // between xxxx-08-24 and xxxx-09-23 the latter, otherwise the first:
     $this->assertEquals(date('Y') - 2000 - 1, $is);
     $this->assertEquals(array(date('Y') - 2000 - 1, date('Y') - 2000), $is);
     $is = TimeLib::ageByHoroscope(1991, ZodiacLib::SIGN_LIBRA);
     //pr($is);
     $this->assertEquals(date('Y') - 1991 - 1, $is);
     $is = TimeLib::ageByHoroscope(1986, ZodiacLib::SIGN_CAPRICORN);
     //pr($is);
     $this->assertEquals(array(date('Y') - 1986 - 1, date('Y') - 1986), $is);
     $is = TimeLib::ageByHoroscope(2000, ZodiacLib::SIGN_SCORPIO);
     //debug($is);
     $this->assertEquals(date('Y') - 2000 - 1, $is);
     //array(10, 11)
 }