pickles/tests/classes/DateTest.php
Joshua Sherman 7f37abc527 Cleaned up test includes a bit
Probably want to include an autoloader at some point. Also added PHP 5.3 and 5.4 to the test list, 5.3 outta fail, unsure about 5.4
2013-12-29 13:16:21 -05:00

30 lines
574 B
PHP

<?php
class DateTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider providerAge
*/
public function testAge($a, $b)
{
$this->assertEquals(Date::age($a), $b);
}
public function providerAge()
{
ini_set('date.timezone', 'America/New_York');
$time = strtotime('-25 years');
return array(
array(date('Y-m-d', $time), '25'),
array(date('m/d/Y', $time), '25'),
array(date('r', $time), '25'),
array('today', '0'),
array('400 days ago', '1'),
array(true, Date::age('1969-12-31')),
);
}
}
?>