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

TimeProfilerSubscriber::start()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
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
}