mirror of
https://github.com/Respect/Validation.git
synced 2024-06-29 02:30:06 +02:00
Set timezone for tests that work with dates
This commit is contained in:
parent
f0d249346f
commit
c84020f7f1
|
@ -2,6 +2,8 @@
|
|||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
use Respect\Validation\Validator as v;
|
||||
|
||||
v::intType()->between(1, 42)->check(2);
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
use Respect\Validation\Validator as v;
|
||||
|
||||
v::MinimumAge(12)->assert(new DateTime('1999-10-12'));
|
||||
v::MinimumAge(12)->check(new DateTime('1999-10-12'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
--EXPECTF--
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
use Respect\Validation\Exceptions\MinimumAgeException;
|
||||
use Respect\Validation\Validator as v;
|
||||
|
||||
|
@ -13,4 +15,4 @@ try {
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
The age must be 12 years or more.
|
||||
The age must be 12 years or more.
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
use Respect\Validation\Validator as v;
|
||||
|
||||
v::MinimumAge(12, 'd/m/Y')->check('12/10/1999');
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<?php
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
use Respect\Validation\Exceptions\AllOfException;
|
||||
use Respect\Validation\Validator as v;
|
||||
|
||||
|
@ -13,4 +15,4 @@ try {
|
|||
|
||||
?>
|
||||
--EXPECTF--
|
||||
\-The age must be 12 years or more.
|
||||
\-The age must be 12 years or more.
|
||||
|
|
Loading…
Reference in a new issue