LimitSubjectLengthTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testPassSuccess() 0 6 1
A testPassFail() 0 6 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Hook\Message\Rule;
13
14
use SebastianFeldmann\Git\CommitMessage;
15
use PHPUnit\Framework\TestCase;
16
17
class LimitSubjectLengthTest extends TestCase
18
{
19
    public function testPassSuccess(): void
20
    {
21
        $msg  = new CommitMessage('Foo Bar');
22
        $rule = new LimitSubjectLength(10);
23
24
        $this->assertTrue($rule->pass($msg));
25
    }
26
27
    public function testPassFail(): void
28
    {
29
        $msg  = new CommitMessage('Foo Bar Baz Fiz Baz');
30
        $rule = new LimitSubjectLength(10);
31
32
        $this->assertFalse($rule->pass($msg));
33
    }
34
}
35