Skip to content

Commit a62510e

Browse files
committed
add test
1 parent de35bf2 commit a62510e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Validation/ValidationValidatorTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,6 +2158,17 @@ public function testValidateStartsWith()
21582158
$this->assertSame('The url must start with one of the following values http, https', $v->messages()->first('url'));
21592159
}
21602160

2161+
public function testValidateDoesntStartWith()
2162+
{
2163+
$trans = $this->getIlluminateArrayTranslator();
2164+
$v = new Validator($trans, ['x' => 'world hello'], ['x' => 'doesnt_start_with:hello']);
2165+
$this->assertTrue($v->passes());
2166+
2167+
$trans = $this->getIlluminateArrayTranslator();
2168+
$v = new Validator($trans, ['x' => 'hello world'], ['x' => 'doesnt_start_with:hello']);
2169+
$this->assertFalse($v->passes());
2170+
}
2171+
21612172
public function testValidateString()
21622173
{
21632174
$trans = $this->getIlluminateArrayTranslator();

0 commit comments

Comments
 (0)