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

cvs at kolab.org cvs at kolab.org
Mon Nov 26 17:35:23 CET 2007


Author: gunnar

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

Added Files:
	dumb_usage.phpt simple_in_msg.phpt simple_out_msg.phpt 
Removed Files:
	test.eml 
Log Message:
Restructured Kolab_Filter package with the focus on error
handling and unit testing.

--- NEW FILE: dumb_usage.phpt ---
--TEST--
Test reading a mail without iCal content.
--SKIPIF--
--FILE--
<?php
require_once 'Kolab/Filter/Incoming.php';
require_once 'Kolab/Filter/Response.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');

/* Setup the classes */
$parser   = &new Filter_Incoming();
$response = &new Response('', true);

/* Parse the mail and spit out the response */
$response->handle($parser->parse());
?>
--EXPECT--
Usage is test -s sender at domain -r recipient at domain

--- NEW FILE: simple_in_msg.phpt ---
--TEST--
Test reading a mail without iCal content.
--SKIPIF--
--FILE--
<?php
require_once 'Kolab/Filter/Incoming.php';
require_once 'Kolab/Filter/Response.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/simple.eml', 'r');

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

/* Parse the mail and spit out the response */
$response->handle($parser->parse($inh));
?>
--EXPECT--
Kolab Filter [debug] logMessage
Mail from sender: me at example.com
Mail to recipient: you at example.com
Return-Path: <jramirezme at kof.com.mx>
Received: from localhost (fqdn.example.com [127.0.0.1])
	 by demo.example.com (Cyrus v2.3.9-openpkg) with LMTPA;
	 Sat, 10 Nov 2007 20:44:52 +0100
X-Sieve: CMU Sieve 2.3
Received: from localhost (fqdn.example.com [127.0.0.1])
	by demo.example.com (Postfix) with ESMTP id 395055FC0128
	for <wrobel at demo.example.com>; Sat, 10 Nov 2007 20:44:52 +0100 (CET)
X-Quarantine-ID: <pcNZVfHFgssC>
X-Virus-Scanned: by amavisd-new at demo.example.com
X-Spam-Flag: YES
X-Spam-Score: 15.576
X-Spam-Level: ***************
X-Spam-Status: Yes, score=15.576 tagged_above=3 required=6.3
	tests=[FRT_PENIS1=3.799, HTML_MESSAGE=0.001, PLING_QUERY=2.16,
	RCVD_FORGED_WROTE=4.365, RCVD_FORGED_WROTE2=2.052, RDNS_NONE=0.1,
	SUBJECT_FUZZY_PENIS=3.099]
