ProxyMethodCallEventTest::testEvent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
nc 1
nop 0
dl 0
loc 18
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Tests\Unit\Event;
6
7
use PHPUnit\Framework\TestCase;
8
use stdClass;
9
use Yiisoft\Yii\Debug\Event\ProxyMethodCallEvent;
10
11
class ProxyMethodCallEventTest extends TestCase
12
{
13
    public function testEvent(): void
14
    {
15
        $time = microtime(true);
16
        $event = new ProxyMethodCallEvent(
17
            'test',
18
            stdClass::class,
19
            'test',
20
            [],
21
            true,
22
            'success',
23
            null,
24
            $time,
0 ignored issues
show
Bug introduced by
It seems like $time can also be of type string; however, parameter $timeStart of Yiisoft\Yii\Debug\Event\...allEvent::__construct() does only seem to accept double, 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

24
            /** @scrutinizer ignore-type */ $time,
Loading history...
25
            $time + 1
26
        );
27
28
        $this->assertEquals($time, $event->timeStart);
29
        $this->assertEquals($time + 1, $event->timeEnd);
30
        $this->assertEquals(stdClass::class, $event->class);
31
    }
32
}
33