ExtractorTest::testExtractMultilineNotification()   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
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
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\Notify;
13
14
use PHPUnit\Framework\TestCase;
15
16
class ExtractorTest extends TestCase
17
{
18
    public function testExtractMultilineNotification()
19
    {
20
        $message = 'Foo' . PHP_EOL . 'git-notify: FIZ' . PHP_EOL . 'baz' . PHP_EOL . 'biz';
21
22
        $notification = Extractor::extractNotification($message);
23
        $this->assertEquals(3, $notification->length());
24
    }
25
26
    public function testExtractNotificationWithoutPrefix()
27
    {
28
        $message = 'Foo' . PHP_EOL . 'bar';
29
30
        $notification = Extractor::extractNotification($message);
31
        $this->assertEquals(0, $notification->length());
32
    }
33
}
34