ProxyMethodCallEventTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testEvent() 0 18 1
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