Completed
Pull Request — master (#144)
by Markus
02:45 queued 01:47
created

ContentLineTest::testShortLinesAreNotFolded()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 10
nc 1
cc 1
nop 0
1
<?php
2
3
namespace Eluceo\iCal\Test\Unit\Presentation;
4
5
use Eluceo\iCal\Presentation\Component;
6
use Eluceo\iCal\Presentation\ContentLine;
7
use PHPUnit\Framework\TestCase;
8
9
class ContentLineTest extends TestCase
10
{
11
    public function testShortLinesAreNotFolded()
12
    {
13
        $lineAsString = 'BEGIN:EVENT';
14
        $contentLine = ContentLine::fromString($lineAsString);
15
16
        self::assertSame($lineAsString, (string)$contentLine);
17
    }
18
19
    public function testLongLinesAreFolder()
20
    {
21
        $lineAsString = 'SOMEPROPERTY:somesuperduperlongvaluethatneedstoobefoldedbecauseitistoolongtobedisplayedinasingleline';
22
        $expected = implode(Component::LINE_SEPARATOR, [
23
            'SOMEPROPERTY:somesuperduperlongvaluethatneedstoobefoldedbecauseitistoolongt',
24
            ' obedisplayedinasingleline',
25
        ]);
26
27
        $contentLine = ContentLine::fromString($lineAsString);
28
        self::assertSame($expected, (string)$contentLine);
29
    }
30
}
31