Re: cvs: pear /MDB2/tests MDB2_manager_testcase.php
| From: | Lukas Smith | Date: | Sun, 07 Nov 2004 19:36:23 +0000 |
| Subject: | Re: cvs: pear /MDB2/tests MDB2_manager_testcase.php | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-25746@lists.php.net to get a copy of this message | ||
Daniel Convissor wrote:
danielc Sun Nov 7 12:22:49 2004 EDTlets just expect both errors ... $this->manager->db->expectError(array(MDB2_ERROR_NOSUCHTABLE, MDB2_ERROR_CANNOT_DROP)); however we may have to explore handling this inside the mssql driver. maybe by looking at the last_query property. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07Modified files: /pear/MDB2/tests MDB2_manager_testcase.php Log:* mssql uses same error code for no such table and no such database,plus doesn't seem to say can not drop. So add this workaround. http://cvs.php.net/diff.php/pear/MDB2/tests/MDB2_manager_testcase.php?r1=1.6&r2=1.7&ty=uIndex: pear/MDB2/tests/MDB2_manager_testcase.php diff -u pear/MDB2/tests/MDB2_manager_testcase.php:1.6 pear/MDB2/tests/MDB2_manager_testcase.php:1.7 --- pear/MDB2/tests/MDB2_manager_testcase.php:1.6 Thu Oct 28 18:24:34 2004 +++ pear/MDB2/tests/MDB2_manager_testcase.php Sun Nov 7 12:22:49 2004 @@ -41,7 +41,7 @@// | Author: Paul Cooper <pgc@ucecom.com> |// +----------------------------------------------------------------------+ // -// $Id: MDB2_manager_testcase.php,v 1.6 2004/10/28 22:24:34 lsmith Exp $ +// $Id: MDB2_manager_testcase.php,v 1.7 2004/11/07 17:22:49 danielc Exp $ require_once 'MDB2/Tools/Manager.php'; @@ -107,7 +107,11 @@if (!$this->methodExists($this->manager->db->manager, 'dropDatabase')) { return; } - $this->manager->db->expectError(MDB2_ERROR_CANNOT_DROP); + if ($this->manager->db->phptype == 'mssql') { + $this->manager->db->expectError(MDB2_ERROR_NOSUCHTABLE); + } else { + $this->manager->db->expectError(MDB2_ERROR_CANNOT_DROP); + }