mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 15:25:45 +01:00
30 lines
1,019 B
PHP
30 lines
1,019 B
PHP
<?php
|
|
|
|
/*
|
|
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once 'vendor/autoload.php';
|
|
|
|
test('Scenario #1', catchMessage(
|
|
fn() => v::nip()->assert('1645865778'),
|
|
fn(string $message) => expect($message)->toBe('"1645865778" must be a valid Polish VAT identification number'),
|
|
));
|
|
|
|
test('Scenario #2', catchMessage(
|
|
fn() => v::not(v::nip())->assert('1645865777'),
|
|
fn(string $message) => expect($message)->toBe('"1645865777" must not be a valid Polish VAT identification number'),
|
|
));
|
|
|
|
test('Scenario #3', catchFullMessage(
|
|
fn() => v::nip()->assert('1645865778'),
|
|
fn(string $fullMessage) => expect($fullMessage)->toBe('- "1645865778" must be a valid Polish VAT identification number'),
|
|
));
|
|
|
|
test('Scenario #4', catchFullMessage(
|
|
fn() => v::not(v::nip())->assert('1645865777'),
|
|
fn(string $fullMessage) => expect($fullMessage)->toBe('- "1645865777" must not be a valid Polish VAT identification number'),
|
|
));
|