Skip to content

Commit c824307

Browse files
committed
Test for Iran license plate
1 parent 6ff5f5d commit c824307

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/Rules/ValidIranPlateTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Milwad\LaravelValidate\Tests\Rules;
4+
5+
use Milwad\LaravelValidate\Rules\ValidIranPlate;
6+
use Milwad\LaravelValidate\Tests\TestCase;
7+
8+
class ValidIranPlateTest extends TestCase
9+
{
10+
/**
11+
* Test iran license plate is valid.
12+
*/
13+
public function test_iran_plate_is_valid()
14+
{
15+
$rules = ['car_number' => [new ValidIranPlate]];
16+
$data = ['car_number' => '32 ی 321 ایران 45'];
17+
$passes = $this->app['validator']->make($data, $rules)->passes();
18+
19+
$this->assertTrue($passes);
20+
}
21+
22+
/**
23+
* Test iran license plate is not valid.
24+
*/
25+
public function test_iran_plate_is_not_valid()
26+
{
27+
$rules = ['car_number' => [new ValidIranPlate]];
28+
$data = ['car_number' => '32 ی 321 ترکیه 45'];
29+
$passes = $this->app['validator']->make($data, $rules)->passes();
30+
31+
$this->assertFalse($passes);
32+
}
33+
}

0 commit comments

Comments
 (0)