@@ 166-175 (lines=10) @@ | ||
163 | $this->assertSame('France', $result[1]->name); |
|
164 | } |
|
165 | ||
166 | public function test_whereTranslation_filters_by_translation_and_locale() |
|
167 | { |
|
168 | Country::create(['code' => 'some-code', 'name' => 'Griechenland']); |
|
169 | ||
170 | $this->assertSame(2, Country::whereTranslation('name', 'Griechenland')->count()); |
|
171 | ||
172 | $result = Country::whereTranslation('name', 'Griechenland', 'de')->get(); |
|
173 | $this->assertSame(1, $result->count()); |
|
174 | $this->assertSame('gr', $result->first()->code); |
|
175 | } |
|
176 | ||
177 | public function test_whereTranslationLike_filters_by_translation() |
|
178 | { |
|
@@ 192-201 (lines=10) @@ | ||
189 | $this->assertSame('France', $result[1]->name); |
|
190 | } |
|
191 | ||
192 | public function test_whereTranslationLike_filters_by_translation_and_locale() |
|
193 | { |
|
194 | Country::create(['code' => 'some-code', 'name' => 'Griechenland']); |
|
195 | ||
196 | $this->assertSame(2, Country::whereTranslationLike('name', 'Griechen%')->count()); |
|
197 | ||
198 | $result = Country::whereTranslationLike('name', '%riechenlan%', 'de')->get(); |
|
199 | $this->assertSame(1, $result->count()); |
|
200 | $this->assertSame('gr', $result->first()->code); |
|
201 | } |
|
202 | ||
203 | public function test_orderByTranslation_sorts_by_key_asc() |
|
204 | { |