Skip to content

Commit d781570

Browse files
committed
Test case insensitive search
1 parent 07fd050 commit d781570

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/UniqueTranslationTest.php

+21
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@ public function it_checks_if_the_translation_for_the_current_locale_is_unique()
4545
$this->assertTrue($validation->passes());
4646
}
4747

48+
/** @test */
49+
public function search_is_case_insensitive()
50+
{
51+
Model::create([
52+
'slug' => ['en' => 'existing-slug-en', 'nl' => 'existing-slug-nl'],
53+
'name' => ['en' => 'existing-name-en', 'nl' => 'existing-name-nl'],
54+
]);
55+
56+
$rules = [
57+
'slug' => "{$this->rule}:{$this->table}",
58+
'name' => UniqueTranslationRule::for($this->table),
59+
];
60+
61+
$validation = Validator::make([
62+
'slug' => 'Existing-slug-en',
63+
'name' => 'Existing-name-en',
64+
], $rules);
65+
66+
$this->assertTrue($validation->fails());
67+
}
68+
4869
/** @test */
4970
public function it_checks_if_the_translation_for_a_specific_locale_is_unique()
5071
{

0 commit comments

Comments
 (0)