|
@@ 128-137 (lines=10) @@
|
| 125 |
|
$this->assertSame('France', $result[1]->name); |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
public function test_whereTranslation_filters_by_translation_and_locale() |
| 129 |
|
{ |
| 130 |
|
Country::create(['code' => 'some-code', 'name' => 'Griechenland']); |
| 131 |
|
|
| 132 |
|
$this->assertSame(2, Country::whereTranslation('name', 'Griechenland')->count()); |
| 133 |
|
|
| 134 |
|
$result = Country::whereTranslation('name', 'Griechenland', 'de')->get(); |
| 135 |
|
$this->assertSame(1, $result->count()); |
| 136 |
|
$this->assertSame('gr', $result->first()->code); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
public function test_whereTranslationLike_filters_by_translation() |
| 140 |
|
{ |
|
@@ 154-163 (lines=10) @@
|
| 151 |
|
$this->assertSame('France', $result[1]->name); |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
public function test_whereTranslationLike_filters_by_translation_and_locale() |
| 155 |
|
{ |
| 156 |
|
Country::create(['code' => 'some-code', 'name' => 'Griechenland']); |
| 157 |
|
|
| 158 |
|
$this->assertSame(2, Country::whereTranslationLike('name', 'Griechen%')->count()); |
| 159 |
|
|
| 160 |
|
$result = Country::whereTranslationLike('name', '%riechenlan%', 'de')->get(); |
| 161 |
|
$this->assertSame(1, $result->count()); |
| 162 |
|
$this->assertSame('gr', $result->first()->code); |
| 163 |
|
} |
| 164 |
|
} |
| 165 |
|
|