Passed
Push — test ( e89324...128558 )
by Tom
04:08
created

PrefixTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testVerify() 0 7 1
A testFilterForDefault() 0 4 1
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines\Value;
6
7
use Ktomk\Pipelines\TestCase;
8
9
/**
10
 * Class PrefixTest
11
 *
12
 * @package Ktomk\Pipelines\Value
13
 * @covers \Ktomk\Pipelines\Value\Prefix
14
 */
15
class PrefixTest extends TestCase
16
{
17
    public function testVerify()
18
    {
19
        self::assertSame('foo', Prefix::verify('foo'));
20
21
        $this->expectException('UnexpectedValueException');
22
        $this->expectExceptionMessage('invalid prefix: "p"; a prefix is only lower-case letters with a minimum length of three characters');
23
        Prefix::verify('p');
24
    }
25
26
    public function testFilterForDefault()
27
    {
28
        self::assertSame(Prefix::DEFAULT_PREFIX, Prefix::filter());
29
        self::assertSame(Prefix::DEFAULT_PREFIX, Prefix::filter(null));
30
    }
31
}
32