From 1118926f9e87bfe9ec4f78cb560877fc8081cf28 Mon Sep 17 00:00:00 2001 From: uckelman Date: Tue, 13 Apr 2010 20:26:06 +0000 Subject: Added full registerMessage(). git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6700 67b53d14-2c14-4ace-a08f-0dab2b34000c --- test/BridgeTest.php | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'test/BridgeTest.php') diff --git a/test/BridgeTest.php b/test/BridgeTest.php index c0c7da1..28ef8d5 100644 --- a/test/BridgeTest.php +++ b/test/BridgeTest.php @@ -96,9 +96,9 @@ class BridgeTest extends PHPUnit_Framework_TestCase { } /** - * @dataProvider providerRegisterMessage + * @dataProvider providerRegisterMessage3 */ - public function testRegisterMessage($messageId, $inReplyTo, $refs, + public function testRegisterMessage3($messageId, $inReplyTo, $refs, $expected, $ex) { if ($ex) $this->setExpectedException($ex); $bridge = new Bridge($this->db); @@ -108,7 +108,7 @@ class BridgeTest extends PHPUnit_Framework_TestCase { ); } - public function providerRegisterMessage() { + public function providerRegisterMessage3() { return array( array(null, null, null, null, 'Exception'), array( @@ -128,6 +128,41 @@ class BridgeTest extends PHPUnit_Framework_TestCase { ); } + /** + * @dataProvider providerRegisterMessage4 + */ + public function testRegisterMessage4($postId, $messageId, $inReplyTo, $refs, + $expected, $ex) { + if ($ex) $this->setExpectedException($ex); + $bridge = new Bridge($this->db); + $this->assertEquals( + $expected, + $bridge->registerMessage($postId, $messageId, $inReplyTo, $refs) + ); + } + + public function providerRegisterMessage4() { + return array( + array(null, null, null, null, 'Exception'), + array( + 2, + '<20100302094228.33F0310091@charybdis.ellipsis.cx>', + null, + null, + false, + null + ), + array( + 2, + '<10100302094228.33F0310091@charybdis.ellipsis.cx>', + null, + null, + true, + null + ) + ); + } + /** * @dataProvider providerUnregisterMessage */ -- cgit v1.2.3