Example #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;
}
 /**
  * @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))))));
 }