Completed
Push — master ( 6985c5...4b67cd )
by Gabriel
09:30 queued 06:59
created

CountryMapperTest::testMapArrayToCollection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace GeoBase\Countries\Tests\Country;
4
5
use GeoBase\Countries\Country\CountryEntity;
6
use GeoBase\Countries\Country\CountryLoader;
7
use GeoBase\Countries\Country\CountryMapper;
8
use PHPUnit\Framework\TestCase;
9
10 View Code Duplication
class CountryMapperTest extends TestCase
0 ignored issues
show
Duplication introduced by
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 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