summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Brand <gb@isis.u-strasbg.fr>2008-03-02 19:45:14 +0100
committerGuy Brand <gb@isis.u-strasbg.fr>2008-03-02 19:45:14 +0100
commitaac682fbd0885f612fad6f82d8ac71573e80786f (patch)
treee30b2f8e2100a93c4c32e301dcc5cddb146c4cb3
parent7305616844af0c5f916578da1a6588f72cba745f (diff)
downloadrpg-aac682fbd0885f612fad6f82d8ac71573e80786f.tar.gz
rpg-aac682fbd0885f612fad6f82d8ac71573e80786f.tar.bz2
Fix Unit Test
- README: test unit is under _test/ - form: use security token - form: reordered elements - pageid: playground start page (broken since ns autolinking?) darcs-hash:20080302184514-19e2d-087390c75f1e60e369162219f253a7ed513ce1f6.gz
-rw-r--r--_test/README2
-rw-r--r--_test/cases/inc/form_form.test.php13
-rw-r--r--_test/cases/inc/pageutils_resolve_pageid.test.php2
3 files changed, 10 insertions, 7 deletions
diff --git a/_test/README b/_test/README
index d651a4a82..099290a0d 100644
--- a/_test/README
+++ b/_test/README
@@ -53,7 +53,7 @@ You can run the tests in three ways. From the command line:
Using a web browser;
- http://localhost/dokuwiki/test/index.php
+ http://localhost/dokuwiki/_test/index.php
As remote tests run on a remote serveri (specified in tests.ini with REMOTE_TEST_URL) and driven locally from the command line using;
diff --git a/_test/cases/inc/form_form.test.php b/_test/cases/inc/form_form.test.php
index 0c59d4a85..7a5913bf8 100644
--- a/_test/cases/inc/form_form.test.php
+++ b/_test/cases/inc/form_form.test.php
@@ -21,19 +21,20 @@ class form_test extends UnitTestCase {
$realoutput = '<form action="/test" method="post" ';
$realoutput .= 'accept-charset="'.$lang['encoding'].'" id="dw__testform">';
$realoutput .= "\n";
- $realoutput .= '<div class="no"><input type="hidden" name="summary" value="changes &amp;c" /></div>';
+ $realoutput .= '<div class="no"><input type="hidden" name="sectok" value="'.getSecurityToken().'" />';
+ $realoutput .= '<input type="hidden" name="summary" value="changes &amp;c" /></div>';
$realoutput .= "\n";
$realoutput .= "<fieldset ><legend>Test</legend>\n";
$realoutput .= '<label class="block" for="text__id"><span>Text</span> ';
- $realoutput .= '<input type="text" class="edit" id="text__id" name="t" value="v" /></label><br />';
+ $realoutput .= '<input type="text" id="text__id" name="t" value="v" class="edit" /></label><br />';
$realoutput .= "\n";
$realoutput .= '<label class="simple" for="check__id">';
$realoutput .= '<input type="checkbox" id="check__id" name="r" value="1" /> ';
$realoutput .= '<span>Check</span></label>';
$realoutput .= "\n";
- $realoutput .= '<input class="button" name="do[save]" type="submit" value="Save" accesskey="s" title="Save [ALT+S]" />';
+ $realoutput .= '<input name="do[save]" type="submit" value="Save" class="button" accesskey="s" title="Save [ALT+S]" />';
$realoutput .= "\n";
- $realoutput .= '<input class="button" name="do[cancel]" type="submit" value="Cancel" />';
+ $realoutput .= '<input name="do[cancel]" type="submit" value="Cancel" class="button" />';
$realoutput .= "\n";
$realoutput .= "</fieldset>\n</form>\n";
return $realoutput;
@@ -45,6 +46,7 @@ class form_test extends UnitTestCase {
$form->printForm();
$output = ob_get_contents();
ob_end_clean();
+ $form->addHidden('sectok', getSecurityToken());
$this->assertEqual($output,$this->_realoutput());
}
@@ -56,7 +58,8 @@ class form_test extends UnitTestCase {
'_class'=>'block',
'id'=>'text__id',
'name'=>'t',
- 'value'=>'v'));
+ 'value'=>'v',
+ 'class'=>'edit'));
$e2 =& $form->getElementAt(99);
$this->assertEqual($e2, array('_elem'=>'closefieldset'));
}
diff --git a/_test/cases/inc/pageutils_resolve_pageid.test.php b/_test/cases/inc/pageutils_resolve_pageid.test.php
index ab282b57a..738a7d2aa 100644
--- a/_test/cases/inc/pageutils_resolve_pageid.test.php
+++ b/_test/cases/inc/pageutils_resolve_pageid.test.php
@@ -48,7 +48,7 @@ class init_resolve_pageid_test extends UnitTestCase {
$tests[] = array('foo','.:','foo:start');
$tests[] = array('','foo:','foo:start');
$tests[] = array('foo','foo:','foo:start');
- $tests[] = array('foo','playground:','playground:playground');
+ $tests[] = array('foo','playground:','playground:start');
foreach($tests as $test){