Completed
Push — master ( a5a753...454108 )
by Wachter
07:05
created

TaskBuilderTest::testSetSystemKeyNotSupported()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace Task\TaskBundle\Unit\Builder;
4
5
use Task\Scheduler\TaskSchedulerInterface;
6
use Task\TaskBundle\Builder\NotSupportedMethodException;
7
use Task\TaskBundle\Builder\TaskBuilder;
8
use Task\TaskBundle\Entity\Task;
9
use Task\TaskInterface;
10
11
class TaskBuilderTest extends \PHPUnit_Framework_TestCase
12
{
13 View Code Duplication
    public function testSetSystemKey()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
    {
15
        $task = $this->prophesize(Task::class);
16
        $scheduler = $this->prophesize(TaskSchedulerInterface::class);
17
18
        $taskBuilder = new TaskBuilder($task->reveal(), $scheduler->reveal());
19
        $taskBuilder->setSystemKey('test');
20
21
        $task->setSystemKey('test')->shouldBeCalled();
22
    }
23
24 View Code Duplication
    public function testSetSystemKeyNotSupported()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $this->setExpectedException(NotSupportedMethodException::class);
27
28
        $task = $this->prophesize(TaskInterface::class);
29
        $scheduler = $this->prophesize(TaskSchedulerInterface::class);
30
31
        $taskBuilder = new TaskBuilder($task->reveal(), $scheduler->reveal());
32
        $taskBuilder->setSystemKey('test');
33
    }
34
}
35