FacilityTest::setUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
namespace Tarioch\EveapiFetcherBundle\Tests\Functional\Api\Corp;
3
4
use Tarioch\EveapiFetcherBundle\Tests\Functional\AbstractFunctionalTestCase;
5
use Tarioch\EveapiFetcherBundle\Entity\ApiCall;
6
use Tarioch\EveapiFetcherBundle\Entity\ApiKey;
7
use Tarioch\EveapiFetcherBundle\Entity\AccountCharacter;
8
use Tarioch\EveapiFetcherBundle\Component\EveApi\Corp\FacilityUpdater;
9
use Pheal\Pheal;
10
11
class FacilityTest extends AbstractFunctionalTestCase
12
{
13
    private $api;
14
    private $pheal;
15
16
    public function testUpdate()
17
    {
18
        $key = new ApiKey(123, 'dummyvcode');
19
        $owner = new AccountCharacter($key, 123);
20
        $owner->setCorporationId(11);
21
        $call = new ApiCall('dummyapi', $owner, $key);
22
        $this->api->update($call, $key, $this->pheal);
23
        $this->entityManager->flush();
24
        $repo = $this->entityManager->getRepository('TariochEveapiFetcherBundle:CorpFacility');
25
        $facility = $repo->findOneByFacilityId(1);
26
        $this->assertEquals(2, $facility->getTypeId());
27
        $this->assertEquals('TypeName', $facility->getTypeName());
28
        $this->assertEquals(3, $facility->getSolarSystemId());
29
        $this->assertEquals('SolarSystemName', $facility->getSolarSystemName());
30
        $this->assertEquals(4, $facility->getRegionId());
31
        $this->assertEquals('RegionName', $facility->getRegionName());
32
        $this->assertEquals(5, $facility->getStarbaseModifier());
33
        $this->assertEquals(6, $facility->getTax());
34
    }
35
    
36
    public function setUp()
37
    {
38
        parent::setUp();
39
        $this->api = new FacilityUpdater($this->entityManager);
40
        $this->pheal = new Pheal(123, 'dummyvcode');
41
    }
42
}
43