/[Apache-SVN]/httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm
ViewVC logotype

Diff of /httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm	2004/12/08 05:21:43	111214
+++ httpd/test/trunk/perl-framework/Apache-Test/lib/Apache/TestRequest.pm	2004/12/08 05:26:12	111215
@@ -815,6 +815,9 @@ before issuing the requests.
 C<Apache::TestRequest> exports a number of functions that will likely
 prove convenient for use in the majority of your request tests.
 
+
+
+
 =head2 Optional Parameters
 
 Each function also takes a number of optional arguments.
@@ -1088,6 +1091,70 @@ testing what options the Apache server s
 specification, section 9.2, at
 I<http://www.faqs.org/rfcs/rfc2616.html> for more information.
 
+
+
+
+
+=head2 URL Manipulation Functions
+
+C<Apache::TestRequest> also includes a few helper functions to aid in
+the creation of urls used in the functions above.
+
+
+
+=head3 C<module2path>
+
+  $path = module2path($module_name);
+
+Convert a module name to a path, safe for use in the various request
+methods above. e.g. C<::> can't be used in URLs on win32. For example:
+
+  $path = module2path('Foo::Bar');
+
+returns:
+
+  /Foo__Bar
+
+
+
+
+=head3 C<module2url>
+
+  $url = Apache::TestRequest::module2url($module);
+  $url = Apache::TestRequest::module2url($module, %options);
+
+Convert a module name to a full URL including the current
+configurations C<hostname:port> and sets C<module> accordingly.
+
+  $url = Apache::TestRequest::module2url('Foo::Bar');
+
+returns:
+
+  http://$hostname:$port/Foo__Bar
+
+The default scheme used is C<http>. You can override this by passing
+your preferred scheme into an optional second param. For example:
+
+  $module = 'MyTestModule::TestHandler';
+  $url = Apache::TestRequest::module2uri($module, {scheme => 'https'});
+
+returns:
+
+  https://$hostname:$port/MyTestModule__TestHandler
+
+You may also override the default path with a path of your own:
+
+  $module = 'MyTestModule::TestHandler';
+  $url = Apache::TestRequest::module2uri($module, {path => '/foo'});
+
+returns:
+
+  http://$hostname:$port/foo
+
+
+
+
+
 =head1 ENVIRONMENT VARIABLES
 
 The following environment variables can affect the behavior of

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26