Received: from demo.example.com ([127.0.0.1])
	by localhost (demo.example.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id pcNZVfHFgssC for <wrobel at demo.example.com>;
	Sat, 10 Nov 2007 20:44:51 +0100 (CET)
Received: from localhost (fqdn.example.com [127.0.0.1])
	by demo.example.com (Postfix) with ESMTP id ABE8E5FC012A
	for <wrobel at demo.example.com>; Sat, 10 Nov 2007 20:44:51 +0100 (CET)
Received: from town.windham.me.us (unknown [85.192.14.1])
	by demo.example.com (Postfix) with SMTP id D10375FC0128
	for <wrobel at demo.example.com>; Sat, 10 Nov 2007 20:44:49 +0100 (CET)
Received: from 192.85.78.105 (HELO ccfemsasmtp.kof.com.mx)
     by demo.example.com with esmtp (CEYPNSAEHHT CYXPCJ)
     id UNrWB0-GRSpeC-lz
     for wrobel at demo.example.com; Sat, 10 Nov 2007 22:45:12 +0300
Message-ID: <1d2101c823d2$3555aa10$ac112c15 at Meredith>
From: "Meredith F. Dick" <Meredith at kof.com.mx>
To: "Marta Z. Rodrigues" <wrobel at demo.example.com>
Subject: ***SPAM*** Don't you think it's time you stopped being a loser
Date: Sat, 10 Nov 2007 22:45:12 +0300
MIME-Version: 1.0
Content-Type: multipart/alternative;
        boundary="----=_NextPart_7455_1D89_01C823EB.5AA2E210"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-Kolab-Scheduling-Message: FALSE

This is a multi-part message in MIME format.

------=_NextPart_7455_1D89_01C823EB.5AA2E210
Content-Type: text/plain;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

request=2E Horn was a fan favorite, standing up for theA recent poll by M=
ontreal based newspaper Le Devoir, on
Mel Karmazin spoke on behalf of both XM and Sirius=2E


Do you believe in magic? We suppose you're likely to say "no"=2E=20
We hadn't believed, either=2E=2E=2Euntil the moment MegaXXXX was introduc=
ed!=20
The effect this remedy produces on a male XXXXX cannot be called otherwis=
e than a Miracle!=20
It's fabulous!

So, hurry up, work a miracle in your life with this wonder-medicine!


competiton has a poor track record of keeping down costsas head of the pu=
ppet government in China=2EParti Qubcois leader slams radio host on homop=
hobiacontrols=2E XM and Sirius can be said to compete with
------=_NextPart_7455_1D89_01C823EB.5AA2E210
Content-Type: text/html;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4=2E0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"=
>
<META content=3D"MSHTML 6=2E00=2E2900=2E2869" name=3DGENERATOR>
<STYLE type=3D"text/css">
=2Estyle2 {font-size: 10px; color: #616161;}
=2Estyle7 {font-size: 14px; color: #FF2F2F;}
body {background-color: #FFFFFF; color: #2B3235;}
</STYLE>
</HEAD>
<BODY><span class=3D"style2">=20
<br>request=2E Horn was a fan favorite, standing up for theA recent poll =
by Montreal based newspaper Le Devoir, on<br>Mel Karmazin spoke on behalf=
 of both XM and Sirius=2E</span>=20
<br><br><br>
<b>Do you believe in magic? We suppose you're likely to say "no"=2E<br>
<span class=3D"style7">We hadn't believed, either=2E=2E=2Euntil the momen=
t </span>MegaXXXX was introduced!</b><br>
The effect this remedy produces on a male XXXXX cannot be called otherwis=
e than a Miracle! <br>
<b>It's fabulous!</b><br><br>

<a href=3D"http://scottjay=2Ecom/"><b>So, hurry up, work a miracle in you=
r life with this wonder-medicine!</b></a><br><br>
<br><span class=3D"style2">competiton has a poor track record of keeping =
down costsas head of the puppet government in China=2EParti Qubcois leade=
r slams radio host on homophobiacontrols=2E XM and Sirius can be said to =
compete with<br></span></BODY></HTML>

------=_NextPart_7455_1D89_01C823EB.5AA2E210--
.
Kolab Filter [debug] logMessage

--- NEW FILE: simple_out_msg.phpt ---
--TEST--
Test sending a mail without iCal content.
--SKIPIF--
--FILE--
<?php
require_once 'Kolab/Filter/Outgoing.php';
require_once 'Kolab/Filter/Response.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/simple.eml', 'r');

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

/* Parse the mail and spit out the response */
$response->handle($parser->parse($inh));
?>
--EXPECT--
Kolab Filter [debug] logMessage
Mail from sender: me at example.com
Mail to recipient: you at example.com
Return-Path: <jramirezme at kof.com.mx>
Received: from localhost (fqdn.example.com [127.0.0.1])
	 by demo.example.com (Cyrus v2.3.9-openpkg) with LMTPA;
	 Sat, 10 Nov 2007 20:44:52 +0100
X-Sieve: CMU Sieve 2.3
Received: from localhost (fqdn.example.com [127.0.0.1])
	by demo.example.com (Postfix) with ESMTP id 395055FC0128
	for <wrobel at demo.example.com>; Sat, 10 Nov 2007 20:44:52 +0100 (CET)
X-Quarantine-ID: <pcNZVfHFgssC>
X-Virus-Scanned: by amavisd-new at demo.example.com
X-Spam-Flag: YES
X-Spam-Score: 15.576
X-Spam-Level: ***************
X-Spam-Status: Yes, score=15.576 tagged_above=3 required=6.3
	tests=[FRT_PENIS1=3.799, HTML_MESSAGE=0.001, PLING_QUERY=2.16,
	RCVD_FORGED_WROTE=4.365, RCVD_FORGED_WROTE2=2.052, RDNS_NONE=0.1,
	SUBJECT_FUZZY_PENIS=3.099]
Received: from demo.example.com ([127.0.0.1])
	by localhost (demo.example.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id pcNZVfHFgssC for <wrobel at demo.example.com>;
	Sat, 10 Nov 2007 20:44:51 +0100 (CET)
Received: from localhost (fqdn.example.com [127.0.0.1])
	by demo.example.com (Postfix) with ESMTP id ABE8E5FC012A
	for <wrobel at demo.example.com>; Sat, 10 Nov 2007 20:44:51 +0100 (CET)
Received: from town.windham.me.us (unknown [85.192.14.1])
	by demo.example.com (Postfix) with SMTP id D10375FC0128
	for <wrobel at demo.example.com>; Sat, 10 Nov 2007 20:44:49 +0100 (CET)
Received: from 192.85.78.105 (HELO ccfemsasmtp.kof.com.mx)
     by demo.example.com with esmtp (CEYPNSAEHHT CYXPCJ)
     id UNrWB0-GRSpeC-lz
     for wrobel at demo.example.com; Sat, 10 Nov 2007 22:45:12 +0300
Message-ID: <1d2101c823d2$3555aa10$ac112c15 at Meredith>
From: "Meredith F. Dick" <Meredith at kof.com.mx>
To: "Marta Z. Rodrigues" <wrobel at demo.example.com>
Subject: ***SPAM*** Don't you think it's time you stopped being a loser
Date: Sat, 10 Nov 2007 22:45:12 +0300
MIME-Version: 1.0
Content-Type: multipart/alternative;
        boundary="----=_NextPart_7455_1D89_01C823EB.5AA2E210"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869

This is a multi-part message in MIME format.

------=_NextPart_7455_1D89_01C823EB.5AA2E210
Content-Type: text/plain;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

request=2E Horn was a fan favorite, standing up for theA recent poll by M=
ontreal based newspaper Le Devoir, on
Mel Karmazin spoke on behalf of both XM and Sirius=2E


Do you believe in magic? We suppose you're likely to say "no"=2E=20
We hadn't believed, either=2E=2E=2Euntil the moment MegaXXXX was introduc=
ed!=20
The effect this remedy produces on a male XXXXX cannot be called otherwis=
e than a Miracle!=20
It's fabulous!

So, hurry up, work a miracle in your life with this wonder-medicine!


competiton has a poor track record of keeping down costsas head of the pu=
ppet government in China=2EParti Qubcois leader slams radio host on homop=
hobiacontrols=2E XM and Sirius can be said to compete with
------=_NextPart_7455_1D89_01C823EB.5AA2E210
Content-Type: text/html;
        charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4=2E0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"=
>
<META content=3D"MSHTML 6=2E00=2E2900=2E2869" name=3DGENERATOR>
<STYLE type=3D"text/css">
=2Estyle2 {font-size: 10px; color: #616161;}
=2Estyle7 {font-size: 14px; color: #FF2F2F;}
body {background-color: #FFFFFF; color: #2B3235;}
</STYLE>
</HEAD>
<BODY><span class=3D"style2">=20
<br>request=2E Horn was a fan favorite, standing up for theA recent poll =
by Montreal based newspaper Le Devoir, on<br>Mel Karmazin spoke on behalf=
 of both XM and Sirius=2E</span>=20
<br><br><br>
<b>Do you believe in magic? We suppose you're likely to say "no"=2E<br>
<span class=3D"style7">We hadn't believed, either=2E=2E=2Euntil the momen=
t </span>MegaXXXX was introduced!</b><br>
The effect this remedy produces on a male XXXXX cannot be called otherwis=
e than a Miracle! <br>
<b>It's fabulous!</b><br><br>

<a href=3D"http://scottjay=2Ecom/"><b>So, hurry up, work a miracle in you=
r life with this wonder-medicine!</b></a><br><br>
<br><span class=3D"style2">competiton has a poor track record of keeping =
down costsas head of the puppet government in China=2EParti Qubcois leade=
r slams radio host on homophobiacontrols=2E XM and Sirius can be said to =
compete with<br></span></BODY></HTML>

------=_NextPart_7455_1D89_01C823EB.5AA2E210--
.
Kolab Filter [debug] logMessage

--- test.eml DELETED ---





More information about the commits mailing list