LimitSubjectLengthTest::testPassSuccess()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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