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 ( ca53dd...8486bb )
by Christian
09:58
created

MatomoTrackerBlockServiceTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 22
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2
c 0
b 0
f 0
cc 1
eloc 15
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\MatomoBundle\Tests\Block\Service;
13
14
use Core23\MatomoBundle\Block\Service\MatomoTrackerBlockService;
15
use Sonata\BlockBundle\Block\BlockContext;
16
use Sonata\BlockBundle\Model\Block;
17
use Sonata\BlockBundle\Model\BlockInterface;
18
use Sonata\BlockBundle\Test\AbstractBlockServiceTestCase;
19
20
final class MatomoTrackerBlockServiceTest extends AbstractBlockServiceTestCase
21
{
22
    public function testExecute(): void
23
    {
24
        $block = new Block();
25
26
        $blockContext = new BlockContext($block, [
27
            'host'        => null,
28
            'site'        => null,
29
            'domaintitle' => false,
30
            'donottrack'  => false,
31
            'nocookies'   => false,
32
            'template'    => '@Core23Matomo/Block/block_matomo_tracker.html.twig',
33
        ]);
34
35
        $blockService = new MatomoTrackerBlockService('block.service', $this->templating);
36
        $blockService->execute($blockContext);
37
38
        $this->assertSame('@Core23Matomo/Block/block_matomo_tracker.html.twig', $this->templating->view);
39
40
        $this->assertSame($blockContext, $this->templating->parameters['context']);
41
        $this->assertInternalType('array', $this->templating->parameters['settings']);
42
        $this->assertInstanceOf(BlockInterface::class, $this->templating->parameters['block']);
43
    }
44
45
    public function testDefaultSettings(): void
46
    {
47
        $blockService = new MatomoTrackerBlockService('block.service', $this->templating);
48
        $blockContext = $this->getBlockContext($blockService);
49
50
        $this->assertSettings([
51
            'host'        => null,
52
            'site'        => null,
53
            'domaintitle' => false,
54
            'donottrack'  => false,
55
            'nocookies'   => false,
56
            'template'    => '@Core23Matomo/Block/block_matomo_tracker.html.twig',
57
        ], $blockContext);
58
    }
59
}
60