gunnar: server/php-kolab/Kolab_Filter/tests outgoing.phpt, NONE, 1.1 dumb_usage.phpt, 1.1, 1.2 simple_in_msg.phpt, 1.1, 1.2 simple_out_msg.phpt, 1.1, 1.2

cvs at kolab.org cvs at kolab.org
Tue Nov 27 13:35:25 CET 2007


Author: gunnar

Update of /kolabrepository/server/php-kolab/Kolab_Filter/tests
In directory doto:/tmp/cvs-serv12401/php-kolab/Kolab_Filter/tests

Modified Files:
	dumb_usage.phpt simple_in_msg.phpt simple_out_msg.phpt 
Added Files:
	outgoing.phpt 
Log Message:
The kolab-filter error handler has been fixed. This hopefully gives us a clean exit state towards postfix at all times.

--- NEW FILE: outgoing.phpt ---
--TEST--
Test the outgoing filter.
--SKIPIF--
--FILE--
<?php
require_once 'Kolab/Filter/Outgoing.php';

/* Our test configuration */
$conf = array();
$conf['log']['enabled']          = true;
$conf['log']['priority']         = PEAR_LOG_DEBUG; // Leave this on DEBUG for now. We just restructured the package...
$conf['log']['type']             = 'console';
$conf['log']['name']             = 'ignored';
$conf['log']['ident']            = 'Kolab Filter';
$conf['log']['params']['append'] = true;
$conf['filter']['tempdir'] = './tmp';
$_SERVER['argv'] = array('test', '-s', 'me at example.com', '-r', 'you at example.com');
$logger = Horde::getLogger();

$logger->_lineFormat = '%2$s [%3$s] %7$s';
// Activate this if you need the log information. This will
// make the test fail though
//$logger->_lineFormat = '%2$s [%3$s] %4$s %7$s';

$inh = fopen('_data/tiny.eml', 'r');

/* Setup the classes */
$parser = &new Filter_Outgoing('StdOut', true);

/* Parse the mail */
$parser->parse($inh);
?>
--EXPECT--
Kolab Filter [debug] logMessage
Mail from sender: me at example.com
Mail to recipient: you at example.com
To: wrobel at pardus.example.com
Subject: test
From: Gunnar Wrobel <wrobel at kolab.example.com>
Date: Tue, 27 Nov 2007 08:49:39 +0100
Message-ID: <878x4k6sbw.fsf at kolab.example.com>
User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.1.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

test
.
Kolab Filter [debug] logMessage

Index: dumb_usage.phpt
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/tests/dumb_usage.phpt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- dumb_usage.phpt	26 Nov 2007 16:35:21 -0000	1.1
+++ dumb_usage.phpt	27 Nov 2007 12:35:23 -0000	1.2
@@ -4,7 +4,6 @@
 --FILE--
 <?php
 require_once 'Kolab/Filter/Incoming.php';
-require_once 'Kolab/Filter/Response.php';
 
 /* Our test configuration */
 $conf = array();
@@ -17,12 +16,11 @@
 $conf['filter']['tempdir'] = './tmp';
 $_SERVER['argv'] = array('test');
 
-/* Setup the classes */
-$parser   = &new Filter_Incoming();
-$response = &new Response('', true);
+/* Setup the class */
+$parser   = &new Filter_Incoming('StdOut', true);
 
-/* Parse the mail and spit out the response */
-$response->handle($parser->parse());
+/* Parse the mail */
+$parser->parse();
 ?>
 --EXPECT--
 Usage is test -s sender at domain -r recipient at domain

Index: simple_in_msg.phpt
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/tests/simple_in_msg.phpt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- simple_in_msg.phpt	26 Nov 2007 16:35:21 -0000	1.1
+++ simple_in_msg.phpt	27 Nov 2007 12:35:23 -0000	1.2
@@ -4,7 +4,6 @@
 --FILE--
 <?php
 require_once 'Kolab/Filter/Incoming.php';
-require_once 'Kolab/Filter/Response.php';
 
 /* Our test configuration */
 $conf = array();
@@ -25,12 +24,11 @@
 
 $inh = fopen('_data/simple.eml', 'r');
 
-/* Setup the classes */
-$parser   = &new Filter_Incoming('StdOut');
-$response = &new Response('', true);
+/* Setup the class */
+$parser   = &new Filter_Incoming('StdOut', true);
 
-/* Parse the mail and spit out the response */
-$response->handle($parser->parse($inh));
+/* Parse the mail */
+$parser->parse($inh);
 ?>
 --EXPECT--
 Kolab Filter [debug] logMessage

Index: simple_out_msg.phpt
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/tests/simple_out_msg.phpt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- simple_out_msg.phpt	26 Nov 2007 16:35:21 -0000	1.1
+++ simple_out_msg.phpt	27 Nov 2007 12:35:23 -0000	1.2
@@ -4,7 +4,6 @@
 --FILE--
 <?php
 require_once 'Kolab/Filter/Outgoing.php';
-require_once 'Kolab/Filter/Response.php';
 
 /* Our test configuration */
 $conf = array();
@@ -25,12 +24,11 @@
 
 $inh = fopen('_data/simple.eml', 'r');
 
-/* Setup the classes */
-$parser   = &new Filter_Outgoing('StdOut');
-$response = &new Response('', true);
+/* Setup the class */
+$parser   = &new Filter_Outgoing('StdOut', true);
 
-/* Parse the mail and spit out the response */
-$response->handle($parser->parse($inh));
+/* Parse the mail */
+$parser->parse($inh);
 ?>
 --EXPECT--
 Kolab Filter [debug] logMessage





More information about the commits mailing list