pickles/tests/classes/DateTest.php
Josh Sherman 99a04865e8 Fixed existing tests
Just some small tweaks to get all of the tests passing again. Functionality changed and the tests were not kept up to date.
2013-12-26 15:01:05 -05:00

33 lines
641 B
PHP

<?php
require_once 'classes/Date.php';
require_once 'classes/Time.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')),
);
}
}
?>