Added test cases for PATH_INFO and percent_encoded_path_info for root url cases.

Removed obsolete calls from TEST_EXECUTION_I .
This commit is contained in:
2017-01-10 12:37:37 +01:00
parent 56fa773b30
commit d09d452ad5
2 changed files with 51 additions and 12 deletions

View File

@@ -48,6 +48,8 @@ feature -- Tests
)
s := req.script_url ("/new/path/")
assert ("script_url (/new/path/) = %""+s+"%" but should be %"/foo/bar/new/path/%"", s.same_string ("/foo/bar/new/path/"))
assert ("valid path info", req.path_info.same_string_general ("/test/home"))
assert ("valid path info", req.percent_encoded_path_info.same_string_general ("/test/home"))
end
test_script_url_2
@@ -84,7 +86,48 @@ feature -- Tests
)
s := req.script_url ("/new/path/")
assert ("script_url (/new/path/) = %""+s+"%" but should be %"/intranet/collab/cms/new/path/%"", s.same_string ("/intranet/collab/cms/new/path/"))
assert ("path_info", req.path_info.same_string_general ("/home"))
assert ("percent_encoded_path_info", req.percent_encoded_path_info.same_string_general ("/home"))
end
test_script_url_4
local
req: WSF_REQUEST
s: READABLE_STRING_8
do
--| Case #3
req := new_request (<<
["REQUEST_METHOD", "GET"],
["QUERY_STRING", ""],
["REQUEST_URI", "/support/"],
["SCRIPT_NAME", "/support/esa_api.exe"],
["PATH_INFO", ""]
>>
)
s := req.script_url ("/new/path/")
assert ("script_url (/new/path/) = %""+s+"%" but should be %"/support/new/path/%"", s.same_string ("/support/new/path/"))
assert ("path_info", req.path_info.same_string_general (""))
assert ("percent_encoded_path_info", req.percent_encoded_path_info.same_string_general (""))
end
test_script_url_5
local
req: WSF_REQUEST
s: READABLE_STRING_8
do
--| Case #3
req := new_request (<<
["REQUEST_METHOD", "GET"],
["QUERY_STRING", ""],
["REQUEST_URI", "/support/"],
["SCRIPT_NAME", "/support/esa_api.exe"],
["PATH_INFO", "/"]
>>
)
s := req.script_url ("/new/path/")
assert ("script_url (/new/path/) = %""+s+"%" but should be %"/support/new/path/%"", s.same_string ("/support/new/path/"))
assert ("path_info", req.path_info.same_string_general ("/"))
assert ("percent_encoded_path_info", req.percent_encoded_path_info.same_string_general ("/"))
end
feature {NONE} -- Implementation