12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- declare(strict_types=1);
- class LeapTest extends PHPUnit\Framework\TestCase
- {
- public static function setUpBeforeClass(): void
- {
- require_once 'Leap.php';
- }
- public function testLeapYear(): void
- {
- $this->assertTrue(isLeap(1996));
- }
- public function testNonLeapYear(): void
- {
- $this->assertFalse(isLeap(1997));
- }
- public function testNonLeapEvenYear(): void
- {
- $this->assertFalse(isLeap(1998));
- }
- public function testCentury(): void
- {
- $this->assertFalse(isLeap(1900));
- }
- public function testFourthCentury(): void
- {
- $this->assertTrue(isLeap(2400));
- }
- }
|