summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Bridge.php7
-rw-r--r--test/BridgeTest.php2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/Bridge.php b/src/Bridge.php
index e46013d..3884154 100644
--- a/src/Bridge.php
+++ b/src/Bridge.php
@@ -68,7 +68,6 @@ class Bridge {
. $this->quote($references) . ')';
$count = $this->db->exec($sql);
-
return $count == 1;
}
@@ -78,9 +77,11 @@ class Bridge {
$sql = 'DELETE FROM posts WHERE message_id = ' .
$this->db->quote($messageId);
- $coult = $this->db->exec($sql);
+ $count = $this->db->exec($sql);
- return $count == 1;
+ if ($count != 1) {
+ throw new Exception('Failed to delete message id: ' . $messageId);
+ }
}
protected function get_exactly_one_row($sql) {
diff --git a/test/BridgeTest.php b/test/BridgeTest.php
index cc094e6..386e2b2 100644
--- a/test/BridgeTest.php
+++ b/test/BridgeTest.php
@@ -141,7 +141,7 @@ class BridgeTest extends PHPUnit_Framework_TestCase {
return array(
array(null, null, 'Exception'),
array('<20100302094228.33F0310091@charybdis.ellipsis.cx>', true, null),
- array('<10100302094228.33F0310091@charybdis.ellipsis.cx>', false, null)
+ array('<10100302094228.33F0310091@charybdis.ellipsis.cx>', null, 'Exception')
);
}