Completed
Pull Request — master (#144)
by Markus
02:39 queued 01:41
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
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