summaryrefslogtreecommitdiff
path: root/vendor/eluceo/ical/tests/Eluceo/iCal/ParameterBagTest.php
blob: 0fb6e84cfd13381e910d2775643eba4b20759c01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

namespace Eluceo\iCal;

class ParameterBagTest extends \PHPUnit_Framework_TestCase
{
    public function testEscapeParamValue()
    {
        $propertyObject = new ParameterBag;

        $this->assertEquals(
            'test string',
            $propertyObject->escapeParamValue('test string'),
            'No escaping necessary'
        );

        $this->assertEquals(
            '"Containing \\"double-quotes\\""',
            $propertyObject->escapeParamValue('Containing "double-quotes"'),
            'Text contains double quotes'
        );

        $this->assertEquals(
            '"Containing forbidden chars like a ;"',
            $propertyObject->escapeParamValue('Containing forbidden chars like a ;'),
            'Text with semicolon'
        );

        $this->assertEquals(
            '"Containing forbidden chars like a :"',
            $propertyObject->escapeParamValue('Containing forbidden chars like a :'),
            'Text with colon'
        );
    }
}