From 02e4235cef0e31c14950b154d808db83e8140fb3 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Wed, 2 Dec 2009 22:14:34 +0100 Subject: [PATCH] Reorganize test suite. --- .../test/Horde/Kolab/Format/AllTests.php | 26 +++++++++++++----- .../test/Horde/Kolab/Format/Autoload.php | 32 ++++++++++++++++++++++ .../Kolab/Format/{ => Integration}/ContactTest.php | 30 ++++++++++---------- .../Kolab/Format/{ => Integration}/EventTest.php | 29 +++++++++++--------- .../Format/{ => Integration}/MimeAttrTest.php | 8 +++--- .../Format/{ => Integration}/PreferencesTest.php | 25 +++++++++-------- .../Format/{ => Integration}/RecurrenceTest.php | 29 +++++++++++--------- .../Kolab/Format/{ => Integration}/XmlTest.php | 30 ++++++++++---------- .../fixtures/contact_category.xml | 0 .../{ => Integration}/fixtures/contact_mail.xml | 0 .../{ => Integration}/fixtures/contact_pgp.xml | 0 .../{ => Integration}/fixtures/event_umlaut.xml | 0 .../fixtures/event_umlaut_broken.xml | 0 .../fixtures/preferences_read_old.xml | 0 .../fixtures/preferences_write_old.xml | 0 .../Format/{ => Integration}/fixtures/recur.xml | 0 .../{ => Integration}/fixtures/recur_fail.xml | 0 .../test/Horde/Kolab/Format/phpunit.xml | 8 ++++++ 18 files changed, 141 insertions(+), 76 deletions(-) create mode 100644 framework/Kolab_Format/test/Horde/Kolab/Format/Autoload.php rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/ContactTest.php (89%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/EventTest.php (71%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/MimeAttrTest.php (91%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/PreferencesTest.php (87%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/RecurrenceTest.php (86%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/XmlTest.php (95%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/contact_category.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/contact_mail.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/contact_pgp.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/event_umlaut.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/event_umlaut_broken.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/preferences_read_old.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/preferences_write_old.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/recur.xml (100%) rename framework/Kolab_Format/test/Horde/Kolab/Format/{ => Integration}/fixtures/recur_fail.xml (100%) create mode 100644 framework/Kolab_Format/test/Horde/Kolab/Format/phpunit.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/AllTests.php b/framework/Kolab_Format/test/Horde/Kolab/Format/AllTests.php index 8dba17f2e..571fdafab 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/AllTests.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/AllTests.php @@ -4,11 +4,12 @@ * * PHP version 5 * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ /** @@ -21,11 +22,22 @@ if (!defined('PHPUnit_MAIN_METHOD')) { /** * Prepare the test setup. */ -require_once 'Horde/Test/AllTests.php'; +require_once dirname(__FILE__) . '/Autoload.php'; /** - * @package Horde_Kolab_Format + * Combine the tests for this package. + * + * Copyright 2007-2009 The Horde Project (http://www.horde.org/) + * + * See the enclosed file COPYING for license information (LGPL). If you + * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. + * + * @category Kolab + * @package Kolab_Format * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ class Horde_Kolab_Format_AllTests extends Horde_Test_AllTests { diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/Autoload.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Autoload.php new file mode 100644 index 000000000..08ec31f5e --- /dev/null +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Autoload.php @@ -0,0 +1,32 @@ + + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format + */ + +if (!spl_autoload_functions()) { + spl_autoload_register( + create_function( + '$class', + '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); + $err_mask = E_ALL ^ E_WARNING; + $oldErrorReporting = error_reporting($err_mask); + include "$filename.php"; + error_reporting($oldErrorReporting);' + ) + ); +} + +/** Catch strict standards */ +error_reporting(E_ALL | E_STRICT); + +/** Load the basic test definition */ +//require_once dirname(__FILE__) . '/TestCase.php'; diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/ContactTest.php similarity index 89% rename from framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/ContactTest.php index cbff2f2d9..e39fc8d91 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/ContactTest.php @@ -4,17 +4,18 @@ * * PHP version 5 * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ /** - * The Autoloader allows us to omit "require/include" statements. + * Prepare the test setup. */ -require_once 'Horde/Autoloader.php'; +require_once dirname(__FILE__) . '/../Autoload.php'; /** * Test the contact XML format. @@ -24,15 +25,16 @@ require_once 'Horde/Autoloader.php'; * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ -class Horde_Kolab_Format_ContactTest extends PHPUnit_Framework_TestCase +class Horde_Kolab_Format_Integration_ContactTest +extends PHPUnit_Framework_TestCase { - /** * Set up testing. * diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/EventTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/EventTest.php similarity index 71% rename from framework/Kolab_Format/test/Horde/Kolab/Format/EventTest.php rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/EventTest.php index 7d8a1da5e..640f0592d 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/EventTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/EventTest.php @@ -4,17 +4,18 @@ * * PHP version 5 * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ /** - * The Autoloader allows us to omit "require/include" statements. + * Prepare the test setup. */ -require_once 'Horde/Autoloader.php'; +require_once dirname(__FILE__) . '/../Autoload.php'; /** * Test event handling. @@ -24,13 +25,15 @@ require_once 'Horde/Autoloader.php'; * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ -class Horde_Kolab_Format_EventTest extends PHPUnit_Framework_TestCase +class Horde_Kolab_Format_Integration_EventTest +extends PHPUnit_Framework_TestCase { /** diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/MimeAttrTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/MimeAttrTest.php similarity index 91% rename from framework/Kolab_Format/test/Horde/Kolab/Format/MimeAttrTest.php rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/MimeAttrTest.php index 748093134..d936c13d9 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/MimeAttrTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/MimeAttrTest.php @@ -13,9 +13,9 @@ */ /** - * The Autoloader allows us to omit "require/include" statements. + * Prepare the test setup. */ -require_once 'Horde/Autoloader.php'; +require_once dirname(__FILE__) . '/../Autoload.php'; /** * Test Kolab Format MIME attributes @@ -32,9 +32,9 @@ require_once 'Horde/Autoloader.php'; * @license http://www.fsf.org/copyleft/lgpl.html LGPL * @link http://pear.horde.org/index.php?package=Kolab_Format */ -class Horde_Kolab_Format_MimeAttrTest extends PHPUnit_Framework_TestCase +class Horde_Kolab_Format_Integration_MimeAttrTest +extends PHPUnit_Framework_TestCase { - /** * Set up testing. * diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/PreferencesTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/PreferencesTest.php similarity index 87% rename from framework/Kolab_Format/test/Horde/Kolab/Format/PreferencesTest.php rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/PreferencesTest.php index 6a3615e5d..3a2cdefec 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/PreferencesTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/PreferencesTest.php @@ -4,11 +4,12 @@ * * PHP version 5 * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ /** @@ -25,13 +26,15 @@ require_once 'Horde/Autoloader.php'; * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ -class Horde_Kolab_Format_PreferencesTest extends PHPUnit_Framework_TestCase +class Horde_Kolab_Format_Integration_PreferencesTest +extends PHPUnit_Framework_TestCase { /** diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/RecurrenceTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php similarity index 86% rename from framework/Kolab_Format/test/Horde/Kolab/Format/RecurrenceTest.php rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php index 1e070d4a2..fb0a1679a 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/RecurrenceTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/RecurrenceTest.php @@ -4,17 +4,18 @@ * * PHP version 5 * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ /** - * The Autoloader allows us to omit "require/include" statements. + * Prepare the test setup. */ -require_once 'Horde/Autoloader.php'; +require_once dirname(__FILE__) . '/../Autoload.php'; /** * Test recurrence handling @@ -24,13 +25,15 @@ require_once 'Horde/Autoloader.php'; * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ -class Horde_Kolab_Format_RecurrenceTest extends PHPUnit_Framework_TestCase +class Horde_Kolab_Format_Integration_RecurrenceTest +extends PHPUnit_Framework_TestCase { /** diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/XmlTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php similarity index 95% rename from framework/Kolab_Format/test/Horde/Kolab/Format/XmlTest.php rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php index fe531f642..cd7b3637e 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/XmlTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/XmlTest.php @@ -4,17 +4,18 @@ * * PHP version 5 * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ /** - * The Autoloader allows us to omit "require/include" statements. + * Prepare the test setup. */ -require_once 'Horde/Autoloader.php'; +require_once dirname(__FILE__) . '/../Autoload.php'; /** * Test the XML format. @@ -24,15 +25,16 @@ require_once 'Horde/Autoloader.php'; * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. * - * @category Kolab - * @package Kolab_Format - * @author Gunnar Wrobel - * @license http://www.fsf.org/copyleft/lgpl.html LGPL - * @link http://pear.horde.org/index.php?package=Kolab_Format + * @category Kolab + * @package Kolab_Format + * @subpackage UnitTests + * @author Gunnar Wrobel + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @link http://pear.horde.org/index.php?package=Kolab_Format */ -class Horde_Kolab_Format_XmlTest extends PHPUnit_Framework_TestCase +class Horde_Kolab_Format_Integration_XmlTest +extends PHPUnit_Framework_TestCase { - /** * Set up testing. * diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/contact_category.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact_category.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/contact_category.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact_category.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/contact_mail.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact_mail.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/contact_mail.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact_mail.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/contact_pgp.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact_pgp.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/contact_pgp.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/contact_pgp.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/event_umlaut.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/event_umlaut.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/event_umlaut.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/event_umlaut.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/event_umlaut_broken.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/event_umlaut_broken.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/event_umlaut_broken.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/event_umlaut_broken.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/preferences_read_old.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/preferences_read_old.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/preferences_read_old.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/preferences_read_old.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/preferences_write_old.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/preferences_write_old.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/preferences_write_old.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/preferences_write_old.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/recur.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/recur.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/recur.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/recur.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/recur_fail.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/recur_fail.xml similarity index 100% rename from framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/recur_fail.xml rename to framework/Kolab_Format/test/Horde/Kolab/Format/Integration/fixtures/recur_fail.xml diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/phpunit.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/phpunit.xml new file mode 100644 index 000000000..0148736fe --- /dev/null +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/phpunit.xml @@ -0,0 +1,8 @@ + + + + + ../../../../lib + + + -- 2.11.0