ageByHoroscope() public static method

Returns age by horoscope info.
public static ageByHoroscope ( integer $year, integer $sign ) : integer | array
$year integer Year
$sign integer Sign
return integer | array Age
Beispiel #1
0
 /**
  * TimeTest::testAgeByHoroscop()
  *
  * @return void
  */
 public function testAgeByHoroscop()
 {
     $this->skipIf(PHP_SAPI === 'cli', 'Fix these tests');
     $is = $this->Time->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([date('Y') - 2000 - 1, date('Y') - 2000], $is);
     $is = $this->Time->ageByHoroscope(1991, ZodiacLib::SIGN_LIBRA);
     //pr($is);
     $this->assertEquals(date('Y') - 1991 - 1, $is);
     $is = $this->Time->ageByHoroscope(1986, ZodiacLib::SIGN_CAPRICORN);
     //pr($is);
     $this->assertEquals([date('Y') - 1986 - 1, date('Y') - 1986], $is);
     $is = $this->Time->ageByHoroscope(2000, ZodiacLib::SIGN_SCORPIO);
     //debug($is);
     $this->assertEquals(date('Y') - 2000 - 1, $is);
     //array(10, 11)
 }