Home » Mail » Mail_Queue » Bug #7850
constructor doesn't return PEAR Error Object
Details
| Submitted | 2006-06-09 15:01 UTC |
|---|---|
| From | hkrems at yahoo dot de |
| Assigned | till |
| Status | Closed |
| Package | Mail_Queue |
| PHP Version | 5.1.2 |
| OS | Max OS X |
| Roadmaps | 1.2.3 |
Comments
[2006-06-09 15:01 UTC] hkrems at yahoo dot de
Description:
------------
creating an instance of Mail_Queue with invalid dsn did not
return a PEAR Error.
Test script:
---------------
$db_options['type'] = 'db';
$db_options['dsn'] = 'mysql://user:pass@localhost/test'.'ERROR'; // << generate error
$db_options['mail_table'] = 'mail_queue';
$mail_options['driver'] = 'sendmail';
$mail_options['host'] = 'localhost';
$mail_options['port'] = 25;
$mail_options['auth'] = false;
$mail_queue =& new Mail_Queue($db_options, $mail_options);
if(PEAR::isError($mail_queue)) die ($mail_queue->getMessage());
Expected result:
----------------
final words: "Mail Queue Error: Cannot connect to database"
Actual result:
--------------
PEAR::isError($mail_queue) simply returned FALSE
[2006-06-13 08:02 UTC] hkrems at yahoo dot de
I have tested it with the latest CVS versions (I think):
Queue.php,v 1.16
Body.php,v 1.10
Container.php,v 1.9
db.php,v 1.20
the only way to check if there is an error is like
if(PEAR::isError($mail_queue->container->db))
{
print ('<h1>ERROR</h1>');
}