php-randomdate/tests/RandomDateTest.php
Josh Sherman 69c4a24301
feat: initial commit
Basic functionality and tests and all that.
2020-05-12 22:28:19 -05:00

20 lines
463 B
PHP

<?php
require_once './src/RandomDate.php';
if (
!class_exists('\PHPUnit_Framework_TestCase')
&& class_exists('\PHPUnit\Framework\TestCase')
) {
class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
}
class RandomDateTest extends PHPUnit_Framework_TestCase
{
public function testDate()
{
$rd = new joshtronic\RandomDate();
$this->assertRegExp('/^[0-9]{4}(-[0-9]{2}){2}$/i', $rd->date('Y-m-d'));
}
}