svn: /pear/packages/File_IMC/trunk/tests/ File_IMC_BugsTest.php
| From: | Till Klampaeckel | Date: | Fri, 11 Mar 2011 15:59:11 +0000 |
| Subject: | svn: /pear/packages/File_IMC/trunk/tests/ File_IMC_BugsTest.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-61397@lists.php.net to get a copy of this message | ||
till Fri, 11 Mar 2011 15:59:11 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=309116
Log:
* test case for bugs
Changed paths:
A + pear/packages/File_IMC/trunk/tests/File_IMC_BugsTest.php
(from pear/packages/File_IMC/trunk/tests/File_IMC_ParseTest.php:r309115)
Copied: pear/packages/File_IMC/trunk/tests/File_IMC_BugsTest.php (from rev 309115,
pear/packages/File_IMC/trunk/tests/File_IMC_ParseTest.php)
===================================================================
--- pear/packages/File_IMC/trunk/tests/File_IMC_BugsTest.php (rev 0)
+++ pear/packages/File_IMC/trunk/tests/File_IMC_BugsTest.php 2011-03-11 15:59:11 UTC (rev 309116)
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Parse vCard 2.1 and 3.0 text blocks.
+ *
+ * PHP versions 5
+ *
+ * LICENSE: This source file is subject to version 2.0 of the PHP license
+ * that is available through the world-wide-web at the following URI:
+ * http://www.php.net/license/2_02.txt. If you
did not receive a copy of
+ * the PHP License and are unable to obtain it through the world-wide-web, please
+ * send a note to license@php.net so we can mail you a copy immediately.
+ *
+ * @category File_Formats
+ * @package File_IMC
+ * @author Till Klampaeckel <till@php.net>
+ * @license http://www.opensource.org/licenses/bsd-license.php
The BSD License
+ * @version SVN: $Id$
+ * @link http://pear.php.net/package/File_IMC
+ */
+
+/**
+ * PHPUnit_Framework_TestCase
+ * @ignore
+ */
+require_once 'PHPUnit/Framework/TestCase.php';
+
+/**
+ * File_IMC
+ */
+require_once "File/IMC.php";
+
+/**
+ * Tests to verify bugs in File_IMC stay fixed.
+ *
+ * @category File_Formats
+ * @package File_IMC
+ * @author Till Klampaeckel <till@php.net>
+ * @license http://www.opensource.org/licenses/bsd-license.php
The BSD License
+ * @version Release: @package_version@
+ * @link http://pear.php.net/package/File_IMC
+ */
+class File_IMC_BugsTest extends PHPUnit_Framework_TestCase
+{
+ public function testBug17656()
+ {
+ $buf = 'BEGIN:VCALENDAR
+METHOD:REQUEST
+BEGIN:VEVENT
+ATTENDEE;CN="Sky A Stebnicki (email@example.org)";RSVP=TRUE:mailto:email@example.org
+CLASS:PUBLIC
+CREATED:20100804T193456Z
+DESCRIPTION:This\n\nIs\n\nMy\n\nNotes\n\nTRE\n
+DTEND;TZID="Pacific Standard Time":20100804T113000
+DTSTAMP:20100804T193456Z
+DTSTART;TZID="Pacific Standard Time":20100804T110000
+LAST-MODIFIED:20100804T193456Z
+ORGANIZER;CN="Sky Stebnicki":mailto:sky@teamromito.com
+PRIORITY:5
+SEQUENCE:1
+SUMMARY;LANGUAGE=en-us:Test New Line from OL
+TRANSP:OPAQUE
+END:VEVENT
+END:VCALENDAR';
+
+ $parser = File_IMC::parse('vCalendar');
+ $calendar = $parser->fromText($buf);
+ $event = $calendar['VCALENDAR'][0]['VEVENT'][0];
+
+ $description = $event['DESCRIPTION'][0]['value'][0][0];
+
+ $this->assertEquals(
+ $description,
+ 'This\n\nIs\n\nMy\n\nNotes\n\nTRE\n'
+ );
+ }
+}