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
Push — master ( 0b4676...ecfcbd )
by joseph
17s queued 14s
created

entitiesCanBeJsonSerialised()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 9
c 2
b 0
f 1
nc 1
nop 0
dl 0
loc 11
rs 9.9666
1
<?php declare(strict_types=1);
2
3
namespace EdmondsCommerce\DoctrineStaticMeta\Tests\Medium\Entity\Traits;
4
5
use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\AbstractTest;
6
use EdmondsCommerce\DoctrineStaticMeta\Tests\Assets\TestCodeGenerator;
7
8
/**
9
 * @medium
10
 */
11
class JsonSerializableTraitTest extends AbstractTest
12
{
13
    public const  WORK_DIR        = self::VAR_PATH . '/' . self::TEST_TYPE_MEDIUM . '/JsonSerializableTraitTest';
14
    private const TEST_ENTITY_FQN = self::TEST_ENTITIES_ROOT_NAMESPACE .
15
                                    TestCodeGenerator::TEST_ENTITY_ALL_ARCHETYPE_FIELDS;
16
    protected static $buildOnce = true;
17
18
    public function setup()
19
    {
20
        parent::setUp();
21
        if (false === self::$built) {
22
            $this->getTestCodeGenerator()
23
                 ->copyTo(self::WORK_DIR);
24
            self::$built = true;
25
        }
26
        $this->setupCopiedWorkDir();
27
    }
28
29
    /**
30
     * @test
31
     *
32
     * @throws \EdmondsCommerce\DoctrineStaticMeta\Exception\DoctrineStaticMetaException
33
     * @throws \ErrorException
34
     * @throws \ReflectionException
35
     */
36
    public function entitiesCanBeJsonSerialised(): void
37
    {
38
        $entity     = $this->getTestEntityGeneratorFactory()
39
                           ->createForEntityFqn($this->getCopiedFqn(self::TEST_ENTITY_FQN))
40
                           ->generateEntity();
41
        $serialised = \ts\json_encode($entity);
42
        self::assertNotEmpty($serialised);
43
        $decoded = json_decode($serialised, true);
44
        self::assertNotEmpty($decoded);
45
        self::assertArrayHasKey('id', $decoded);
46
        self::assertCount(25, $decoded);
0 ignored issues
show
Bug introduced by
It seems like $decoded can also be of type ArrayAccess; however, parameter $haystack of PHPUnit\Framework\Assert::assertCount() does only seem to accept Countable|iterable, maybe add an additional type check? ( Ignorable by Annotation )

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

46
        self::assertCount(25, /** @scrutinizer ignore-type */ $decoded);
Loading history...
47
48
    }
49
}
50