Completed
Pull Request — master (#144)
by Markus
01:01
created

ContentLineTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testShortLinesAreNotFolded() 0 7 1
A testLongLinesAreFolder() 0 11 1
1
<?php
2
3
/*
4
 * This file is part of the eluceo/iCal package.
5
 *
6
 * (c) 2019 Markus Poerschke <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Eluceo\iCal\Test\Unit\Presentation;
13
14
use Eluceo\iCal\Presentation\Component;
15
use Eluceo\iCal\Presentation\ContentLine;
16
use PHPUnit\Framework\TestCase;
17
18
class ContentLineTest extends TestCase
19
{
20
    public function testShortLinesAreNotFolded()
21
    {
22
        $lineAsString = 'BEGIN:EVENT';
23
        $contentLine = ContentLine::fromString($lineAsString);
24
25
        self::assertSame($lineAsString, (string) $contentLine);
26
    }
27
28
    public function testLongLinesAreFolder()
29
    {
30
        $lineAsString = 'SOMEPROPERTY:somesuperduperlongvaluethatneedstoobefoldedbecauseitistoolongtobedisplayedinasingleline';
31
        $expected = implode(Component::LINE_SEPARATOR, [
32
            'SOMEPROPERTY:somesuperduperlongvaluethatneedstoobefoldedbecauseitistoolongt',
33
            ' obedisplayedinasingleline',
34
        ]);
35
36
        $contentLine = ContentLine::fromString($lineAsString);
37
        self::assertSame($expected, (string) $contentLine);
38
    }
39
}
40