# $Id: 06detailed.t 41 2004-05-09 13:28:03Z struan $ use Test::More; use WebService::Validator::HTML::W3C; my $test_num = 5; if ( $ENV{ 'TEST_AUTHOR' } ) { $test_num = 6; } plan tests => $test_num; my $v = WebService::Validator::HTML::W3C->new( http_timeout => 10, detailed => 1, output => 'soap12', ); SKIP: { skip "XML::XPath not installed", $test_num if -f 't/SKIPXPATH'; ok($v, 'object created'); if ( $ENV{ 'TEST_AUTHOR' } ) { my $r = $v->validate('http://exo.org.uk/code/www-w3c-validator/warning.html'); unless ($r) { if ($v->validator_error eq "Could not contact validator") { skip "failed to contact validator", 5; } } ok ($r, 'page validated'); } else { $v->_content( qq{ http://exo.org.uk/ http://qa-dev.w3.org/wmvs/HEAD/ -//W3C//DTD XHTML 1.0 Strict//EN iso-8859-1 true 1 11 6 end tag for "div" omitted, but OMITTAG NO was specified 1 No DOCTYPE found! Attempting validation with XHTML 1.0 }); } my $err = $v->warnings->[0]; isa_ok($err, 'WebService::Validator::HTML::W3C::Warning'); is($err->line, undef, 'Correct line number'); is($err->col, undef, 'Correct column'); like($err->msg, qr/No DOCTYPE found! Attempting validation with XHTML 1.0/, 'Correct message'); }