Code Duplication    Length = 14-15 lines in 3 locations

src/Component/Translation/Tests/Model/TranslatableTest.php 3 locations

@@ 162-175 (lines=14) @@
159
        $this->translatable->removeTranslation($translation);
160
    }
161
162
    public function testTranslationWithSingleLocale()
163
    {
164
        $this->translatable->setLocales([$locale = 'fr_FR']);
165
166
        $translation = $this->createTranslationMock();
167
        $translation
168
            ->expects($this->any())
169
            ->method('getLocale')
170
            ->will($this->returnValue($locale));
171
172
        $this->translatable->addTranslation($translation);
173
174
        $this->assertSame($translation, $this->translatable->getTranslation());
175
    }
176
177
    public function testTranslationWithMultipleLocales()
178
    {
@@ 177-190 (lines=14) @@
174
        $this->assertSame($translation, $this->translatable->getTranslation());
175
    }
176
177
    public function testTranslationWithMultipleLocales()
178
    {
179
        $this->translatable->setLocales(['fr_FR', $locale = 'en_EN']);
180
181
        $translation = $this->createTranslationMock();
182
        $translation
183
            ->expects($this->any())
184
            ->method('getLocale')
185
            ->will($this->returnValue($locale));
186
187
        $this->translatable->addTranslation($translation);
188
189
        $this->assertSame($translation, $this->translatable->getTranslation());
190
    }
191
192
    public function testTranslationWithFallbackLocale()
193
    {
@@ 192-206 (lines=15) @@
189
        $this->assertSame($translation, $this->translatable->getTranslation());
190
    }
191
192
    public function testTranslationWithFallbackLocale()
193
    {
194
        $this->translatable->setLocales(['en_EN']);
195
        $this->translatable->setFallbackLocale($fallbackLocale = 'fr_FR');
196
197
        $translation = $this->createTranslationMock();
198
        $translation
199
            ->expects($this->any())
200
            ->method('getLocale')
201
            ->will($this->returnValue($fallbackLocale));
202
203
        $this->translatable->addTranslation($translation);
204
205
        $this->assertSame($translation, $this->translatable->getTranslation());
206
    }
207
208
    public function testTranslationCreated()
209
    {