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

TaskExecutionListenerTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testClearEntityManagerAfterTask() 0 9 1
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