Lines 63-69
is( $engine->err, Koha::XSLT_Handler::XSLTH_ERR_5, 'Engine returns error on non-
Link Here
|
63 |
|
63 |
|
64 |
# Malformed XML tests |
64 |
# Malformed XML tests |
65 |
warning_like { $output = $engine->transform( '<a></b>', $xsltfile_1 ) } |
65 |
warning_like { $output = $engine->transform( '<a></b>', $xsltfile_1 ) } |
66 |
qr{parser error : Opening and ending tag mismatch: a line 1 and b}, |
66 |
qr{parser error : Opening and ending tag mismatch: a line (0|1) and b}, |
67 |
"Malformed XML warning correctly displayed"; |
67 |
"Malformed XML warning correctly displayed"; |
68 |
is( $engine->err, Koha::XSLT_Handler::XSLTH_ERR_5, 'Engine returns error on malformed xml' ); |
68 |
is( $engine->err, Koha::XSLT_Handler::XSLTH_ERR_5, 'Engine returns error on malformed xml' ); |
69 |
|
69 |
|
Lines 75-92
my $secondengine=Koha::XSLT_Handler->new( {
Link Here
|
75 |
}); |
75 |
}); |
76 |
$engine->do_not_return_source(1); |
76 |
$engine->do_not_return_source(1); |
77 |
warning_like { $output = $engine->transform( '<a></b>', $xsltfile_1 ) } |
77 |
warning_like { $output = $engine->transform( '<a></b>', $xsltfile_1 ) } |
78 |
qr{parser error : Opening and ending tag mismatch: a line 1 and b}, |
78 |
qr{parser error : Opening and ending tag mismatch: a line (0|1) and b}, |
79 |
"Malformed XML warning correctly displayed"; |
79 |
"Malformed XML warning correctly displayed"; |
80 |
is( defined $output? 1: 0, 0, 'Engine respects do_not_return_source==1'); |
80 |
is( defined $output? 1: 0, 0, 'Engine respects do_not_return_source==1'); |
81 |
$secondengine->print_warns(1); |
81 |
$secondengine->print_warns(1); |
82 |
warning_like { $output = $secondengine->transform( '<a></b>', $xsltfile_1 ) } |
82 |
warning_like { $output = $secondengine->transform( '<a></b>', $xsltfile_1 ) } |
83 |
qr{parser error : Opening and ending tag mismatch: a line 1 and b}, |
83 |
qr{parser error : Opening and ending tag mismatch: a line (0|1) and b}, |
84 |
"Malformed XML warning correctly displayed"; |
84 |
"Malformed XML warning correctly displayed"; |
85 |
is( defined $output? 1: 0, 0, 'Second engine respects it too'); |
85 |
is( defined $output? 1: 0, 0, 'Second engine respects it too'); |
86 |
undef $secondengine; #bye |
86 |
undef $secondengine; #bye |
87 |
$engine->do_not_return_source(0); |
87 |
$engine->do_not_return_source(0); |
88 |
warning_like { $output = $engine->transform( '<a></b>', $xsltfile_1 ) } |
88 |
warning_like { $output = $engine->transform( '<a></b>', $xsltfile_1 ) } |
89 |
qr{parser error : Opening and ending tag mismatch: a line 1 and b}, |
89 |
qr{parser error : Opening and ending tag mismatch: a line (0|1) and b}, |
90 |
"Malformed XML warning correctly displayed"; |
90 |
"Malformed XML warning correctly displayed"; |
91 |
is( defined $output? 1: 0, 1, 'Engine respects do_not_return_source==0'); |
91 |
is( defined $output? 1: 0, 1, 'Engine respects do_not_return_source==0'); |
92 |
|
92 |
|
93 |
- |
|
|