Skip to content

Commit 3976a8c

Browse files
committed
add SKIPIFs so tests won't run if the environment doesn't have what they need
git-svn-id: https://svn.php.net/repository/pear/packages/XML_Parser/trunk@286924 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 2e550bd commit 3976a8c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

tests/005.phpt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
--TEST--
22
XML Parser: mixing character encodings
33
--SKIPIF--
4-
<?php if (!extension_loaded("xml")) echo 'skip'; ?>
4+
<?php
5+
if (!extension_loaded("xml")) {
6+
print 'skip - xml extension not available';
7+
}
8+
if (!extension_loaded('mbstring')) {
9+
print 'skip - exif extension not available';
10+
}
11+
?>
512
--FILE--
613
<?php // -*- C++ -*-
714
//
@@ -47,7 +54,7 @@ $input = array(
4754
"UTF-8" => "<a>abcæøå</a>",
4855

4956
/* are these special chars allowed in ISO-8859-1 context??? */
50-
"ISO-8859-1" => "<a>abcæøå</a>", // "ISO-8859-1" => "<a>abc¥<a>",
57+
"ISO-8859-1" => "<a>abc���</a>", // "ISO-8859-1" => "<a>abc<a>",
5158

5259
"US-ASCII" => "<a>abcaoa</a>"
5360
);
@@ -71,7 +78,7 @@ foreach ($input as $srcenc => $string) {
7178

7279
?>
7380
--EXPECT--
74-
Testing UTF-8 -> ISO-8859-1: string(13) "<A>abcæøå</A>"
81+
Testing UTF-8 -> ISO-8859-1: string(13) "<A>abc���</A>"
7582
Testing UTF-8 -> US-ASCII: string(13) "<A>abc???</A>"
7683
Testing ISO-8859-1 -> UTF-8: string(16) "<A>abcæøå</A>"
7784
Testing ISO-8859-1 -> US-ASCII: string(13) "<A>abc???</A>"

tests/bug-9328.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ XML Parser: test for Bug #9328 "assigned by reference error in XML_RSS parse"
77
*/
88
$originalErrorReporting = error_reporting();
99
error_reporting(E_ALL & ~E_WARNING);
10-
if ('OK' != (include_once 'XML/RSS.php')) {
11-
print('skip if XML_RSS is not installed');
10+
if (false == (include_once 'XML/RSS.php')) {
11+
print('skip - XML_RSS is not installed');
1212
}
1313
error_reporting($originalErrorReporting);
1414
?>

0 commit comments

Comments
 (0)