This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
10
{
11
public function localeProvider(): array
12
{
13
return [
14
['es_ES'],
15
['es_AR'],
16
['en_GB'],
17
['en_US'],
18
19
];
20
}
21
/**
22
* @test
23
* @dataProvider localeProvider
24
*/
25
public function itShouldReturnLocale(string $locale): void
26
{
27
$localeVO = new Locale($locale);
28
29
$this->assertSame($locale, $localeVO->value());
30
}
31
32
public function invalidLocaleProvider(): array
33
{
34
return [
35
[$this->faker()->address],
36
[$this->faker()->numberBetween()],
37
];
38
}
39
40
/**
41
* @test
42
* @dataProvider invalidLocaleProvider
43
*/
44
public function itShouldThrowsException(string $locale): void
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.