Passed
Push — master ( 21c505...12ca40 )
by Sebastian
02:34
created

LimitSubjectLengthTest::testPassSuccess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * This file is part of CaptainHook.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace sebastianfeldmann\CaptainHook\Hook\Message\Validator\Rule;
11
12
use sebastianfeldmann\CaptainHook\Git\CommitMessage;
13
14
class LimitSubjectLengthTest extends \PHPUnit_Framework_TestCase
15
{
16
    /**
17
     * Tests LimitSubjectLength::pass
18
     */
19
    public function testPassSuccess()
20
    {
21
        $msg  = new CommitMessage('Foo Bar');
22
        $rule = new LimitSubjectLength(10);
23
        $this->assertTrue($rule->pass($msg));
24
    }
25
26
    /**
27
     * Tests LimitSubjectLength::pass
28
     */
29
    public function testPassFail()
30
    {
31
        $msg  = new CommitMessage('Foo Bar Baz Fiz Baz');
32
        $rule = new LimitSubjectLength(10);
33
        $this->assertFalse($rule->pass($msg));
34
    }
35
}
36