diff options
author | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-10 17:26:44 -0700 |
commit | 0b02a6d123b2014705998c94ddf3d460948d3eac (patch) | |
tree | 78ff2cab9944a4f5ab3f80ec93cbe1120de90bb2 /vendor/sabre/vobject/tests/Sabre/VObject/Component/VCardTest.php | |
parent | 40b5b6e9d2da7ab65c8b4d38cdceac83a4d78deb (diff) | |
download | volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.gz volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.tar.bz2 volse-hubzilla-0b02a6d123b2014705998c94ddf3d460948d3eac.zip |
initial sabre upgrade (needs lots of work - to wit: authentication, redo the browser interface, and rework event export/import)
Diffstat (limited to 'vendor/sabre/vobject/tests/Sabre/VObject/Component/VCardTest.php')
-rw-r--r-- | vendor/sabre/vobject/tests/Sabre/VObject/Component/VCardTest.php | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/vendor/sabre/vobject/tests/Sabre/VObject/Component/VCardTest.php b/vendor/sabre/vobject/tests/Sabre/VObject/Component/VCardTest.php deleted file mode 100644 index 584a007d9..000000000 --- a/vendor/sabre/vobject/tests/Sabre/VObject/Component/VCardTest.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -namespace Sabre\VObject\Component; - -use Sabre\VObject; - -class VCardTest extends \PHPUnit_Framework_TestCase { - - /** - * @dataProvider validateData - */ - function testValidate($input, $expectedWarnings, $expectedRepairedOutput) { - - $vcard = VObject\Reader::read($input); - - $warnings = $vcard->validate(); - - $warnMsg = array(); - foreach($warnings as $warning) { - $warnMsg[] = $warning['message']; - } - - $this->assertEquals($expectedWarnings, $warnMsg); - - $vcard->validate(VObject\Component::REPAIR); - - $this->assertEquals( - $expectedRepairedOutput, - $vcard->serialize() - ); - - } - - public function validateData() { - - $tests = array(); - - // Correct - $tests[] = array( - "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:John Doe\r\nEND:VCARD\r\n", - array(), - "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:John Doe\r\nEND:VCARD\r\n", - ); - - // No VERSION - $tests[] = array( - "BEGIN:VCARD\r\nFN:John Doe\r\nEND:VCARD\r\n", - array( - 'The VERSION property must appear in the VCARD component exactly 1 time', - ), - "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:John Doe\r\nEND:VCARD\r\n", - ); - - // Unknown version - $tests[] = array( - "BEGIN:VCARD\r\nVERSION:2.2\r\nFN:John Doe\r\nEND:VCARD\r\n", - array( - 'Only vcard version 4.0 (RFC6350), version 3.0 (RFC2426) or version 2.1 (icm-vcard-2.1) are supported.', - ), - "BEGIN:VCARD\r\nVERSION:4.0\r\nFN:John Doe\r\nEND:VCARD\r\n", - ); - - // No FN - $tests[] = array( - "BEGIN:VCARD\r\nVERSION:4.0\r\nEND:VCARD\r\n", - array( - 'The FN property must appear in the VCARD component exactly 1 time', - ), - "BEGIN:VCARD\r\nVERSION:4.0\r\nEND:VCARD\r\n", - ); - // No FN, N fallback - $tests[] = array( - "BEGIN:VCARD\r\nVERSION:4.0\r\nN:Doe;John;;;;;\r\nEND:VCARD\r\n", - array( - 'The FN property must appear in the VCARD component exactly 1 time', - ), - "BEGIN:VCARD\r\nVERSION:4.0\r\nN:Doe;John;;;;;\r\nFN:John Doe\r\nEND:VCARD\r\n", - ); - // No FN, N fallback, no first name - $tests[] = array( - "BEGIN:VCARD\r\nVERSION:4.0\r\nN:Doe;;;;;;\r\nEND:VCARD\r\n", - array( - 'The FN property must appear in the VCARD component exactly 1 time', - ), - "BEGIN:VCARD\r\nVERSION:4.0\r\nN:Doe;;;;;;\r\nFN:Doe\r\nEND:VCARD\r\n", - ); - - // No FN, ORG fallback - $tests[] = array( - "BEGIN:VCARD\r\nVERSION:4.0\r\nORG:Acme Co.\r\nEND:VCARD\r\n", - array( - 'The FN property must appear in the VCARD component exactly 1 time', - ), - "BEGIN:VCARD\r\nVERSION:4.0\r\nORG:Acme Co.\r\nFN:Acme Co.\r\nEND:VCARD\r\n", - ); - return $tests; - - } - -} |