Skip to content

Commit

Permalink
Updated for recent K24 Forge changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Dec 22, 2009
1 parent e94009e commit e0dc520
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions modules/gallery/tests/DrawForm_Test.php
Expand Up @@ -25,9 +25,10 @@ function no_group_test() {
$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" .
Expand All @@ -36,14 +37,14 @@ function no_group_test() {
" </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);
}

Expand All @@ -55,9 +56,10 @@ function group_test() {
$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" .
Expand All @@ -68,15 +70,15 @@ function group_test() {
" </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" .
" </fieldset>\n" .
"</form>\n";
"</form>";
$this->assert_same($expected, $rendered);
}

Expand All @@ -91,9 +93,10 @@ function form_script_test() {
$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" .
Expand All @@ -104,7 +107,7 @@ function form_script_test() {
" </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" .
Expand All @@ -116,7 +119,7 @@ function form_script_test() {
"<script type=\"text/javascript\">\n" .
"alert('Test Javascript');\n" .
"</script>\n" .
"</form>\n";
"</form>";
$this->assert_same($expected, $rendered);
}
}
Expand Down

0 comments on commit e0dc520

Please sign in to comment.