Permalink
Browse files

show test name at head of EXPECT output

git-svn-id: http://svn.php.net/repository/pear/packages/XML_Util/trunk@259124 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 2ab8f3c commit 009017e8a05dd8bf9904a92acd97b89eca86184d Chuck Burgess committed May 5, 2008
@@ -6,10 +6,13 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::apiVersion() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: basic apiVersion() call" . PHP_EOL;
echo XML_Util::apiVersion() . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::apiVersion() basic tests=====
+
TEST: basic apiVersion() call
1.1
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::attributesToString() basic tests=====' . PHP_EOL . PHP_EOL;
$att = array("foo" => "bar", "boo" => "baz");
@@ -51,6 +52,8 @@ echo XML_Util::attributesToString($arr, true, false, ' ', PHP_EOL,
XML_UTIL_ENTITIES_HTML) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::attributesToString() basic tests=====
+
TEST: basic usage
boo="baz" foo="bar"
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::collapseEmptyTags() basic tests=====' . PHP_EOL . PHP_EOL;
$emptyTag = "<foo></foo>";
$otherTag = "<bar>baz</bar>";
@@ -30,6 +31,8 @@ echo "TEST: one empty tag alongside non-empty tag, with COLLAPSE_XHTML_ONLY set
echo XML_Util::collapseEmptyTags($emptyTag . $xhtmlTag . $otherTag, XML_UTIL_COLLAPSE_XHTML_ONLY) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::collapseEmptyTags() basic tests=====
+
TEST: basic usage
<foo />
@@ -6,10 +6,13 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::createCDataSection() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: basic usage" . PHP_EOL;
echo XML_Util::createCDataSection("I am content.") . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::createCDataSection() basic tests=====
+
TEST: basic usage
<![CDATA[I am content.]]>
@@ -6,10 +6,13 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::createComment() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: basic usage" . PHP_EOL;
echo XML_Util::createComment("I am comment.") . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::createComment() basic tests=====
+
TEST: basic usage
<!-- I am comment. -->
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::createEndElement() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: basic usage (myTag)" . PHP_EOL;
echo XML_Util::createEndElement("myTag") . PHP_EOL . PHP_EOL;
@@ -14,6 +15,8 @@ echo "TEST: basic usage with a namespaced tag (myNs:myTag)" . PHP_EOL;
echo XML_Util::createEndElement("myNs:myTag") . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::createEndElement() basic tests=====
+
TEST: basic usage (myTag)
</myTag>
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::createStartElement() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: tag only" . PHP_EOL;
echo XML_Util::createStartElement(
@@ -75,6 +76,8 @@ echo XML_Util::createStartElement(
) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::createStartElement() basic tests=====
+
TEST: tag only
<myNs:myTag>
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::createTag() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: tag with attribute" . PHP_EOL;
echo XML_Util::createTag(
@@ -116,6 +117,8 @@ echo XML_Util::createTag(
) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::createTag() basic tests=====
+
TEST: tag with attribute
<myNs:myTag foo="bar" />
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::createTagFromArray() basic tests=====' . PHP_EOL . PHP_EOL;
$bad = array(
"foo" => "bar",
@@ -93,6 +94,8 @@ echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, an
echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES, true, ' ', '^', false) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::createTagFromArray() basic tests=====
+
TEST: basic usage with an invalid array
You must either supply a qualified name (qname) or local tag name (localPart).
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::getDocTypeDeclaration() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: using root only" . PHP_EOL;
echo XML_Util::getDocTypeDeclaration("rootTag") . PHP_EOL . PHP_EOL;
@@ -14,6 +15,8 @@ echo "TEST: using root and URI" . PHP_EOL;
echo XML_Util::getDocTypeDeclaration("rootTag", "myDocType.dtd") . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::getDocTypeDeclaration() basic tests=====
+
TEST: using root only
<!DOCTYPE rootTag>
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::getXmlDeclaration() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: using version only" . PHP_EOL;
echo XML_Util::getXMLDeclaration("1.0") . PHP_EOL . PHP_EOL;
@@ -20,6 +21,8 @@ echo "TEST: using version and standalone flag" . PHP_EOL;
echo XML_Util::getXMLDeclaration("1.0", null, true) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::getXmlDeclaration() basic tests=====
+
TEST: using version only
<?xml version="1.0"?>
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::isValidName() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: valid tag" . PHP_EOL;
$result = XML_Util::isValidName("alpha-x_y_z.123");
@@ -24,6 +25,8 @@ if (is_a($result, 'PEAR_Error')) {
}
?>
--EXPECT--
+=====XML_Util::isValidName() basic tests=====
+
TEST: valid tag
Valid XML name.
@@ -6,11 +6,14 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::raiseError() basic tests=====' . PHP_EOL . PHP_EOL;
$error = XML_Util::raiseError("I am an error", 12345);
if (is_a($error, 'PEAR_Error')) {
print "PEAR Error: " . $error->getMessage() . PHP_EOL;
}
?>
--EXPECT--
+=====XML_Util::raiseError() basic tests=====
+
PEAR Error: I am an error
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::replaceEntities() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: basic usage" . PHP_EOL;
echo XML_Util::replaceEntities("This string contains < & >.") . PHP_EOL . PHP_EOL;
@@ -20,6 +21,8 @@ echo "TEST: basic usage with ENTITIES_HTML" . PHP_EOL;
echo XML_Util::replaceEntities("This string contains < & >.", XML_UTIL_ENTITIES_HTML) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::replaceEntities() basic tests=====
+
TEST: basic usage
This string contains &lt; &amp; &gt;.
@@ -31,3 +34,4 @@ This string contains &lt; &amp; >.
TEST: basic usage with ENTITIES_HTML
This string contains &lt; &amp; &gt;.
+
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::reverseEntities() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: basic usage" . PHP_EOL;
echo XML_Util::reverseEntities("This string contains &lt; &amp; &gt;.") . PHP_EOL . PHP_EOL;
@@ -20,6 +21,8 @@ echo "TEST: basic usage with ENTITIES_HTML" . PHP_EOL;
echo XML_Util::reverseEntities("This string contains &lt; &amp; &gt;.", XML_UTIL_ENTITIES_HTML) . PHP_EOL . PHP_EOL;
?>
--EXPECT--
+=====XML_Util::reverseEntities() basic tests=====
+
TEST: basic usage
This string contains < & >.
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util::splitQualifiedName() basic tests=====' . PHP_EOL . PHP_EOL;
echo "TEST: basic usage without namespace" . PHP_EOL;
$return = XML_Util::splitQualifiedName("xslt:stylesheet");
@@ -20,6 +21,8 @@ echo "localPart => " . $return['localPart'] . PHP_EOL;
echo PHP_EOL;
?>
--EXPECT--
+=====XML_Util::splitQualifiedName() basic tests=====
+
TEST: basic usage without namespace
namespace => xslt
localPart => stylesheet
View
@@ -6,12 +6,16 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util tests for Bug #4950 "Incorrect CDATA serializing"=====' . PHP_EOL . PHP_EOL;
echo "TEST: test case provided in bug report" . PHP_EOL;
echo XML_Util::createTag("test", array(), "Content ]]></test> here!",
- null, XML_UTIL_CDATA_SECTION);
+ null, XML_UTIL_CDATA_SECTION) . PHP_EOL;
?>
--EXPECT--
+=====XML_Util tests for Bug #4950 "Incorrect CDATA serializing"=====
+
TEST: test case provided in bug report
<test><![CDATA[Content ]]]]><![CDATA[></test> here!]]></test>
+
View
@@ -6,6 +6,7 @@ Chuck Burgess <ashnazg@php.net>
--FILE--
<?php
require_once 'XML' . DIRECTORY_SEPARATOR . 'Util.php';
+echo '=====XML_Util tests for Bug #5392 "encoding of ISO-8859-1 is the only supported encoding"=====' . PHP_EOL . PHP_EOL;
echo "TEST: test case provided in bug report" . PHP_EOL;
$data = 'This data contains special chars like'
@@ -23,6 +24,7 @@ if ($util == $utf8) {
?>
--EXPECT--
+=====XML_Util tests for Bug #5392 "encoding of ISO-8859-1 is the only supported encoding"=====
TEST: test case provided in bug report
This data contains special chars like &lt;, &gt;, &amp; and &quot; as well as ä, ö, ß, à and ê
This data contains special chars like &lt;, &gt;, &amp; and &quot; as well as ä, ö, ß, à and ê

0 comments on commit 009017e

Please sign in to comment.