Fix for strict testing.
authorGunnar Wrobel <p@rdus.de>
Mon, 12 Apr 2010 08:48:19 +0000 (10:48 +0200)
committerGunnar Wrobel <p@rdus.de>
Mon, 12 Apr 2010 08:48:19 +0000 (10:48 +0200)
framework/Date/test/Horde/Date/RecurrenceTest.php
framework/iCalendar/iCalendar.php
framework/iCalendar/iCalendar/vtimezone.php

index 93ce16e..4457e80 100644 (file)
@@ -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();
index 68a6f4f..fbc8985 100644 (file)
@@ -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'],
index 5719afa..bcb883a 100644 (file)
@@ -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;
             }