From 7206d212166a660a53fb6e4edb5a2a01695fd4f6 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Fri, 10 Dec 2010 06:02:16 +0100 Subject: [PATCH] Start collecting stubs of general use in the Horde_Test package. Added test stubs for testing command line tools (Argv, Cli). Both classes tend to exit unconditionally in certain situations. The stubs disable this. --- components/package.xml | 20 ++++++++++---------- components/test/Components/Autoload.php | 6 +----- components/test/Components/StoryTestCase.php | 4 ++-- .../Test/lib/Horde/Test}/Stub/Cli.php | 2 +- .../Test/lib/Horde/Test}/Stub/Parser.php | 5 +++-- framework/Test/package.xml | 14 ++++++++++---- 6 files changed, 27 insertions(+), 24 deletions(-) rename {components/test/Components => framework/Test/lib/Horde/Test}/Stub/Cli.php (97%) rename {components/test/Components => framework/Test/lib/Horde/Test}/Stub/Parser.php (89%) diff --git a/components/package.xml b/components/package.xml index a201f9017..7d195d9f6 100644 --- a/components/package.xml +++ b/components/package.xml @@ -1,5 +1,5 @@ - + Components pear.horde.org A package for handling Horde components. @@ -24,8 +24,8 @@ jan@horde.org yes - 2010-11-15 - + 2010-12-10 + 0.0.1 0.0.1 @@ -124,6 +124,11 @@ + + + + + @@ -209,10 +214,6 @@ - - - - @@ -333,6 +334,7 @@ + @@ -365,8 +367,6 @@ - - @@ -382,7 +382,7 @@ alpha alpha - 2010-11-15 + 2010-12-10 LGPL * Initial release diff --git a/components/test/Components/Autoload.php b/components/test/Components/Autoload.php index 6ec989618..10cdc35a9 100644 --- a/components/test/Components/Autoload.php +++ b/components/test/Components/Autoload.php @@ -27,8 +27,4 @@ if (!class_exists('Components')) { error_reporting(E_ALL | E_STRICT); /** Load the basic test definition */ -require_once dirname(__FILE__) . '/StoryTestCase.php'; - -/** Load stubs */ -require_once dirname(__FILE__) . '/Stub/Cli.php'; -require_once dirname(__FILE__) . '/Stub/Parser.php'; +require_once dirname(__FILE__) . '/StoryTestCase.php'; \ No newline at end of file diff --git a/components/test/Components/StoryTestCase.php b/components/test/Components/StoryTestCase.php index 9ba58e5a7..2b35925f1 100644 --- a/components/test/Components/StoryTestCase.php +++ b/components/test/Components/StoryTestCase.php @@ -671,11 +671,11 @@ extends PHPUnit_Extensions_Story_TestCase private function _callComponents(array $parameters, $callback) { ob_start(); - $parameters['cli']['parser']['class'] = 'Components_Stub_Parser'; + $parameters['cli']['parser']['class'] = 'Horde_Test_Stub_Parser'; $parameters['dependencies'] = new Components_Dependencies_Injector(); $parameters['dependencies']->setInstance( 'Horde_Cli', - new Components_Stub_Cli() + new Horde_Test_Stub_Cli() ); call_user_func_array($callback, array($parameters)); $output = ob_get_contents(); diff --git a/components/test/Components/Stub/Cli.php b/framework/Test/lib/Horde/Test/Stub/Cli.php similarity index 97% rename from components/test/Components/Stub/Cli.php rename to framework/Test/lib/Horde/Test/Stub/Cli.php index f6564d189..ce394af2b 100644 --- a/components/test/Components/Stub/Cli.php +++ b/framework/Test/lib/Horde/Test/Stub/Cli.php @@ -1,5 +1,5 @@ - + Test pear.horde.org Horde testing base classes @@ -10,8 +10,8 @@ chuck@horde.org yes - 2010-02-11 - + 2010-12-10 + 0.1.0 0.1.0 @@ -29,6 +29,10 @@ + + + + @@ -59,6 +63,8 @@ + + @@ -71,7 +77,7 @@ alpha alpha - 2010-02-11 + 2010-12-10 LGPL * Initial testing package. -- 2.11.0