TagBagTest::testBadTagValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace JobQueue\Tests\Domain\Task;
4
5
use JobQueue\Domain\Task\Profile;
6
use JobQueue\Domain\Task\Task;
7
use JobQueue\Tests\Domain\Job;
8
use PHPUnit\Framework\TestCase;
9
10
final class TagBagTest extends TestCase
11
{
12
    public function testBadTagValue()
13
    {
14
        $this->expectExceptionMessage('Tag value must be a string');
15
16
        new Task(
17
            new Profile('test'),
18
            new Job\DummyJob,
19
            [],
20
            [
21
                'foo',
22
                'bar',
23
                null,
24
            ]
25
        );
26
    }
27
28
    public function testHasTag()
29
    {
30
        $task = new Task(
31
            new Profile('test'),
32
            new Job\DummyJob,
33
            [],
34
            [
35
                'foo',
36
                'bar',
37
            ]
38
        );
39
40
        $this->assertTrue($task->hasTag('foo'));
41
    }
42
43
    public function testDoesNotHaveTag()
44
    {
45
        $task = new Task(
46
            new Profile('test'),
47
            new Job\DummyJob,
48
            [],
49
            [
50
                'bar',
51
            ]
52
        );
53
54
        $this->assertFalse($task->hasTag('foo'));
55
    }
56
}
57