summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruckelman <uckelman@nomic.net>2010-04-24 16:55:32 +0000
committeruckelman <uckelman@nomic.net>2010-04-24 16:55:32 +0000
commitfb9c0cd58a5b2ba94d01c5c24733fbd4fb84a02e (patch)
treee911de52c4ca59988be5bae07accc81ee1fa8b09
parenta4812731b3cc74849d2501d2b45fb5580b7847bb (diff)
Rejigger test to handle bbcode_second_pass modifying message parameter instead of returning it.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@6734 67b53d14-2c14-4ace-a08f-0dab2b34000c
-rw-r--r--test/unbbcodeTest.php36
1 files changed, 19 insertions, 17 deletions
diff --git a/test/unbbcodeTest.php b/test/unbbcodeTest.php
index 12d6ad9..abbbe05 100644
--- a/test/unbbcodeTest.php
+++ b/test/unbbcodeTest.php
@@ -3,19 +3,30 @@
require_once('PHPUnit/Framework.php');
class unbbcodeTest extends PHPUnit_Framework_TestCase {
-
/**
- * phpBB3 uses many globals; due to the way tests are run, we cannot
- * easily get these globals into the right scope so that the methods
- * called by our tests can see them. Therefore, we use this function
- * to run tests externally and report back on the results.
+ * @dataProvider provider_bbcode_second_pass
*/
- protected function exec_kludge($run) {
+ public function test_bbcode_second_pass($msg, $uid, $bitfield,
+ $expected, $ex) {
+ if ($ex) $this->setExpectedException($ex);
+
+ /**
+ * phpBB3 uses many globals; due to the way tests are run, we cannot
+ * easily get these globals into the right scope so that the methods
+ * called by our tests can see them. Therefore, we run tests externally
+ * and report back on the results.
+ */
$prog = <<<EOF
try {
require_once("src/unbbcode.php");
+
+ \$msg = $msg;
+ \$uid = $uid;
+ \$bitfield = $bitfield;
+
\$unbbcode = new unbbcode();
- \$result = serialize(\$unbbcode->$run);
+ \$unbbcode->bbcode_second_pass(\$msg, \$uid, \$bitfield);
+ \$result = serialize(\$msg);
}
catch (Exception \$e) {
\$result = serialize(\$e);
@@ -30,16 +41,7 @@ EOF;
throw $result;
}
- return $result;
- }
-
- /**
- * @dataProvider provider_bbcode_second_pass
- */
- public function test_bbcode_second_pass($msg, $uid, $bitfield,
- $expected, $ex) {
-
-
+ $this->assertEquals($expected, $result);
}
public function provider_bbcode_second_pass() {