2018-09-19 02:07:24 +02:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2019-02-09 11:44:33 +01:00
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-09-19 02:07:24 +02:00
|
|
|
require 'vendor/autoload.php';
|
|
|
|
|
|
|
|
use Respect\Validation\Validator as v;
|
|
|
|
|
2023-04-01 07:20:05 +02:00
|
|
|
exceptionMessage(static fn() => v::luhn()->check('2222400041240021'));
|
|
|
|
exceptionMessage(static fn() => v::not(v::luhn())->check('2223000048400011'));
|
|
|
|
exceptionFullMessage(static fn() => v::luhn()->assert('340316193809334'));
|
|
|
|
exceptionFullMessage(static fn() => v::not(v::luhn())->assert('6011000990139424'));
|
2018-09-19 02:07:24 +02:00
|
|
|
?>
|
2018-12-19 18:05:58 +01:00
|
|
|
--EXPECT--
|
2018-09-19 02:07:24 +02:00
|
|
|
"2222400041240021" must be a valid Luhn number
|
|
|
|
"2223000048400011" must not be a valid Luhn number
|
|
|
|
- "340316193809334" must be a valid Luhn number
|
|
|
|
- "6011000990139424" must not be a valid Luhn number
|