FormHandler/Test.pm

filter: Statementstmt 100% 36 / 36 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 97.7% 43 / 44 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« FormHandler/Field/Integer.pm ↑ Summary FormHandler/Field/DateMDY.pm »
1 package HTML::FormHandler::Test;
2 # ABSTRACT: provides is_html method used in tests
3 59 $HTML::FormHandler::Test::VERSION = '0.410002';
4 59 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 59 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 59 ▶use base 'Test::Builder::Module';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 59 ▶use HTML::TreeBuilder;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 59 ▶use Test::Builder::Module;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 59 our @EXPORT = ('is_html');
10 59 ▶use Encode ('decode');
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13 193 ▶sub is_html {
Subroutine is_html: called CC=1 SCAR=0.0
Pod undocumented
14 193 my ( $got, $expected, $message ) = @_;
15 193 my $t1 = HTML::TreeBuilder->new;
16 193 my $t2 = HTML::TreeBuilder->new;
17  
18 193 $got = decode('utf8', $got);
19 193 $expected = decode('utf8', $expected);
20 193 $t1->parse($got);
21 193 $t1->eof;
22 193 $t2->parse($expected);
23 193 $t2->eof;
24 193 my $out1 = $t1->as_XML;
25 193 my $out2 = $t2->as_XML;
26 193 $t1->delete;
27 193 $t2->delete;
28 193 my $tb = HTML::FormHandler::Test->builder;
29 193 return $tb->is_eq($out1, $out2, $message);
30 }
31  
32 59 1;
33  
34 __END__
« FormHandler/Field/Integer.pm ↑ Summary FormHandler/Field/DateMDY.pm »