india-pincode-regex/tests/SimpleTest.php

20 lines
436 B
PHP
Raw Normal View History

2020-02-24 18:02:18 +00:00
<?php
use PIN\Validator as P;
use PHPUnit\Framework\TestCase;
class SimpleTest extends TestCase {
const PINS = ['244713', '560029', '560030'];
const INVALID_PINS = ['999999'];
public function testSamplePins() {
foreach(self::PINS as $pin) {
$this->assertTrue(P::validate($pin), "$pin should be valid");
}
foreach(self::INVALID_PINS as $pin) {
$this->assertFalse(P::validate($pin), "$pin should be invalid");
}
}
}