1 | <?php |
||
17 | class AgeCalculatorTest extends \PHPUnit_Framework_TestCase |
||
18 | { |
||
19 | /** |
||
20 | * @var string $today Timestamp that will be returned by date() |
||
21 | */ |
||
22 | public static $today; |
||
23 | |||
24 | private $assert; |
||
25 | private $minDay = 1; |
||
26 | private $maxDay; |
||
27 | private $minMonth = 1; |
||
28 | private $maxMonth = 12; |
||
29 | private $actualMonth; |
||
30 | private $actualDay; |
||
31 | private $birthYear = 2000; |
||
32 | private $calculator; |
||
33 | |||
34 | public function __construct() |
||
41 | |||
42 | public function testEarlyYear() |
||
46 | |||
47 | public function testSameMonth() |
||
51 | |||
52 | public function testEndOfTheYear() |
||
56 | |||
57 | public function testSameMonthAndLastDay() |
||
61 | |||
62 | public function testFirstDayOfTheYear() |
||
66 | |||
67 | /** |
||
68 | * @param integer $day |
||
69 | */ |
||
70 | private function assertEqualsForAge($month, $day, $beforeBirthday = FALSE) |
||
85 | |||
86 | /** |
||
87 | * @expectedException InvalidArgumentException |
||
88 | */ |
||
89 | public function testBadFormat() |
||
93 | |||
94 | /** |
||
95 | * @expectedException InvalidArgumentException |
||
96 | */ |
||
97 | public function testBadDate() |
||
101 | } |
||
102 |