diff options
Diffstat (limited to 'modules/gallery/tests/DrawForm_Test.php')
-rw-r--r-- | modules/gallery/tests/DrawForm_Test.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/modules/gallery/tests/DrawForm_Test.php b/modules/gallery/tests/DrawForm_Test.php index 7ee80ca2..90361d06 100644 --- a/modules/gallery/tests/DrawForm_Test.php +++ b/modules/gallery/tests/DrawForm_Test.php @@ -25,25 +25,26 @@ 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\" name=\"csrf\" value=\"$csrf\" />" . " <ul>\n" . " <li>\n" . " <label for=\"title\" >Title</label>\n" . - " <input type=\"text\" id=\"title\" name=\"title\" value=\"\" " . + " <input type=\"text\" name=\"title\" value=\"\" " . "class=\"textbox\" />\n" . " </li>\n" . " <li>\n" . " <label for=\"description\" >Text Area</label>\n" . - " <textarea id=\"description\" name=\"description\" " . + " <textarea 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,20 +56,21 @@ 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\" name=\"csrf\" value=\"$csrf\" />" . " <fieldset>\n" . " <legend>Test Group</legend>\n" . " <ul>\n" . " <li>\n" . " <label for=\"title\" >Title</label>\n" . - " <input type=\"text\" id=\"title\" name=\"title\" value=\"\" " . + " <input type=\"text\" name=\"title\" value=\"\" " . "class=\"textbox\" />\n" . " </li>\n" . " <li>\n" . " <label for=\"description\" >Text Area</label>\n" . - " <textarea id=\"description\" name=\"description\" " . + " <textarea 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,20 +93,21 @@ 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\" name=\"csrf\" value=\"$csrf\" />" . " <fieldset>\n" . " <legend>Test Group</legend>\n" . " <ul>\n" . " <li>\n" . " <label for=\"title\" >Title</label>\n" . - " <input type=\"text\" id=\"title\" name=\"title\" value=\"\" " . + " <input type=\"text\" name=\"title\" value=\"\" " . "class=\"textbox\" />\n" . " </li>\n" . " <li>\n" . " <label for=\"description\" >Text Area</label>\n" . - " <textarea id=\"description\" name=\"description\" " . + " <textarea 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); } } |