Test Failed
Push — master ( dc6008...986ac7 )
by Michał
03:06
created

isSubscribedToKernelRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dziki\MonologSentryBundle\Tests\Unit\SubscribedProcessor;
6
7
use Dziki\MonologSentryBundle\SubscribedProcessor\BrowserDataAppending;
8
use Dziki\MonologSentryBundle\UserAgent\Parser;
9
use Dziki\MonologSentryBundle\UserAgent\UserAgent;
10
use PHPUnit\Framework\MockObject\MockObject;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\MockObject\MockObject was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use PHPUnit\Framework\TestCase;
0 ignored issues
show
Bug introduced by
The type PHPUnit\Framework\TestCase was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Symfony\Component\HttpKernel\KernelEvents;
13
14
class BrowserDataAppendingTest extends TestCase
15
{
16
    /**
17
     * @var BrowserDataAppending
18
     */
19
    protected $browserDataAppendingProcessor;
20
21
    public function setUp()
22
    {
23
        /** @var Parser|MockObject $parser */
24
        $parser = $this->createMock(Parser::class);
25
        $parser->method('parse')
0 ignored issues
show
Bug introduced by
The method method() does not exist on Dziki\MonologSentryBundle\UserAgent\Parser. ( Ignorable by Annotation )

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

25
        $parser->/** @scrutinizer ignore-call */ 
26
                 method('parse')

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
            ->willReturn(UserAgent::create('test', '1', 'Raspberry'));
27
28
        $this->browserDataAppendingProcessor = new BrowserDataAppending($parser);
29
    }
30
31
    /**
32
     * @test
33
     */
34
    public function isSubscribedToKernelRequest()
35
    {
36
        $subscribedEvents = BrowserDataAppending::getSubscribedEvents();
37
        $this->assertArrayHasKey(KernelEvents::REQUEST, $subscribedEvents);
38
        $this->assertSame('onKernelRequest', $subscribedEvents[KernelEvents::REQUEST]);
39
    }
40
}
41