Code Duplication    Length = 22-22 lines in 3 locations

tests/CaptainHook/Hook/Message/Validator/Rule/LimitSubjectLengthTest.php 1 location

@@ 14-35 (lines=22) @@
11
12
use CaptainHook\App\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

tests/CaptainHook/Hook/Message/Validator/Rule/MsgNotEmptyTest.php 1 location

@@ 14-35 (lines=22) @@
11
12
use CaptainHook\App\Git\CommitMessage;
13
14
class MsgNotEmptyTest extends \PHPUnit_Framework_TestCase
15
{
16
    /**
17
     * Tests MsgNotEmpty::pass
18
     */
19
    public function testPassSuccess()
20
    {
21
        $msg  = new CommitMessage('Foo bar');
22
        $rule = new MsgNotEmpty();
23
        $this->assertTrue($rule->pass($msg));
24
    }
25
26
    /**
27
     * Tests MsgNotEmpty::pass
28
     */
29
    public function testPassFail()
30
    {
31
        $msg  = new CommitMessage('');
32
        $rule = new MsgNotEmpty();
33
        $this->assertFalse($rule->pass($msg));
34
    }
35
}
36

tests/CaptainHook/Hook/Message/Validator/Rule/NoPeriodOnSubjectEndTest.php 1 location

@@ 14-35 (lines=22) @@
11
12
use CaptainHook\App\Git\CommitMessage;
13
14
class NoPeriodOnSubjectEndTest extends \PHPUnit_Framework_TestCase
15
{
16
    /**
17
     * Tests NoPeriodOnSubjectEnd::pass
18
     */
19
    public function testPassSuccess()
20
    {
21
        $msg  = new CommitMessage('Foo bar');
22
        $rule = new NoPeriodOnSubjectEnd();
23
        $this->assertTrue($rule->pass($msg));
24
    }
25
26
    /**
27
     * Tests NoPeriodOnSubjectEnd::pass
28
     */
29
    public function testPassFail()
30
    {
31
        $msg  = new CommitMessage('Foo bar.');
32
        $rule = new NoPeriodOnSubjectEnd();
33
        $this->assertFalse($rule->pass($msg));
34
    }
35
}
36