Skip to content

Commit 5d1e410

Browse files
committed
Criação dos testes das funcções validateFormatoCpfCnpj e validateCpfCnpj
1 parent 6dbb712 commit 5d1e410

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/TestValidator.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,43 @@ public function testCnpjFormato()
7474
$this->assertTrue($incorrect->fails());
7575
}
7676

77+
78+
public function testCpfCnpj()
79+
{
80+
$correct = \Validator::make(
81+
['certo' => '53.084.587/0001-20'],
82+
['certo' => 'cpf-cnpj']
83+
);
84+
85+
$incorrect = \Validator::make(
86+
['errado' => '99800-1926'],
87+
['errado' => 'cpf-cnpj']
88+
);
89+
90+
$this->assertTrue($correct->passes());
91+
92+
$this->assertTrue($incorrect->fails());
93+
}
94+
95+
96+
public function testCpfCnpjFormato()
97+
{
98+
$correct = \Validator::make(
99+
['certo' => '094.050.986-59'],
100+
['certo' => 'formato-cpf-cnpj']
101+
);
102+
103+
$incorrect = \Validator::make(
104+
['errado' => '51.084.587/000120'],
105+
['errado' => 'formato-cpf-cnpj']
106+
);
107+
108+
$this->assertTrue($correct->passes());
109+
110+
$this->assertTrue($incorrect->fails());
111+
}
112+
113+
77114
public function testCnh()
78115
{
79116
$correct = \Validator::make(

0 commit comments

Comments
 (0)