summaryrefslogtreecommitdiff
path: root/test/BridgeTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'test/BridgeTest.php')
-rw-r--r--test/BridgeTest.php57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/BridgeTest.php b/test/BridgeTest.php
new file mode 100644
index 0000000..3036f2b
--- /dev/null
+++ b/test/BridgeTest.php
@@ -0,0 +1,57 @@
+<?php
+
+require_once('PHPUnit/Framework.php');
+require_once('src/Bridge.php');
+
+class BridgeTest extends PHPUnit_Framework_TestCase {
+
+ /**
+ * @dataProvider providerGetPostId
+ */
+ public function testGetPostId($message_id, $expected, $ex) {
+ $bridge = new Bridge();
+ if ($ex) $this->setExpectedException($ex);
+ $this->assertEquals($expected, $bridge->getPostId($message_id));
+ }
+
+ public function providerGetPostId() {
+ return array(
+ array('bogus', null, 'PHPUnit_Framework_Error'),
+ );
+ }
+
+ /**
+ * @dataProvider providerRegisterMessage
+ */
+ public function testRegisterMessage($msg, $expected, $ex) {
+ $this->markTestIncomplete();
+# $bridge = new Bridge();
+# if ($ex) $this->setExpectedException($ex);
+# $this->assertEquals($expected, $bridge->registerMessage($msg));
+ }
+
+ public function providerRegisterMessage() {
+ return array(
+ );
+ }
+
+ /**
+ * @dataProvider providerGetDefaultForumId
+ */
+ public function testGetDefaultForumId($list, $expected, $ex) {
+ $bridge = new Bridge();
+ if ($ex) $this->setExpectedException($ex);
+ $this->assertEquals($expected, $bridge->getDefaultForumId($list));
+ }
+
+ public function providerGetDefaultForumId() {
+ return array(
+ array('bogus', null, 'PHPUnit_Framework_Error'),
+# array('messages@forums.vassalengine.org', 2, null),
+ );
+ }
+
+
+}
+
+?>