xref: /plugin/davcal/vendor/sabre/vobject/tests/VObject/Property/BooleanTest.php (revision a1a3b6794e0e143a4a8b51d3185ce2d339be61ab)
1*a1a3b679SAndreas Boehler<?php
2*a1a3b679SAndreas Boehler
3*a1a3b679SAndreas Boehlernamespace Sabre\VObject\Property;
4*a1a3b679SAndreas Boehler
5*a1a3b679SAndreas Boehleruse Sabre\VObject;
6*a1a3b679SAndreas Boehler
7*a1a3b679SAndreas Boehlerclass BooleanTest extends \PHPUnit_Framework_TestCase {
8*a1a3b679SAndreas Boehler
9*a1a3b679SAndreas Boehler    function testMimeDir() {
10*a1a3b679SAndreas Boehler
11*a1a3b679SAndreas Boehler        $input = "BEGIN:VCARD\r\nX-AWESOME;VALUE=BOOLEAN:TRUE\r\nX-SUCKS;VALUE=BOOLEAN:FALSE\r\nEND:VCARD\r\n";
12*a1a3b679SAndreas Boehler
13*a1a3b679SAndreas Boehler        $vcard = VObject\Reader::read($input);
14*a1a3b679SAndreas Boehler        $this->assertTrue($vcard->{'X-AWESOME'}->getValue());
15*a1a3b679SAndreas Boehler        $this->assertFalse($vcard->{'X-SUCKS'}->getValue());
16*a1a3b679SAndreas Boehler
17*a1a3b679SAndreas Boehler        $this->assertEquals('BOOLEAN', $vcard->{'X-AWESOME'}->getValueType());
18*a1a3b679SAndreas Boehler        $this->assertEquals($input, $vcard->serialize());
19*a1a3b679SAndreas Boehler
20*a1a3b679SAndreas Boehler    }
21*a1a3b679SAndreas Boehler
22*a1a3b679SAndreas Boehler}
23