From: Gunnar Wrobel
Date: Thu, 5 Nov 2009 14:53:20 +0000 (+0100) Subject: Skip tests if other packages are missing. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8dc71187046a08205c46a8e9ba63bf67464c38d6;p=horde.git Skip tests if other packages are missing. --- diff --git a/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php b/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php index fe23ff368..d365eeadd 100644 --- a/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php +++ b/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/AlarmTest.php @@ -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 ); diff --git a/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/HordelogTest.php b/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/HordelogTest.php index 7336f6365..6e1984c75 100644 --- a/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/HordelogTest.php +++ b/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/HordelogTest.php @@ -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!'); diff --git a/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php b/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php index 841e7fac7..2ab72f841 100644 --- a/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php +++ b/framework/Notification/test/Horde/Notification/Class/Notification/Handler/Decorator/LogTest.php @@ -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 ); diff --git a/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php b/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php index 2417d62f5..9716ecd7c 100644 --- a/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php +++ b/framework/Notification/test/Horde/Notification/Class/Notification/Listener/MobileTest.php @@ -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'; /** diff --git a/framework/Notification/test/Horde/Notification/Class/Notification/Listener/StatusTest.php b/framework/Notification/test/Horde/Notification/Class/Notification/Listener/StatusTest.php index 5ce9c101f..2d1b77fef 100644 --- a/framework/Notification/test/Horde/Notification/Class/Notification/Listener/StatusTest.php +++ b/framework/Notification/test/Horde/Notification/Class/Notification/Listener/StatusTest.php @@ -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'; /** diff --git a/framework/Notification/test/Horde/Notification/Class/NotificationTest.php b/framework/Notification/test/Horde/Notification/Class/NotificationTest.php index 59791a0f6..ae6cd9eeb 100644 --- a/framework/Notification/test/Horde/Notification/Class/NotificationTest.php +++ b/framework/Notification/test/Horde/Notification/Class/NotificationTest.php @@ -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';