Add ValidationHelperTest.php

This commit is contained in:
Alex Tselegidis 2023-03-23 08:05:08 +01:00
parent 5b4bc63314
commit c1fe38d076

View file

@ -0,0 +1,19 @@
<?php
namespace Unit\Helper;
use PHPUnit\Framework\TestCase;
require_once __DIR__ . '/../../../application/helpers/validation_helper.php';
class ValidationHelperTest extends TestCase {
public function testValidateDateTimeReturnsTrueOnValidValue()
{
$this->assertTrue(validate_datetime(date('Y-m-d H:i:s')));
}
public function testValidateDateTimeReturnsFalseOnInvalidValue()
{
$this->assertFalse(validate_datetime('invalid'));
}
}