Passed
Push — master ( 3c0ece...f29cb0 )
by Dzmitry
05:09 queued 02:33
created

TimeProfilerSubscriber::getProfiledTimestamp()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
namespace ivol\tests;
3
4
use ivol\EventDispatcher\AfterExecuteEvent;
5
use ivol\EventDispatcher\BeforeExecuteEvent;
6
use ivol\ExecutionContext;
7
use ivol\ExecutionWrapper;
8
use ivol\tests\Helper\TimeProfilerSubscriber;
9
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
10
11
class ExecutionWrapperIntegrationTest extends \PHPUnit_Framework_TestCase
12
{
13
    public function testExecuteSubscriber()
14
    {
15
        $sut = new ExecutionWrapper();
16
        $profiler = new TimeProfilerSubscriber();
17
        $sut->getEventDispatcher()->addSubscriber($profiler);
18
19
        $sut->exec('echo %s', array("'123'"));
20
21
        $this->assertTrue($profiler->getProfiledTimestamp() > 0);
22
    }
23
}