Passed
Push — master ( 7bc6a4...bace86 )
by Dmitriy
06:54 queued 04:27
created

ProxyMethodCallEventTest   A

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 Yiisoft\Yii\Debug\Event\ProxyMethodCallEvent;
9
10
class ProxyMethodCallEventTest extends TestCase
11
{
12
    public function testEvent(): void
13
    {
14
        $time = microtime(true);
15
        $event = new ProxyMethodCallEvent(
16
            'test',
17
            \stdClass::class,
18
            'test',
19
            [],
20
            true,
21
            'success',
22
            null,
23
            $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

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