HTTP::WebTest::SelfTest - Helper package for HTTP::WebTest test suite
use HTTP::WebTest::SelfTest;
This module provides helper routines used by HTTP::WebTest self test suite. Plugin writers may find this module useful for implementation of test suites for their plugins.
This module imports in namespace of test script following global variables.
The hostname of the test webserver.
The port of the test webserver.
The URL of the test webserer.
This module imports in namespace of test script following helper subroutines.
Returns absolute URL based on pair of base and relative URLs.
Reads a file.
Name of the file.
(Optional) If true then open file errors are ignored, otherwise they raise an exception. If omit defaults to true.
Whole content of the file as a string.
Writes into a file.
Data to write into the file.
Runs a test sequence and compares output with a reference file.
HTTP::WebTest object to be used for running the test sequence.
The test sequence.
The global parameters for the test sequence.
Generates test file from template file. I.e. it replaces substring '<<SERVER_URL>>' with value of named parameter server_url.
server_url
Filename of test file. Template file is expected to be in file named "$file.in".
Test webserver URL.
Some substrings in test output are unique for each test run. This subroutine "fixes" test output so it becomes repeatable (unless tests get broken).
A reference on scalar which contains test output as whole string.
An optional reference on subroutine which can be used as additional filter. It gets passed test output as its first parameter.
Test webserver URL. Normally it is unique for each test run so it gets replaced with http://http.web.test/.
http://http.web.test/
Test webserver URL. Normally it is unique for each machine where test is run so it gets replaced with http.web.test.
http.web.test
Tests if a test output matches content of specified reference file. If environment variable TEST_FIX is set then the test is always succeed and the content of the reference file is overwritten with current test output.
TEST_FIX
Filename of the reference file.
Decodes credentials for Basic authorization scheme according RFC2617.
Returns user/password pair.
This module imports in namespace of test script following helper subroutines but they are deprecated and may be removed in the future from this module.
This subroutine was moved into HTTP::WebTest::Utils but for backward compatibility purposes can be exported from this module.
Copyright (c) 2001-2003 Ilya Martynov. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
HTTP::WebTest
HTTP::WebTest::API
HTTP::WebTest::Plugins
To install HTTP::WebTest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::WebTest
CPAN shell
perl -MCPAN -e shell install HTTP::WebTest
For more information on module installation, please visit the detailed CPAN module installation guide.