annotate vendor/sabre/vobject/tests/VObject/Property/FloatTest.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject\Property;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 use Sabre\VObject;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 class FloatTest extends \PHPUnit_Framework_TestCase {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 function testMimeDir() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11 $input = "BEGIN:VCARD\r\nVERSION:4.0\r\nX-FLOAT;VALUE=FLOAT:0.234;1.245\r\nEND:VCARD\r\n";
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12 $mimeDir = new VObject\Parser\MimeDir($input);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 $result = $mimeDir->parse($input);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 $this->assertInstanceOf('Sabre\VObject\Property\Float', $result->{'X-FLOAT'});
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 $this->assertEquals(array(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19 0.234,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 1.245,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21 ), $result->{'X-FLOAT'}->getParts());
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24 $input,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25 $result->serialize()
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30 }