Create integration tests for "Bsn" rule

This commit is contained in:
William Espindola 2015-10-17 14:48:53 -03:00 committed by Henrique Moody
parent db8d8a04f5
commit f2083a58d7
3 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,10 @@
--FILE--
<?php
require 'vendor/autoload.php';
use Respect\Validation\Validator as v;
v::bsn()->check('612890053');
?>
--EXPECTF--

View file

@ -0,0 +1,16 @@
--FILE--
<?php
require 'vendor/autoload.php';
use Respect\Validation\Validator as v;
use Respect\Validation\Exceptions\BsnException;
try {
v::bsn()->check('acb');
} catch (BsnException $e) {
echo $e->getMainMessage();
}
?>
--EXPECTF--
"acb" must be a BSN

View file

@ -0,0 +1,16 @@
--FILE--
<?php
require 'vendor/autoload.php';
use Respect\Validation\Validator as v;
use Respect\Validation\Exceptions\BsnException;
try {
v::bsn()->check(null);
} catch (BsnException $e) {
echo $e->getMainMessage();
}
?>
--EXPECTF--
null must be a BSN