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

ProxyMethodCallEventTest::testEvent()   A

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 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