Exemplo n.º 1
0
/**
 * @param string $date
 * @return boolean
 */
function isThanksgiving($date)
{
    $queryDate = strtotime($date);
    // identify year of query date
    $year = date("Y", $queryDate);
    $thanksgiving = getThanksgiving($year);
    return $thanksgiving == $queryDate;
}
Exemplo n.º 2
0
 /**
  * @dataProvider values
  */
 public function testIsThanksgiving($input, $expectedOutput)
 {
     $result = isThanksgiving($input);
     $this->assertInternalType("bool", $result);
     $this->assertEquals($expectedOutput, $result, sprintf("Expecting %s to be %s", $input, date('c', getThanksgiving(date("Y", strtotime($input))))));
 }