Code Duplication    Length = 16-16 lines in 2 locations

tests/Countries/Tests/Country/CountryMapperTest.php 1 location

@@ 10-25 (lines=16) @@
7
use GeoBase\Countries\Country\CountryMapper;
8
use PHPUnit\Framework\TestCase;
9
10
class CountryMapperTest extends TestCase
11
{
12
    public function testMapArrayToCollection()
13
    {
14
        $collection = (new CountryMapper())->mapArrayToCollection((new CountryLoader())->loadAllCountries());
15
        $this->assertGreaterThan(1, count($collection));
16
    }
17
18
    public function testMapArrayToEntity()
19
    {
20
        $countries = (new CountryLoader())->loadAllCountries();
21
        $entity = (new CountryMapper())->mapArrayToEntity($countries[0]);
22
        $this->assertInstanceOf(CountryEntity::class, $entity);
23
        $this->assertNotEmpty($entity->getCode());
24
    }
25
}
26

tests/Countries/Tests/Region/RegionMapperTest.php 1 location

@@ 10-25 (lines=16) @@
7
use GeoBase\Regions\Region\RegionMapper;
8
use PHPUnit\Framework\TestCase;
9
10
class RegionMapperTest extends TestCase
11
{
12
    public function testMapArrayToCollection()
13
    {
14
        $collection = (new RegionMapper())->mapArrayToCollection((new RegionLoader())->loadAllRegions());
15
        $this->assertGreaterThan(1, count($collection));
16
    }
17
18
    public function testMapArrayToEntity()
19
    {
20
        $regions = (new RegionLoader())->loadAllRegions();
21
        $entity = (new RegionMapper())->mapArrayToEntity($regions[0]);
22
        $this->assertInstanceOf(RegionEntity::class, $entity);
23
        $this->assertNotEmpty($entity->getCode());
24
    }
25
}
26