From: Gunnar Wrobel
Date: Mon, 12 Apr 2010 08:48:19 +0000 (+0200) Subject: Fix for strict testing. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=767847624b436609597b50aa7aa372470cd8fb65;p=horde.git Fix for strict testing. --- diff --git a/framework/Date/test/Horde/Date/RecurrenceTest.php b/framework/Date/test/Horde/Date/RecurrenceTest.php index 93ce16e9d..4457e807b 100644 --- a/framework/Date/test/Horde/Date/RecurrenceTest.php +++ b/framework/Date/test/Horde/Date/RecurrenceTest.php @@ -869,6 +869,8 @@ class Horde_Date_RecurrenceTest extends PHPUnit_Framework_TestCase public function testBug2813RecurrenceEndFromIcalendar() { + require_once 'PEAR.php'; + $iCal = new Horde_iCalendar(); $iCal->parsevCalendar(file_get_contents(dirname(__FILE__) . '/fixtures/bug2813.ics')); $components = $iCal->getComponents(); diff --git a/framework/iCalendar/iCalendar.php b/framework/iCalendar/iCalendar.php index 68a6f4f39..fbc8985c4 100644 --- a/framework/iCalendar/iCalendar.php +++ b/framework/iCalendar/iCalendar.php @@ -222,7 +222,7 @@ class Horde_iCalendar { } } if (!count($result)) { - return PEAR::raiseError('Attribute "' . $name . '" Not Found'); + return new PEAR_Error('Attribute "' . $name . '" Not Found'); } if (count($result) == 1 && !$params) { return $result[0]; } else { @@ -319,7 +319,7 @@ class Horde_iCalendar { */ function addComponent($component) { - if (is_a($component, 'Horde_iCalendar')) { + if ($component instanceOf Horde_iCalendar) { $component->_container = &$this; $this->_components[] = &$component; } @@ -430,9 +430,9 @@ class Horde_iCalendar { $childclass = 'Horde_iCalendar_' . Horde_String::lower($childclass); $keys = array_keys($this->_components); foreach ($keys as $key) { - if (is_a($this->_components[$key], $childclass)) { + if ($this->_components[$key] instanceOf $childclass) { $attr = $this->_components[$key]->getAttribute($attribute); - if (is_a($attr, 'PEAR_Error')) { + if ($attr instanceOf PEAR_Error) { continue; } if ($value !== null && $value != $attr) { @@ -1214,7 +1214,7 @@ class Horde_iCalendar { // Get timezone info for date fields from $tzid and container. $tzoffset = ($time['zone'] == 'Local' && $tzid && - is_a($this->_container, 'Horde_iCalendar')) + $this->_container instanceOf Horde_iCalendar) ? $this->_parseTZID($date, $time, $tzid) : false; if ($time['zone'] == 'UTC' || $tzoffset !== false) { $result = @gmmktime($time['hour'], $time['minute'], $time['second'], diff --git a/framework/iCalendar/iCalendar/vtimezone.php b/framework/iCalendar/iCalendar/vtimezone.php index 5719afa66..bcb883a87 100644 --- a/framework/iCalendar/iCalendar/vtimezone.php +++ b/framework/iCalendar/iCalendar/vtimezone.php @@ -36,24 +36,24 @@ class Horde_iCalendar_vtimezone extends Horde_iCalendar { $result['time'] = 0; $t = $child->getAttribute('TZOFFSETFROM'); - if (is_a($t, 'PEAR_Error')) { + if ($t instanceOf PEAR_Error) { return false; } $result['from'] = ($t['hour'] * 60 * 60 + $t['minute'] * 60) * ($t['ahead'] ? 1 : -1); $t = $child->getAttribute('TZOFFSETTO'); - if (is_a($t, 'PEAR_Error')) { + if ($t instanceOf PEAR_Error) { return false; } $result['to'] = ($t['hour'] * 60 * 60 + $t['minute'] * 60) * ($t['ahead'] ? 1 : -1); $switch_time = $child->getAttribute('DTSTART'); - if (is_a($switch_time, 'PEAR_Error')) { + if ($switch_time instanceOf PEAR_Error) { return false; } $rrules = $child->getAttribute('RRULE'); - if (is_a($rrules, 'PEAR_Error')) { + if ($rrules instanceOf PEAR_Error) { if (!is_int($switch_time)) { return false; }