NAME
Web::Solid::Test::HTTPLists - Solid Tests using HTTP objects
SYNOPSIS
use Test::FITesque::RDF;
my $suite = Test::FITesque::RDF->new(source => $file, base_uri => $ENV{SOLID_REMOTE_BASE})->suite;
$suite->run_tests;
done_testing;
A script tests/httplists.t
can be used to launch some of these tests.
DESCRIPTION
Introduction
The basic idea with these tests is to simplify reuse and formulation of fixture tables using the Resource Description Framework (RDF), in this case using HTTP vocabularies to formulate lists of requests and responses. It is in a very early stage, but there are running tests in this module. See Web::Solid::Test::Basic for more on the philosophy.
This system is built on Test::FITesque::RDF, which adds RDF fixture tables to Test::FITesque.
IMPLEMENTED TESTS
Test scripts
This package provides tests/httplists.t
which runs tests over the fixture table in tests/data/http-list.ttl
. The test script requires the environment variable SOLID_REMOTE_BASE
to be set to the base URL that any relative URLs in the fixture tables will be resolved against. Thus, the fixture tables themselves are independent of the host that will run them.
To run the test script in the clone of this package, invoke it like this:
SOLID_REMOTE_BASE="https://kjetiltest4.dev.inrupt.net/" prove -l tests/basic.t
http_req_res_list_unauthenticated
Runs a list of HTTP request response pairs, checking response against the response.
Parameters
test:requests
An RDF list of requests that will be executed towards the server in
SOLID_REMOTE_BASE
.test:responses
An RDF list of responses that will be used as corresponding expected responses in the tests.
Environment
None
Implements
- 1. That responses are HTTP::Response objects.
- 2. That the response code matches the expected one if given.
- 3. That all headers given in the expected response matches a header in the actual response.
NOTE
The parameters above are in the RDF formulated as actual full URIs, but where the local part is used here and resolved by the Test::FITesque::RDF framework, see its documentation for details.
To run tests against a server that uses HTTPS but does not have a valid certificate, such as a self-signed one, install LWP::Protocol::https and ignore errors by setting the environment variable <PERL_LWP_SSL_VERIFY_HOSTNAME=0>
TODO
The namespaces used in the current fixture tables are examples, and will be changed before an 1.0 release of the system.
BUGS
Please report any bugs to https://github.com/kjetilk/p5-web-solid-test-basic/issues.
SEE ALSO
AUTHOR
Kjetil Kjernsmo <kjetilk@cpan.org>.
COPYRIGHT AND LICENCE
This software is Copyright (c) 2019 by Inrupt Inc.
This is free software, licensed under:
The MIT (X11) License
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.