Skip tests if other packages are missing.
authorGunnar Wrobel <p@rdus.de>
Thu, 5 Nov 2009 14:53:20 +0000 (15:53 +0100)
committerGunnar Wrobel <p@rdus.de>
Thu, 5 Nov 2009 14:53:20 +0000 (15:53 +0100)
framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/HordelogTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php
framework/Notification/test/Horde/Notification/Class/Notification/Listener/StatusTest.php
framework/Notification/test/Horde/Notification/Class/NotificationTest.php

index fe23ff3..d365eea 100644 (file)
@@ -36,6 +36,10 @@ extends PHPUnit_Framework_TestCase
 {
     public function setUp()
     {
+        if (!class_exists('Horde_Alarm')) {
+            $this->markTestSkipped('The Horde_Alarm package is not installed!');
+        }
+
         $this->handler = $this->getMock(
             'Horde_Notification_Handler_Base', array(), array(), '', false, false
         );
index 7336f63..6e1984c 100644 (file)
@@ -36,6 +36,10 @@ extends PHPUnit_Framework_TestCase
 {
     public function setUp()
     {
+        if (!class_exists('Log')) {
+            $this->markTestSkipped('The PEAR Log package is not installed!');
+        }
+
         @include_once 'Log.php';
         if (!defined('PEAR_LOG_DEBUG')) {
             $this->markTestSkipped('The PEAR_LOG_DEBUG constant is not available!');
index 841e7fa..2ab72f8 100644 (file)
@@ -36,6 +36,10 @@ extends PHPUnit_Framework_TestCase
 {
     public function setUp()
     {
+        if (!class_exists('Horde_Log_Logger')) {
+            $this->markTestSkipped('The Horde_Log package is not installed!');
+        }
+
         $this->handler = $this->getMock(
             'Horde_Notification_Handler_Base', array(), array(), '', false, false
         );
index 2417d62..9716ecd 100644 (file)
@@ -34,6 +34,14 @@ class Horde_Notification_Class_Notification_Listener_MobileTest extends PHPUnit_
 {
     public function setUp()
     {
+        if (!class_exists('Horde_Perms')) {
+            $this->markTestSkipped('The Horde_Perms package is not installed!');
+        }
+
+        if (!class_exists('Horde_Mobile')) {
+            $this->markTestSkipped('The Horde_Mobile package is not installed!');
+        }
+
         /** Loading Horde/Registry.php requires the PERMS_* constants */
         require_once 'Horde/Perms.php';
         /**
index 5ce9c10..2d1b77f 100644 (file)
@@ -34,6 +34,10 @@ class Horde_Notification_Class_Notification_Listener_StatusTest extends PHPUnit_
 {
     public function setUp()
     {
+        if (!class_exists('Horde_Perms')) {
+            $this->markTestSkipped('The Horde_Perms package is not installed!');
+        }
+
         /** Loading Horde/Registry.php requires the PERMS_* constants */
         require_once 'Horde/Perms.php';
         /**
index 59791a0..ae6cd9e 100644 (file)
@@ -42,6 +42,10 @@ class Horde_Notification_Class_NotificationTest extends PHPUnit_Framework_TestCa
 
     public function testMethodSingletonReturnsAlarmhandlerIfTheAlarmSystemisConfigured()
     {
+        if (!class_exists('Horde_Alarm')) {
+            $this->markTestSkipped('The Horde_Alarm package is not installed!');
+        }
+
         global $conf;
         $conf['alarms']['driver'] = 'Mock';