GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#58)
by joseph
18:31
created

HasMoneyEmbeddableTraitFunctionalTest::setup()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Traits\Financial;
4
5
use EdmondsCommerce\DoctrineStaticMeta\AbstractFunctionalTest;
6
use EdmondsCommerce\DoctrineStaticMeta\AbstractIntegrationTest;
7
use EdmondsCommerce\DoctrineStaticMeta\Entity\Embeddable\Interfaces\Objects\Financial\MoneyEmbeddableInterface;
8
use Money\Currency;
9
use Money\Money;
10
11
class HasMoneyEmbeddableTraitFunctionalTest extends AbstractFunctionalTest
12
{
13
    public const WORK_DIR = AbstractIntegrationTest::VAR_PATH.'/'.self::TEST_TYPE.'/HasMoneyEmbeddableTraitTest';
14
15
    private const TEST_ENTITY = self::TEST_PROJECT_ROOT_NAMESPACE.'\\Entities\\BankAccount';
16
17
    private $entityFqn;
18
19
    public function setup()
20
    {
21
        parent::setup();
22
        $this->getEntityGenerator()->generateEntity(self::TEST_ENTITY);
23
        $this->getEntityEmbeddableSetter()
24
             ->setEntityHasEmbeddable(self::TEST_ENTITY, HasMoneyEmbeddableTrait::class);
25
        $this->setupCopiedWorkDirAndCreateDatabase();
26
        $this->entityFqn = $this->getCopiedFqn(self::TEST_ENTITY);
27
    }
28
29
    /**
30
     * @test
31
     * @large
32
     * @throws \EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException
33
     * @throws \ReflectionException
34
     */
35
    public function theEntityCanBeSavedAndLoadedWithCorrectValues()
36
    {
37
        $entity = new $this->entityFqn;
38
        $entity->getMoneyEmbeddable()
39
               ->setMoney(new Money(
40
                   100,
41
                   new Currency(MoneyEmbeddableInterface::DEFAULT_CURRENCY_CODE)
42
               ));
43
        $this->getEntitySaver()->save($entity);
44
45
        $loaded   = $this->getEntityManager()->getRepository($this->entityFqn)->findAll()[0];
46
        $expected = '100';
47
        $actual   = $loaded->getMoneyEmbeddable()->getMoney()->getAmount();
48
        $this->assertSame($expected, $actual);
49
    }
50
}
51