Skip to content

Commit 603caa8

Browse files
committed
add username_is_not_valid test
1 parent 285a322 commit 603caa8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/ValidUsernameTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,19 @@ public function username_is_valid()
3030

3131
$this->assertTrue($passes);
3232
}
33+
34+
/**
35+
* Test username is not valid.
36+
*
37+
* @test
38+
* @return void
39+
*/
40+
public function username_is_not_valid()
41+
{
42+
$rules = ['username' => [new ValidUsername()]];
43+
$data = ['username' => 'milwad!@!'];
44+
$passes = $this->app['validator']->make($data, $rules)->passes();
45+
46+
$this->assertFalse($passes);
47+
}
3348
}

0 commit comments

Comments
 (0)