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...
11
{
12
public function countryCodeProvider(): array
13
{
14
return [
15
['GB'],
16
['ES'],
17
['BA'],
18
['FR'],
19
];
20
}
21
22
/**
23
* @test
24
* @dataProvider countryCodeProvider
25
*/
26
public function itShouldReturnCountryCode(string $country): void
27
{
28
$countryVO = new CountryCode($country);
29
30
$this->assertSame($country, $countryVO->value());
31
}
32
33
public function invalidCountryCodeProvider(): array
34
{
35
return [
36
[$this->faker()->address],
37
[$this->faker()->numberBetween()]
38
];
39
}
40
41
/**
42
* @test
43
* @dataProvider invalidCountryCodeProvider
44
*/
45
public function itShouldThrowsException(string $data): 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.