blob: 90eb5d2aa0bca2b7c809ac46f808f808e5ff94bd (
plain) (
blame)
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
36
37
38
39
40
41
42
43
44
|
<?php
namespace Sabre\VObject;
class ParameterTest extends \PHPUnit_Framework_TestCase {
function testSetup() {
$param = new Parameter('name','value');
$this->assertEquals('NAME',$param->name);
$this->assertEquals('value',$param->value);
$this->assertEquals('value',$param->getValue());
}
function testCastToString() {
$param = new Parameter('name','value');
$this->assertEquals('value',$param->__toString());
$this->assertEquals('value',(string)$param);
}
function testSerialize() {
$param = new Parameter('name','value');
$this->assertEquals('NAME=value',$param->serialize());
}
function testSerializeEmpty() {
$param = new Parameter('name',null);
$this->assertEquals('NAME',$param->serialize());
}
function testSerializeColon() {
$param = new Parameter('name','va:lue');
$this->assertEquals('NAME="va:lue"',$param->serialize());
}
}
|