mirror of
https://github.com/Respect/Validation.git
synced 2024-06-29 02:30:06 +02:00
Create integration tests for "Bsn" rule
This commit is contained in:
parent
db8d8a04f5
commit
f2083a58d7
10
tests/integration/bsn_1.phpt
Normal file
10
tests/integration/bsn_1.phpt
Normal file
|
@ -0,0 +1,10 @@
|
|||
--FILE--
|
||||
<?php
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use Respect\Validation\Validator as v;
|
||||
|
||||
v::bsn()->check('612890053');
|
||||
?>
|
||||
--EXPECTF--
|
16
tests/integration/bsn_2.phpt
Normal file
16
tests/integration/bsn_2.phpt
Normal 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
|
16
tests/integration/bsn_3.phpt
Normal file
16
tests/integration/bsn_3.phpt
Normal 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
|
Loading…
Reference in a new issue