summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-12-21 17:26:24 -0800
committerBharat Mediratta <bharat@menalto.com>2009-12-21 17:26:24 -0800
commite0dc5206486dc6370b102fb80b050b7c81bf2420 (patch)
treecb9115467f74c9a4c349e9aa63c0e85b9b5ffc51
parente94009e90df5124ab83aad6a7f6a45806c3ff71b (diff)
Updated for recent K24 Forge changes.
-rw-r--r--modules/gallery/tests/DrawForm_Test.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/gallery/tests/DrawForm_Test.php b/modules/gallery/tests/DrawForm_Test.php
index 7ee80ca2..baded8de 100644
--- a/modules/gallery/tests/DrawForm_Test.php
+++ b/modules/gallery/tests/DrawForm_Test.php
@@ -25,9 +25,10 @@ class DrawForm_Test extends Unit_Test_Case {
$form->submit("")->value(t("Submit"));
$rendered = $form->__toString();
+ $csrf = access::csrf_token();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " .
"id=\"g-test-group-form\">\n" .
- "<input type=\"hidden\" name=\"csrf\" value=\"" . access::csrf_token() . "\" />\n" .
+ "<input type=\"hidden\" id=\"csrf\" name=\"csrf\" value=\"$csrf\" />" .
" <ul>\n" .
" <li>\n" .
" <label for=\"title\" >Title</label>\n" .
@@ -36,14 +37,14 @@ class DrawForm_Test extends Unit_Test_Case {
" </li>\n" .
" <li>\n" .
" <label for=\"description\" >Text Area</label>\n" .
- " <textarea id=\"description\" name=\"description\" " .
+ " <textarea id=\"description\" name=\"description\" rows=\"\" cols=\"\" " .
"class=\"textarea\" ></textarea>\n" .
" </li>\n" .
" <li>\n" .
" <input type=\"submit\" value=\"Submit\" class=\"submit\" />\n" .
" </li>\n" .
" </ul>\n" .
- "</form>\n";
+ "</form>";
$this->assert_same($expected, $rendered);
}
@@ -55,9 +56,10 @@ class DrawForm_Test extends Unit_Test_Case {
$group->submit("")->value(t("Submit"));
$rendered = $form->__toString();
+ $csrf = access::csrf_token();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " .
"id=\"g-test-group-form\">\n" .
- "<input type=\"hidden\" name=\"csrf\" value=\"" . access::csrf_token() . "\" />\n" .
+ "<input type=\"hidden\" id=\"csrf\" name=\"csrf\" value=\"$csrf\" />" .
" <fieldset>\n" .
" <legend>Test Group</legend>\n" .
" <ul>\n" .
@@ -68,7 +70,7 @@ class DrawForm_Test extends Unit_Test_Case {
" </li>\n" .
" <li>\n" .
" <label for=\"description\" >Text Area</label>\n" .
- " <textarea id=\"description\" name=\"description\" " .
+ " <textarea id=\"description\" name=\"description\" rows=\"\" cols=\"\" " .
"class=\"textarea\" ></textarea>\n" .
" </li>\n" .
" <li>\n" .
@@ -76,7 +78,7 @@ class DrawForm_Test extends Unit_Test_Case {
" </li>\n" .
" </ul>\n" .
" </fieldset>\n" .
- "</form>\n";
+ "</form>";
$this->assert_same($expected, $rendered);
}
@@ -91,9 +93,10 @@ class DrawForm_Test extends Unit_Test_Case {
$group->submit("")->value(t("Submit"));
$rendered = $form->__toString();
+ $csrf = access::csrf_token();
$expected = "<form action=\"http://./index.php/test/controller\" method=\"post\" " .
"id=\"g-test-group-form\">\n" .
- "<input type=\"hidden\" name=\"csrf\" value=\"" . access::csrf_token() . "\" />\n" .
+ "<input type=\"hidden\" id=\"csrf\" name=\"csrf\" value=\"$csrf\" />" .
" <fieldset>\n" .
" <legend>Test Group</legend>\n" .
" <ul>\n" .
@@ -104,7 +107,7 @@ class DrawForm_Test extends Unit_Test_Case {
" </li>\n" .
" <li>\n" .
" <label for=\"description\" >Text Area</label>\n" .
- " <textarea id=\"description\" name=\"description\" " .
+ " <textarea id=\"description\" name=\"description\" rows=\"\" cols=\"\" " .
"class=\"textarea\" ></textarea>\n" .
" </li>\n" .
" <li>\n" .
@@ -116,7 +119,7 @@ class DrawForm_Test extends Unit_Test_Case {
"<script type=\"text/javascript\">\n" .
"alert('Test Javascript');\n" .
"</script>\n" .
- "</form>\n";
+ "</form>";
$this->assert_same($expected, $rendered);
}
}