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

ContentLineTest::testLongLinesAreFolder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
c 0
b 0
f 0
rs 9.9
nc 1
cc 1
nop 0
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