File: 13soap_wrong_format.t

package info (click to toggle)
libwebservice-validator-html-w3c-perl 0.28-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 293; makefile: 2
file content (47 lines) | stat: -r--r--r-- 1,642 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# $Id: 06detailed.t 41 2004-05-09 13:28:03Z struan $

use Test::More tests => 9;
use WebService::Validator::HTML::W3C;

my $v = WebService::Validator::HTML::W3C->new(
            detailed        =>  1,
            output          =>  'xml',
        );

SKIP: {
    skip "TEST_AUTHOR environment variable not defined", 9 unless $ENV{ 'TEST_AUTHOR' };
    skip "XML::XPath not installed", 9 if -f 't/SKIPXPATH';

    ok($v, 'object created');

    my $r = $v->validate('http://exo.org.uk/code/www-w3c-validator/invalid.html');

    unless ($r) {
        if ($v->validator_error eq "Could not contact validator")
        {
            skip "failed to contact validator", 8;
        }
    }

    ok ($r, 'page validated');
            
    $v->_output('soap12');
    is($v->errors, 0, 'Returned 0 for wrong format with SOAP');
    is($v->validator_error, 'Result format does not appear to be SOAP', 'Correct error returned for wrong format with SOAP');

    $r = $v->validate('http://exo.org.uk/code/www-w3c-validator/invalid.html');

    unless ($r) {
        if ($v->validator_error eq "Could not contact validator")
        {
            skip "failed to contact validator", 5;
        }
    }

    ok ($r, 'page validated');
    $v->_output('xml');
    is($v->errors, 0, 'Returned 0 for wrong format with XML');
    is($v->validator_error, 'Result format does not appear to be XML', 'Correct error returned for wrong format with XML');
    is($v->warnings, 0, 'Returned 0 for wrong format with warnings');
    is($v->validator_error, 'Warnings only available with SOAP output format', 'Correct error returned for warnings with xml output');
}