Completed
Push — master ( a45cae...481637 )
by Daniel
39:55
created

testClearEntityManagerAfterTask()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of php-task library.
5
 *
6
 * (c) php-task
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Task\TaskBundle\Tests\Unit\EventListener;
13
14
use Doctrine\ORM\EntityManagerInterface;
15
use Task\Event\TaskExecutionEvent;
16
use Task\TaskBundle\EventListener\DoctrineTaskExecutionListener;
17
18
/**
19
 * Tests for class TaskExecutionListener.
20
 */
21
class TaskExecutionListenerTest extends \PHPUnit_Framework_TestCase
22
{
23
    public function testClearEntityManagerAfterTask()
24
    {
25
        $entityManager = $this->prophesize(EntityManagerInterface::class);
26
27
        $listener = new DoctrineTaskExecutionListener($entityManager->reveal());
28
        $listener->clearEntityManagerAfterTask($this->prophesize(TaskExecutionEvent::class)->reveal());
29
30
        $entityManager->clear()->shouldBeCalled();
31
    }
32
}
33