[xyphpexception commit] r21 - in trunk: xyexception-includes xyexception-tests

0 views
Skip to first unread message

codesite...@google.com

unread,
Apr 6, 2007, 12:47:35 PM4/6/07
to xyphpexce...@googlegroups.com
Author: xhochy
Date: Fri Apr 6 09:47:19 2007
New Revision: 21

Modified:
trunk/xyexception-includes/xyexception.exception.php
trunk/xyexception-tests/xyexception.test.php

Log:
Added Tests for getMailSubject() and getMailBody()

Modified: trunk/xyexception-includes/xyexception.exception.php
==============================================================================
--- trunk/xyexception-includes/xyexception.exception.php (original)
+++ trunk/xyexception-includes/xyexception.exception.php Fri Apr 6 09:47:19 2007
@@ -141,7 +141,7 @@
* @author Uwe L. Korn <uw...@xhochy.org>
* @return string
*/
- protected function getMailSubject()
+ public function getMailSubject()
{
return __CLASS__.' in file '.$this->aTrace[0]['File']
.' at line '.$this->aTrace[0]['Line'];
@@ -154,7 +154,7 @@
* @author Uwe L. Korn <uw...@xhochy.org>
* @return string
*/
- protected function getMailBody()
+ public function getMailBody()
{
$sResult = __CLASS__.' in file '.$this->aTrace[0]['File']
.' at line '.$this->aTrace[0]['Line']."\n";

Modified: trunk/xyexception-tests/xyexception.test.php
==============================================================================
--- trunk/xyexception-tests/xyexception.test.php (original)
+++ trunk/xyexception-tests/xyexception.test.php Fri Apr 6 09:47:19 2007
@@ -58,4 +58,24 @@
$this->fail();
}
}
+
+ public function testgetMailSubject_Basic()
+ {
+ $oException = new XYException('testerror',0);
+ $oException->addTrace(__FILE__, __LINE__, __FUNCTION__, __CLASS__);
+ $sMailSubject = $oException->getMailSubject();
+ if (empty($sMailSubject)) {
+ $this->fail();
+ }
+ }
+
+ public function testgetMailBody_Basic()
+ {
+ $oException = new XYException('testerror',0);
+ $oException->addTrace(__FILE__, __LINE__, __FUNCTION__, __CLASS__);
+ $sMailBody = $oException->getMailBody();
+ if (empty($sMailBody)) {
+ $this->fail();
+ }
+ }
}

Reply all
Reply to author
Forward
0 new messages