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 (#154)
by joseph
34:48
created

IndexedAutoIncrementFieldTraitTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Large\C\Entity\Fields\Traits\Numeric;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Interfaces\Numeric\IndexedAutoIncrementFieldInterface;
6
use EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\Numeric\IndexedAutoIncrementFieldTrait;
7
use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\AbstractTest;
8
use EdmondsCommerce\DoctrineStaticMeta\Tests\Large\C\Entity\Fields\Traits\AbstractFieldTraitTest;
9
10
/**
11
 * @large
12
 * @covers \EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\Traits\String\BusinessIdentifierCodeFieldTrait
13
 * @covers \EdmondsCommerce\DoctrineStaticMeta\Entity\Fields\FakerData\String\BusinessIdentifierCodeFakerData
14
 */
15
class IndexedAutoIncrementFieldTraitTest extends AbstractFieldTraitTest
16
{
17
    public const    WORK_DIR           = AbstractTest::VAR_PATH . '/' . self::TEST_TYPE_LARGE
18
                                         . '/IndexedAutoIncrementFieldTraitTest/';
19
    protected const TEST_FIELD_FQN     = IndexedAutoIncrementFieldTrait::class;
20
    protected const TEST_FIELD_PROP    = IndexedAutoIncrementFieldInterface::PROP_INDEXED_AUTO_INCREMENT;
21
    protected const TEST_FIELD_DEFAULT = IndexedAutoIncrementFieldInterface::DEFAULT_INDEXED_AUTO_INCREMENT;
22
    protected const HAS_SETTER         = false;
23
    protected const VALIDATES          = false;
24
25
    public function setUp()
26
    {
27
        parent::setup();
28
        $this->createDatabase();
29
    }
30
31
32
    /**
33
     * @test
34
     * @throws \Exception
35
     */
36
    public function createEntityWithField(): void
37
    {
38
        $this->persistThreeEntities();
39
        $loaded = $this->getRepositoryFactory()->getRepository($this->getEntityFqn())->findAll();
40
        list($entity1, $entity2, $entity3) = $loaded;
41
        $getter = $this->getGetter($entity1);
42
        self::assertTrue(\method_exists($entity1, $getter));
43
        $value1 = $entity1->$getter();
44
        $value2 = $entity2->$getter();
45
        $value3 = $entity3->$getter();
46
        self::assertInternalType('int', $value1);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertInternalType() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/3369 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

46
        /** @scrutinizer ignore-deprecated */ self::assertInternalType('int', $value1);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
47
        self::assertInternalType('int', $value2);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertInternalType() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/3369 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

47
        /** @scrutinizer ignore-deprecated */ self::assertInternalType('int', $value2);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
48
        self::assertInternalType('int', $value3);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertInternalType() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/3369 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

48
        /** @scrutinizer ignore-deprecated */ self::assertInternalType('int', $value3);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
49
        self::assertTrue($value2 > $value1);
50
        self::assertTrue($value3 > $value2);
51
    }
52
53
    private function persistThreeEntities(): void
54
    {
55
        $entity1 = $this->getEntity();
56
        $entity2 = $this->getEntity();
57
        $entity3 = $this->getEntity();
58
        $this->getEntitySaver()->save($entity1);
59
        $this->getEntitySaver()->save($entity2);
60
        $this->getEntitySaver()->save($entity3);
61
        $this->getEntityManager()->getUnitOfWork()->clear();
62
    }
63
}
64