-
Notifications
You must be signed in to change notification settings - Fork 17
/
CpfTest.php
47 lines (42 loc) · 940 Bytes
/
CpfTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
use PHPUnit\Framework\TestCase;
use ValdeirPsr\PagSeguro\Validation\Validator;
class CpfTest extends TestCase
{
/**
* @dataProvider providerValid
* @test
*/
public function CheckValidArguments($input)
{
$v = Validator::cpf()->validate($input);
$this->assertTrue($v);
}
/**
* @dataProvider providerInvalid
* @test
*/
public function CheckInvalidArguments($input)
{
$v = Validator::cpf()->validate($input);
$this->assertFalse($v);
}
public function providerValid()
{
return [
["641.155.660-19"],
["64115566019"],
["641.155.66019"],
["641.15566019"],
];
}
public function providerInvalid()
{
return [
["641.155.660-20"],
["64115566020"],
["641.155.66020"],
["641.15566020"],
];
}
}