Skip to content

Commit fe39936

Browse files
committed
Set irrelevant parameters to null in tests
1 parent 91683bc commit fe39936

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/UniqueTranslationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function it_ignores_the_given_id()
164164
]);
165165

166166
$rules = [
167-
'slug' => "{$this->rule}:{$this->table},slug,{$model->id}",
167+
'slug' => "{$this->rule}:{$this->table},null,{$model->id}",
168168
'name' => UniqueTranslationRule::for($this->table)->ignore($model->id),
169169
];
170170

@@ -177,7 +177,7 @@ public function it_ignores_the_given_id()
177177
$this->assertEmpty($validation->errors()->keys());
178178

179179
$rules = [
180-
'slug.*' => "{$this->rule}:{$this->table},slug,{$model->id}",
180+
'slug.*' => "{$this->rule}:{$this->table},null,{$model->id}",
181181
'name.*' => UniqueTranslationRule::for($this->table)->ignore($model->id),
182182
];
183183

@@ -200,7 +200,7 @@ public function it_ignores_a_specific_attribute_with_the_given_value()
200200
]);
201201

202202
$rules = [
203-
'slug' => "{$this->rule}:{$this->table},slug,{$model->other_field},other_field",
203+
'slug' => "{$this->rule}:{$this->table},null,{$model->other_field},other_field",
204204
'name' => UniqueTranslationRule::for($this->table)->ignore($model->other_field, 'other_field'),
205205
];
206206

@@ -213,7 +213,7 @@ public function it_ignores_a_specific_attribute_with_the_given_value()
213213
$this->assertEmpty($validation->errors()->keys());
214214

215215
$rules = [
216-
'slug.*' => "{$this->rule}:{$this->table},slug,{$model->other_field},other_field",
216+
'slug.*' => "{$this->rule}:{$this->table},null,{$model->other_field},other_field",
217217
'name.*' => UniqueTranslationRule::for($this->table)->ignore($model->other_field, 'other_field'),
218218
];
219219

@@ -235,8 +235,8 @@ public function it_ignores_null_values()
235235
]);
236236

237237
$rules = [
238-
'slug' => "{$this->rule}:{$this->table},slug",
239-
'name' => UniqueTranslationRule::for($this->table, 'name'),
238+
'slug.*' => "{$this->rule}:{$this->table}",
239+
'name.*' => UniqueTranslationRule::for($this->table),
240240
];
241241

242242
$validation = Validator::make([

tests/WhereClauseTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function it_accepts_where_clause()
3030
]);
3131

3232
$rules = [
33-
'slug.*' => "{$this->rule}:{$this->table},slug,null,null,other_field,!foobar",
33+
'slug.*' => "{$this->rule}:{$this->table},null,null,null,other_field,!foobar",
3434
'name.*' => UniqueTranslationRule::for($this->table)->where('other_field', 'not foobar'),
3535
];
3636

@@ -53,7 +53,7 @@ public function it_accepts_where_not_clauses()
5353
]);
5454

5555
$rules = [
56-
'slug.*' => "{$this->rule}:{$this->table},slug,null,null,other_field,!foobar",
56+
'slug.*' => "{$this->rule}:{$this->table},null,null,null,other_field,!foobar",
5757
'name.*' => UniqueTranslationRule::for($this->table)->whereNot('other_field', 'foobar'),
5858
];
5959

@@ -76,7 +76,7 @@ public function it_accepts_where_null_clause()
7676
]);
7777

7878
$rules = [
79-
'slug.*' => "{$this->rule}:{$this->table},slug,null,null,other_field,NULL",
79+
'slug.*' => "{$this->rule}:{$this->table},null,null,null,other_field,NULL",
8080
'name.*' => UniqueTranslationRule::for($this->table)->whereNull('other_field'),
8181
];
8282

@@ -99,7 +99,7 @@ public function it_accepts_where_not_null_clause()
9999
]);
100100

101101
$rules = [
102-
'slug.*' => "{$this->rule}:{$this->table},slug,null,null,other_field,NOT_NULL",
102+
'slug.*' => "{$this->rule}:{$this->table},null,null,null,other_field,NOT_NULL",
103103
'name.*' => UniqueTranslationRule::for($this->table)->whereNotNull('other_field'),
104104
];
105105

0 commit comments

Comments
 (0)