?¡ëPNG  IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À? ¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/user1137782/www/china1.by/classwithtostring.php on line 86

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217

Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
Console_Getopt/tests/001-getopt.phpt000066600000002316150500457250013340 0ustar00--TEST-- Console_Getopt --FILE-- $d) { if ($i++ > 0) { print ", "; } print $d[0] . '=' . $d[1]; } print "\n"; print "params: " . implode(", ", $non_opts) . "\n"; print "\n"; } test("-abc", "abc"); test("-abc foo", "abc"); test("-abc foo", "abc:"); test("-abc foo bar gazonk", "abc"); test("-abc foo bar gazonk", "abc:"); test("-a -b -c", "abc"); test("-a -b -c", "abc:"); test("-abc", "ab:c"); test("-abc foo -bar gazonk", "abc"); ?> --EXPECT-- options: a=, b=, c= params: options: a=, b=, c= params: foo options: a=, b=, c=foo params: options: a=, b=, c= params: foo, bar, gazonk options: a=, b=, c=foo params: bar, gazonk options: a=, b=, c= params: Console_Getopt: option requires an argument --c options: a=, b=c params: options: a=, b=, c= params: foo, -bar, gazonk Console_Getopt/tests/bug13140.phpt000066600000002505150500457250012706 0ustar00--TEST-- Console_Getopt [bug 13140] --SKIPIF-- --FILE-- getopt2($cg->readPHPArgv(), 't', array('test'), true)); print_r($cg->getopt2($cg->readPHPArgv(), 'bar', array('foo'), true)); ?> --EXPECT-- Array ( [0] => Array ( [0] => Array ( [0] => --test [1] => ) ) [1] => Array ( [0] => thisshouldbehere ) ) Array ( [0] => Array ( [0] => Array ( [0] => --foo [1] => ) [1] => Array ( [0] => b [1] => ) [2] => Array ( [0] => a [1] => ) [3] => Array ( [0] => r [1] => ) [4] => Array ( [0] => r [1] => ) ) [1] => Array ( [0] => thisshouldbehere ) ) Console_Getopt/tests/bug11068.phpt000066600000001431150500457250012712 0ustar00--TEST-- Console_Getopt [bug 11068] --SKIPIF-- --FILE-- getMessage()."\n"; echo 'FATAL'; exit; } print_r($ret); ?> --EXPECT-- Array ( [0] => Array ( [0] => Array ( [0] => f [1] => jjohnston@mail.com ) [1] => Array ( [0] => --to [1] => hi ) ) [1] => Array ( [0] => - ) )Console_Getopt/tests/bug10557.phpt000066600000000756150500457250012725 0ustar00--TEST-- Console_Getopt [bug 10557] --SKIPIF-- --FILE-- getMessage()."\n"; echo 'FATAL'; exit; } print_r($ret); ?> --EXPECT-- Console_Getopt: option requires an argument --to FATALXML_Util/tests/testBasic_getDocTypeDeclaration.phpt000066600000002754150500457250016475 0ustar00--TEST-- XML_Util::getDocTypeDeclaration() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- 'http://pear.php.net/dtd/package-1.0', 'id' => '-//PHP//PEAR/DTD PACKAGE 0.1' ); $dtdEntry = ''; echo "TEST: using root and an array URI" . PHP_EOL; echo XML_Util::getDocTypeDeclaration("rootTag", $uri) . PHP_EOL . PHP_EOL; echo "TEST: using root and an array URI and an internal DTD entry" . PHP_EOL; echo XML_Util::getDocTypeDeclaration("rootTag", $uri, $dtdEntry) . PHP_EOL . PHP_EOL; ?> --EXPECT-- =====XML_Util::getDocTypeDeclaration() basic tests===== TEST: using root only TEST: using root and a string URI TEST: using root and an array URI TEST: using root and an array URI and an internal DTD entry ]> XML_Util/tests/testBasic_reverseEntities.phpt000066600000006241150500457250015433 0ustar00--TEST-- XML_Util::reverseEntities() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- --EXPECT-- =====XML_Util::reverseEntities() basic tests===== TEST: basic usage This string contains < & >. TEST: basic usage but with bogus $replaceEntities arg This string contains < & >. TEST: basic usage with ENTITIES_XML This string contains < & >. TEST: basic usage with ENTITIES_XML and UTF-8 This string contains < & >. TEST: utf8 usage with ENTITIES_XML and UTF-8 This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê TEST: basic usage with ENTITIES_XML_REQUIRED This string contains < & >. TEST: basic usage with ENTITIES_XML_REQUIRED and UTF-8 This string contains < & >. TEST: utf8 usage with ENTITIES_XML_REQUIRED and UTF-8 This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê TEST: basic usage with ENTITIES_HTML This string contains < & >. TEST: basic usage with ENTITIES_HTML and UTF-8 This string contains < & >. TEST: utf8 usage with ENTITIES_HTML and UTF-8 This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê XML_Util/tests/testBasic_createTag.phpt000066600000013434150500457250014154 0ustar00--TEST-- XML_Util::createTag() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- "bar") ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute and content" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag" ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, and namespace" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag", "http://www.w3c.org/myNs#" ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, and REPLACE_ENTITIES" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_REPLACE_ENTITIES ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, and CDATA_SECTION" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_CDATA_SECTION ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, and multiline = false" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_REPLACE_ENTITIES, false ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, and multiline = true" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_REPLACE_ENTITIES, true ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, and indent = (2 spaces)" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_REPLACE_ENTITIES, true, ' ' ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, indent = (2 spaces), and linebreak = '^'" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_REPLACE_ENTITIES, true, ' ', '^' ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = true" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar", "boo" => "baz"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_REPLACE_ENTITIES, true, ' ', '^', true ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = false" . PHP_EOL; echo XML_Util::createTag( "myNs:myTag", array("foo" => "bar", "boo" => "baz"), "This is inside the tag and has < & @ > in it", "http://www.w3c.org/myNs#", XML_UTIL_REPLACE_ENTITIES, true, ' ', '^', false ) . PHP_EOL . PHP_EOL; ?> --EXPECT-- =====XML_Util::createTag() basic tests===== TEST: tag with attribute TEST: tag with attribute and content This is inside the tag TEST: tag with attribute, content, and namespace This is inside the tag TEST: tag with attribute, content, namespace, and REPLACE_ENTITIES This is inside the tag and has < & @ > in it TEST: tag with attribute, content, namespace, and CDATA_SECTION in it]]> TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, and multiline = false This is inside the tag and has < & @ > in it TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, and multiline = true This is inside the tag and has < & @ > in it TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, and indent = (2 spaces) This is inside the tag and has < & @ > in it TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, indent = (2 spaces), and linebreak = '^' This is inside the tag and has < & @ > in it TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = true This is inside the tag and has < & @ > in it TEST: tag with attribute, content, namespace, REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = false This is inside the tag and has < & @ > in it XML_Util/tests/testBasic_createCDataSection.phpt000066600000000756150500457250015745 0ustar00--TEST-- XML_Util::createCDataSection() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- --EXPECT-- =====XML_Util::createCDataSection() basic tests===== TEST: basic usage XML_Util/tests/testBasic_collapseEmptyTags.phpt000066600000003403150500457250015710 0ustar00--TEST-- XML_Util::collapseEmptyTags() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- "; $otherTag = "baz"; $xhtmlTag = ""; echo "TEST: basic usage" . PHP_EOL; echo XML_Util::collapseEmptyTags($emptyTag) . PHP_EOL . PHP_EOL; echo "TEST: basic usage alongside non-empty tag" . PHP_EOL; echo XML_Util::collapseEmptyTags($emptyTag . $otherTag) . PHP_EOL . PHP_EOL; echo "TEST: one empty tag, with COLLAPSE_ALL set" . PHP_EOL; echo XML_Util::collapseEmptyTags($emptyTag, XML_UTIL_COLLAPSE_ALL) . PHP_EOL . PHP_EOL; echo "TEST: one empty tag alongside non-empty tag, with COLLAPSE_ALL set" . PHP_EOL; echo XML_Util::collapseEmptyTags($emptyTag . $otherTag, XML_UTIL_COLLAPSE_ALL) . PHP_EOL . PHP_EOL; echo "TEST: one empty tag, with COLLAPSE_XHTML_ONLY set" . PHP_EOL; echo XML_Util::collapseEmptyTags($emptyTag, XML_UTIL_COLLAPSE_XHTML_ONLY) . PHP_EOL . PHP_EOL; echo "TEST: one empty tag alongside non-empty tag, with COLLAPSE_XHTML_ONLY set" . PHP_EOL; 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 TEST: basic usage alongside non-empty tag baz TEST: one empty tag, with COLLAPSE_ALL set TEST: one empty tag alongside non-empty tag, with COLLAPSE_ALL set baz TEST: one empty tag, with COLLAPSE_XHTML_ONLY set TEST: one empty tag alongside non-empty tag, with COLLAPSE_XHTML_ONLY set baz XML_Util/tests/testBasic_createEndElement.phpt000066600000001270150500457250015454 0ustar00--TEST-- XML_Util::createEndElement() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- --EXPECT-- =====XML_Util::createEndElement() basic tests===== TEST: basic usage (myTag) TEST: basic usage with a namespaced tag (myNs:myTag) XML_Util/tests/testBasic_raiseError.phpt000066600000000766150500457250014376 0ustar00--TEST-- XML_Util::raiseError() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- getMessage() . PHP_EOL; } ?> --EXPECT-- =====XML_Util::raiseError() basic tests===== PEAR Error: I am an error XML_Util/tests/testBasic_isValidName.phpt000066600000002602150500457250014444 0ustar00--TEST-- XML_Util::isValidName() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- getMessage() . PHP_EOL . PHP_EOL; } else { print "Valid XML name." . PHP_EOL . PHP_EOL; } echo "TEST: invalid tag" . PHP_EOL; $result = XML_Util::isValidName("invalidTag?"); if (is_a($result, 'PEAR_Error')) { print "Invalid XML name: " . $result->getMessage() . PHP_EOL . PHP_EOL; } else { print "Valid XML name." . PHP_EOL . PHP_EOL; } echo "TEST: invalid tag that doesn't start with a letter" . PHP_EOL; $result = XML_Util::isValidName("1234five"); if (is_a($result, 'PEAR_Error')) { print "Invalid XML name: " . $result->getMessage() . PHP_EOL . PHP_EOL; } else { print "Valid XML name." . PHP_EOL . PHP_EOL; } ?> --EXPECT-- =====XML_Util::isValidName() basic tests===== TEST: valid tag Valid XML name. TEST: invalid tag Invalid XML name: XML names may only contain alphanumeric chars, period, hyphen, colon and underscores TEST: invalid tag that doesn't start with a letter Invalid XML name: XML names may only start with letter or underscore XML_Util/tests/testBasic_getXmlDeclaration.phpt000066600000002217150500457250015660 0ustar00--TEST-- XML_Util::getXmlDeclaration() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- --EXPECT-- =====XML_Util::getXmlDeclaration() basic tests===== TEST: using version only TEST: using version and encoding TEST: using version, encoding, and standalone flag TEST: using version and standalone flag XML_Util/tests/testBasic_createStartElement.phpt000066600000007275150500457250016056 0ustar00--TEST-- XML_Util::createStartElement() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- "bar") ) . PHP_EOL . PHP_EOL; echo "TEST: tag only, passing '' as attribute arg" . PHP_EOL; echo XML_Util::createStartElement( 'myNs:myTag', '' ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attributes and namespace" . PHP_EOL; echo XML_Util::createStartElement( "myNs:myTag", array("foo" => "bar"), "http://www.w3c.org/myNs#" ) . PHP_EOL . PHP_EOL; echo "TEST: tag with empty attributes, whose namespaceUri is not a full namespace" . PHP_EOL; echo XML_Util::createStartElement( 'myTag', '', 'foo' ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attributes, namespace, and multiline = true" . PHP_EOL; echo XML_Util::createStartElement( "myNs:myTag", array("foo" => "bar"), "http://www.w3c.org/myNs#", true ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attributes, namespace, multiline = true, and indent = (2 spaces only)" . PHP_EOL; echo XML_Util::createStartElement( "myNs:myTag", array("foo" => "bar"), "http://www.w3c.org/myNs#", true, ' ' ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only), and linebreak = '^'" . PHP_EOL; echo XML_Util::createStartElement( "myNs:myTag", array("foo" => "bar"), "http://www.w3c.org/myNs#", true, ' ', '^' ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only), linebreak = '^', and sortAttributes = true" . PHP_EOL; echo XML_Util::createStartElement( "myNs:myTag", array("foo" => "bar", "boo" => "baz"), "http://www.w3c.org/myNs#", true, ' ', '^', true ) . PHP_EOL . PHP_EOL; echo "TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only), linebreak = '^', and sortAttributes = false" . PHP_EOL; echo XML_Util::createStartElement( "myNs:myTag", array("foo" => "bar", "boo" => "baz"), "http://www.w3c.org/myNs#", true, ' ', '^', false ) . PHP_EOL . PHP_EOL; ?> --EXPECT-- =====XML_Util::createStartElement() basic tests===== TEST: tag only TEST: tag with attributes TEST: tag only, passing '' as attribute arg TEST: tag with attributes and namespace TEST: tag with empty attributes, whose namespaceUri is not a full namespace TEST: tag with attributes, namespace, and multiline = true TEST: tag with attributes, namespace, multiline = true, and indent = (2 spaces only) TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only), and linebreak = '^' TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only), linebreak = '^', and sortAttributes = true TEST: tag with attributes, namespace, multiline = true, indent = (2 spaces only), linebreak = '^', and sortAttributes = false XML_Util/tests/testBasic_createComment.phpt000066600000000727150500457250015044 0ustar00--TEST-- XML_Util::createComment() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- --EXPECT-- =====XML_Util::createComment() basic tests===== TEST: basic usage XML_Util/tests/testBasic_apiVersion.phpt000066600000000701150500457250014365 0ustar00--TEST-- XML_Util::apiVersion() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- --EXPECT-- =====XML_Util::apiVersion() basic tests===== TEST: basic apiVersion() call 1.1 XML_Util/tests/testBug_18343.phpt000066600000006223150500457250012431 0ustar00--TEST-- XML_Util tests for Bug #18343 Entities in file names decoded during packaging --CREDITS-- Chuck Burgess # created for v1.2.2a1 2014-06-03 --FILE-- "install", "attributes" => array( "as" => "Horde/Feed/fixtures/lexicon/http-p.moreover.com-cgi-local-page%2Fo=rss&s=Newsweek", "name" => "test/Horde/Feed/fixtures/lexicon/http-p.moreover.com-cgi-local-page%2Fo=rss&s=Newsweek", ) ); echo "No matter what flags are given to createTagFromArray(), an attribute must *always* be at least ENTITIES_XML encoded..." . PHP_EOL . PHP_EOL; $flags = array( 'no flag' => null, 'false' => false, 'ENTITIES_NONE' => XML_UTIL_ENTITIES_NONE, 'ENTITIES_XML' => XML_UTIL_ENTITIES_XML, 'ENTITIES_XML_REQUIRED' => XML_UTIL_ENTITIES_XML_REQUIRED, 'ENTITIES_HTML' => XML_UTIL_ENTITIES_HTML, 'REPLACE_ENTITIES' => XML_UTIL_REPLACE_ENTITIES, ); foreach ($flags as $flagKey => $flagValue) { echo "Testing with $flagKey:" . PHP_EOL; echo XML_Util::createTagFromArray($array, $flagValue) . PHP_EOL . PHP_EOL; } ?> --EXPECT-- =====XML_Util tests for Bug #18343 "Entities in file names decoded during packaging"===== TEST: test case provided in bug report No matter what flags are given to createTagFromArray(), an attribute must *always* be at least ENTITIES_XML encoded... Testing with no flag: Testing with false: Testing with ENTITIES_NONE: Testing with ENTITIES_XML: Testing with ENTITIES_XML_REQUIRED: Testing with ENTITIES_HTML: Testing with REPLACE_ENTITIES: XML_Util/tests/testBasic_attributesToString.phpt000066600000007057150500457250016141 0ustar00--TEST-- XML_Util::attributesToString() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- "bar", "boo" => "baz"); $sort1 = array( 'multiline' => true, 'indent' => '----', 'linebreak' => "^", 'entities' => XML_UTIL_ENTITIES_XML, 'sort' => true ); $sort2 = array( 'multiline' => true, 'indent' => '----', 'linebreak' => "^", 'entities' => XML_UTIL_ENTITIES_XML, ); echo "TEST: basic usage" . PHP_EOL; echo XML_Util::attributesToString($att) . PHP_EOL . PHP_EOL; echo "TEST: explicit \$sort = true" . PHP_EOL; echo XML_Util::attributesToString($att, true) . PHP_EOL . PHP_EOL; echo "TEST: explicit \$sort = false" . PHP_EOL; echo XML_Util::attributesToString($att, false) . PHP_EOL . PHP_EOL; echo "TEST: explicit \$multiline = false" . PHP_EOL; echo XML_Util::attributesToString($att, true, false) . PHP_EOL . PHP_EOL; echo "TEST: explicit \$multiline = true" . PHP_EOL; echo XML_Util::attributesToString($att, true, true) . PHP_EOL . PHP_EOL; echo "TEST: explicit \$indent = ' ' (8 spaces)" . PHP_EOL; echo XML_Util::attributesToString($att, true, true, ' ') . PHP_EOL . PHP_EOL; echo "TEST: explicit \$linebreak = '^' (some dummy char)" . PHP_EOL; echo XML_Util::attributesToString($att, true, true, '^') . PHP_EOL . PHP_EOL; echo "TEST: passing \$sort array of options that includes 'sort'" . PHP_EOL; echo XML_Util::attributesToString($att, $sort1) . PHP_EOL . PHP_EOL; echo "TEST: passing \$sort array of options that doesn't include 'sort'" . PHP_EOL; echo XML_Util::attributesToString($att, $sort2) . PHP_EOL . PHP_EOL; echo "TEST: do not replace entities" . PHP_EOL; $arr = array("foo" => "b@&r", "boo" => "b> "b@&r", "boo" => "b> "b@&r", "boo" => "b> "b@&r", "boo" => "b> --EXPECT-- =====XML_Util::attributesToString() basic tests===== TEST: basic usage boo="baz" foo="bar" TEST: explicit $sort = true boo="baz" foo="bar" TEST: explicit $sort = false foo="bar" boo="baz" TEST: explicit $multiline = false boo="baz" foo="bar" TEST: explicit $multiline = true boo="baz" foo="bar" TEST: explicit $indent = ' ' (8 spaces) boo="baz" foo="bar" TEST: explicit $linebreak = '^' (some dummy char) boo="baz" ^foo="bar" TEST: passing $sort array of options that includes 'sort' boo="baz" ----foo="bar" TEST: passing $sort array of options that doesn't include 'sort' boo="baz" ----foo="bar" TEST: do not replace entities boo="b> # created for v1.2.0a1 2008-05-04 --FILE-- here!", null, XML_UTIL_CDATA_SECTION) . PHP_EOL; ?> --EXPECT-- =====XML_Util tests for Bug #4950 "Incorrect CDATA serializing"===== TEST: test case provided in bug report here!]]> XML_Util/tests/testBug_5392.phpt000066600000002111150500457250012341 0ustar00--TEST-- XML_Util tests for Bug #5392 "encoding of ISO-8859-1 is the only supported encoding" --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- , & and " as well as ä, ö, ß, à and ê'; $replaced = XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_HTML, 'UTF-8'); $reversed = XML_Util::reverseEntities($replaced, XML_UTIL_ENTITIES_HTML, 'UTF-8'); echo $replaced . PHP_EOL; echo $reversed . PHP_EOL; ?> --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 <, >, & and " as well as ä, ö, ß, à and ê This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê XML_Util/tests/testBasic_replaceEntities.phpt000066600000006260150500457250015374 0ustar00--TEST-- XML_Util::replaceEntities() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- .'; $utf8 = 'This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê'; echo "TEST: basic usage" . PHP_EOL; echo XML_Util::replaceEntities($data) . PHP_EOL . PHP_EOL; echo "TEST: basic usage but with bogus \$replaceEntities arg" . PHP_EOL; echo XML_Util::replaceEntities($data, 'I_AM_BOGUS') . PHP_EOL . PHP_EOL; echo "TEST: basic usage with ENTITIES_XML" . PHP_EOL; echo XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_XML) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with ENTITIES_XML and UTF-8" . PHP_EOL; echo XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_XML, 'UTF-8') . PHP_EOL . PHP_EOL; echo "TEST: utf8 usage with ENTITIES_XML and UTF-8" . PHP_EOL; echo XML_Util::replaceEntities($utf8, XML_UTIL_ENTITIES_XML, 'UTF-8') . PHP_EOL . PHP_EOL; echo "TEST: basic usage with ENTITIES_XML_REQUIRED" . PHP_EOL; echo XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_XML_REQUIRED) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with ENTITIES_XML_REQUIRED and UTF-8" . PHP_EOL; echo XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_XML_REQUIRED, 'UTF-8') . PHP_EOL . PHP_EOL; echo "TEST: utf8 usage with ENTITIES_XML_REQUIRED and UTF-8" . PHP_EOL; echo XML_Util::replaceEntities($utf8, XML_UTIL_ENTITIES_XML_REQUIRED, 'UTF-8') . PHP_EOL . PHP_EOL; echo "TEST: basic usage with ENTITIES_HTML" . PHP_EOL; echo XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_HTML) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with ENTITIES_HTML and UTF-8" . PHP_EOL; echo XML_Util::replaceEntities($data, XML_UTIL_ENTITIES_HTML, 'UTF-8') . PHP_EOL . PHP_EOL; echo "TEST: utf8 usage with ENTITIES_HTML and UTF-8" . PHP_EOL; echo XML_Util::replaceEntities($utf8, XML_UTIL_ENTITIES_HTML, 'UTF-8') . PHP_EOL . PHP_EOL; ?> --EXPECT-- =====XML_Util::replaceEntities() basic tests===== TEST: basic usage This string contains < & >. TEST: basic usage but with bogus $replaceEntities arg This string contains < & >. TEST: basic usage with ENTITIES_XML This string contains < & >. TEST: basic usage with ENTITIES_XML and UTF-8 This string contains < & >. TEST: utf8 usage with ENTITIES_XML and UTF-8 This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê TEST: basic usage with ENTITIES_XML_REQUIRED This string contains < & >. TEST: basic usage with ENTITIES_XML_REQUIRED and UTF-8 This string contains < & >. TEST: utf8 usage with ENTITIES_XML_REQUIRED and UTF-8 This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê TEST: basic usage with ENTITIES_HTML This string contains < & >. TEST: basic usage with ENTITIES_HTML and UTF-8 This string contains < & >. TEST: utf8 usage with ENTITIES_HTML and UTF-8 This data contains special chars like <, >, & and " as well as ä, ö, ß, à and ê XML_Util/tests/testBasic_splitQualifiedName.phpt000066600000001727150500457250016037 0ustar00--TEST-- XML_Util::splitQualifiedName() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- " . $return['namespace'] . PHP_EOL; echo "localPart => " . $return['localPart'] . PHP_EOL; echo PHP_EOL; echo "TEST: basic usage with namespace" . PHP_EOL; $return = XML_Util::splitQualifiedName("stylesheet", "myNs"); echo "namespace => " . $return['namespace'] . PHP_EOL; echo "localPart => " . $return['localPart'] . PHP_EOL; echo PHP_EOL; ?> --EXPECT-- =====XML_Util::splitQualifiedName() basic tests===== TEST: basic usage without namespace namespace => xslt localPart => stylesheet TEST: basic usage with namespace namespace => myNs localPart => stylesheet XML_Util/tests/testBasic_createTagFromArray.phpt000066600000022135150500457250015775 0ustar00--TEST-- XML_Util::createTagFromArray() basic tests --CREDITS-- Chuck Burgess # created for v1.2.0a1 2008-05-04 --FILE-- "bar", ); $tag1 = array( "qname" => "foo:bar", ); $tag2 = array( "qname" => "foo:bar", "namespaceUri" => "http://foo.com", ); $tag3 = array( "qname" => "foo:bar", "namespaceUri" => "http://foo.com", "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), ); $tag4 = array( "qname" => "foo:bar", "namespaceUri" => "http://foo.com", "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), "content" => "I'm inside the tag", ); $tag5 = array( "qname" => "foo:bar", "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), "content" => "I'm inside the tag", ); $tag6 = array( "qname" => "foo:bar", "namespaceUri" => "http://foo.com", "content" => "I'm inside the tag", ); $tag7 = array( "namespaceUri" => "http://foo.com", "attributes" => array( "key" => "value", "argh" => "fruit&vegetable" ), "content" => "I'm inside the tag", ); $tag8 = array( 'content' => array('foo', 'bar') ); $tag9 = array( 'qname' => 'foo:bar', 'namespaces' => array('ns1' => 'uri1', 'ns2' => 'uri2') ); $tag10 = array( 'namespace' => 'http://foo.org', 'localPart' => 'bar' ); $tag11 = array( 'namespace' => '', 'localPart' => 'bar' ); $tag12 = array( 'localPart' => 'foo', 'namespaceUri' => 'http://bar.org' ); echo "TEST: basic usage with an invalid array" . PHP_EOL; echo XML_Util::createTagFromArray($bad) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname only)" . PHP_EOL; echo XML_Util::createTagFromArray($tag1) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname and namespaceUri)" . PHP_EOL; echo XML_Util::createTagFromArray($tag2) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, and attributes)" . PHP_EOL; echo XML_Util::createTagFromArray($tag3) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content)" . PHP_EOL; echo XML_Util::createTagFromArray($tag4) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, attributes, and content)" . PHP_EOL; echo XML_Util::createTagFromArray($tag5) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, and content)" . PHP_EOL; echo XML_Util::createTagFromArray($tag6) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (namespaceUri, attributes, and content)" . PHP_EOL; echo XML_Util::createTagFromArray($tag7) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), plus REPLACE_ENTITIES" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), plus ENTITIES_NONE" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_ENTITIES_NONE) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, and multiline = false" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES, false) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, and multiline = true" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES, true) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, and indent = (2 spaces)" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES, true, ' ') . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, indent = (2 spaces), and linebreak = '^'" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES, true, ' ', '^') . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = true" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES, true, ' ', '^', true) . PHP_EOL . PHP_EOL; echo "TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = false" . PHP_EOL; echo XML_Util::createTagFromArray($tag4, XML_UTIL_REPLACE_ENTITIES, true, ' ', '^', false) . PHP_EOL . PHP_EOL; echo 'TEST: cause a non-scalar error on the content tag' . PHP_EOL; echo XML_Util::createTagFromArray($tag8) . PHP_EOL . PHP_EOL; echo 'TEST: handle an array of namespaces being passed' . PHP_EOL; echo XML_Util::createTagFromArray($tag9) . PHP_EOL . PHP_EOL; echo 'TEST: qname is derived from namespace + localPart' . PHP_EOL; echo XML_Util::createTagFromArray($tag10) . PHP_EOL . PHP_EOL; echo 'TEST: qname is derived from localPart only' . PHP_EOL; echo XML_Util::createTagFromArray($tag11) . PHP_EOL . PHP_EOL; echo 'TEST: namespaceUri is given, but namespace is not' . PHP_EOL; echo XML_Util::createTagFromArray($tag12) . 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). TEST: basic usage with a valid array (qname only) TEST: basic usage with a valid array (qname and namespaceUri) TEST: basic usage with a valid array (qname, namespaceUri, and attributes) TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content) I'm inside the tag TEST: basic usage with a valid array (qname, attributes, and content) I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, and content) I'm inside the tag TEST: basic usage with a valid array (namespaceUri, attributes, and content) You must either supply a qualified name (qname) or local tag name (localPart). TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), plus REPLACE_ENTITIES I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), plus ENTITIES_NONE I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, and multiline = false I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, and multiline = true I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, and indent = (2 spaces) I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, indent = (2 spaces), and linebreak = '^' I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = true I'm inside the tag TEST: basic usage with a valid array (qname, namespaceUri, attributes, and content), REPLACE_ENTITIES, multiline = true, indent = (2 spaces), linebreak = '^', and sortAttributes = false I'm inside the tag TEST: cause a non-scalar error on the content tag Supplied non-scalar value as tag content TEST: handle an array of namespaces being passed TEST: qname is derived from namespace + localPart TEST: qname is derived from localPart only TEST: namespaceUri is given, but namespace is not Structures_Graph/tests/AllTests.php000066600000000674150500457250013474 0ustar00addTestFiles($dir); return $suite; } } Structures_Graph/tests/helper.inc000066600000000533150500457250013174 0ustar00 | // +-----------------------------------------------------------------------------+ // require_once dirname(__FILE__) . '/helper.inc'; /** * @access private */ class BasicGraph extends PHPUnit_Framework_TestCase { var $_graph = null; function test_create_graph() { $this->_graph = new Structures_Graph(); $this->assertTrue(is_a($this->_graph, 'Structures_Graph')); } function test_add_node() { $this->_graph = new Structures_Graph(); $data = 1; $node = new Structures_Graph_Node($data); $this->_graph->addNode($node); $node = new Structures_Graph_Node($data); $this->_graph->addNode($node); $node = new Structures_Graph_Node($data); $this->_graph->addNode($node); } function test_connect_node() { $this->_graph = new Structures_Graph(); $data = 1; $node1 = new Structures_Graph_Node($data); $node2 = new Structures_Graph_Node($data); $this->_graph->addNode($node1); $this->_graph->addNode($node2); $node1->connectTo($node2); $node =& $this->_graph->getNodes(); $node =& $node[0]; $node = $node->getNeighbours(); $node =& $node[0]; /* ZE1 == and === operators fail on $node,$node2 because of the recursion introduced by the _graph field in the Node object. So, we'll use the stupid method for reference testing */ $node = true; $this->assertTrue($node2); $node = false; $this->assertFalse($node2); } function test_data_references() { $this->_graph = new Structures_Graph(); $data = 1; $node = new Structures_Graph_Node(); $node->setData($data); $this->_graph->addNode($node); $data = 2; $dataInNode =& $this->_graph->getNodes(); $dataInNode =& $dataInNode[0]; $dataInNode =& $dataInNode->getData(); $this->assertEquals($data, $dataInNode); } function test_metadata_references() { $this->_graph = new Structures_Graph(); $data = 1; $node = new Structures_Graph_Node(); $node->setMetadata('5', $data); $data = 2; $dataInNode =& $node->getMetadata('5'); $this->assertEquals($data, $dataInNode); } function test_metadata_key_exists() { $this->_graph = new Structures_Graph(); $data = 1; $node = new Structures_Graph_Node(); $node->setMetadata('5', $data); $this->assertTrue($node->metadataKeyExists('5')); $this->assertFalse($node->metadataKeyExists('1')); } function test_directed_degree() { $this->_graph = new Structures_Graph(true); $node = array(); $node[] = new Structures_Graph_Node(); $node[] = new Structures_Graph_Node(); $node[] = new Structures_Graph_Node(); $this->_graph->addNode($node[0]); $this->_graph->addNode($node[1]); $this->_graph->addNode($node[2]); $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 0 arcs'); $this->assertEquals(0, $node[1]->inDegree(), 'inDegree test failed for node 1 with 0 arcs'); $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 0 arcs'); $this->assertEquals(0, $node[0]->outDegree(), 'outDegree test failed for node 0 with 0 arcs'); $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 0 arcs'); $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 0 arcs'); $node[0]->connectTo($node[1]); $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 1 arc'); $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 1 arc'); $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 1 arc'); $this->assertEquals(1, $node[0]->outDegree(), 'outDegree test failed for node 0 with 1 arc'); $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 1 arc'); $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 1 arc'); $node[0]->connectTo($node[2]); $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 2 arcs'); $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 2 arcs'); $this->assertEquals(1, $node[2]->inDegree(), 'inDegree test failed for node 2 with 2 arcs'); $this->assertEquals(2, $node[0]->outDegree(), 'outDegree test failed for node 0 with 2 arcs'); $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 2 arcs'); $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 2 arcs'); } function test_undirected_degree() { $this->_graph = new Structures_Graph(false); $node = array(); $node[] = new Structures_Graph_Node(); $node[] = new Structures_Graph_Node(); $node[] = new Structures_Graph_Node(); $this->_graph->addNode($node[0]); $this->_graph->addNode($node[1]); $this->_graph->addNode($node[2]); $this->assertEquals(0, $node[0]->inDegree(), 'inDegree test failed for node 0 with 0 arcs'); $this->assertEquals(0, $node[1]->inDegree(), 'inDegree test failed for node 1 with 0 arcs'); $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 0 arcs'); $this->assertEquals(0, $node[0]->outDegree(), 'outDegree test failed for node 0 with 0 arcs'); $this->assertEquals(0, $node[1]->outDegree(), 'outDegree test failed for node 1 with 0 arcs'); $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 0 arcs'); $node[0]->connectTo($node[1]); $this->assertEquals(1, $node[0]->inDegree(), 'inDegree test failed for node 0 with 1 arc'); $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 1 arc'); $this->assertEquals(0, $node[2]->inDegree(), 'inDegree test failed for node 2 with 1 arc'); $this->assertEquals(1, $node[0]->outDegree(), 'outDegree test failed for node 0 with 1 arc'); $this->assertEquals(1, $node[1]->outDegree(), 'outDegree test failed for node 1 with 1 arc'); $this->assertEquals(0, $node[2]->outDegree(), 'outDegree test failed for node 2 with 1 arc'); $node[0]->connectTo($node[2]); $this->assertEquals(2, $node[0]->inDegree(), 'inDegree test failed for node 0 with 2 arcs'); $this->assertEquals(1, $node[1]->inDegree(), 'inDegree test failed for node 1 with 2 arcs'); $this->assertEquals(1, $node[2]->inDegree(), 'inDegree test failed for node 2 with 2 arcs'); $this->assertEquals(2, $node[0]->outDegree(), 'outDegree test failed for node 0 with 2 arcs'); $this->assertEquals(1, $node[1]->outDegree(), 'outDegree test failed for node 1 with 2 arcs'); $this->assertEquals(1, $node[2]->outDegree(), 'outDegree test failed for node 2 with 2 arcs'); } } ?> Structures_Graph/tests/AcyclicTestTest.php000066600000002434150500457250015004 0ustar00addNode($node1); $node2 = new Structures_Graph_Node(); $graph->addNode($node2); $node1->connectTo($node2); $node3 = new Structures_Graph_Node(); $graph->addNode($node3); $node2->connectTo($node3); $node3->connectTo($node1); $this->assertFalse( Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph), 'Graph is cyclic' ); } public function testIsAcyclicTrue() { $graph = new Structures_Graph(); $node1 = new Structures_Graph_Node(); $graph->addNode($node1); $node2 = new Structures_Graph_Node(); $graph->addNode($node2); $node1->connectTo($node2); $node3 = new Structures_Graph_Node(); $graph->addNode($node3); $node2->connectTo($node3); $this->assertTrue( Structures_Graph_Manipulator_AcyclicTest::isAcyclic($graph), 'Graph is acyclic' ); } } ?> Structures_Graph/tests/TopologicalSorterTest.php000066600000003525150500457250016252 0ustar00setData($name1); $graph->addNode($node1); $name11 = 'node11'; $node11 = new Structures_Graph_Node(); $node11->setData($name11); $graph->addNode($node11); $node1->connectTo($node11); $name12 = 'node12'; $node12 = new Structures_Graph_Node(); $node12->setData($name12); $graph->addNode($node12); $node1->connectTo($node12); $name121 = 'node121'; $node121 = new Structures_Graph_Node(); $node121->setData($name121); $graph->addNode($node121); $node12->connectTo($node121); $name2 = 'node2'; $node2 = new Structures_Graph_Node(); $node2->setData($name2); $graph->addNode($node2); $name21 = 'node21'; $node21 = new Structures_Graph_Node(); $node21->setData($name21); $graph->addNode($node21); $node2->connectTo($node21); $nodes = Structures_Graph_Manipulator_TopologicalSorter::sort($graph); $this->assertCount(2, $nodes[0]); $this->assertEquals('node1', $nodes[0][0]->getData()); $this->assertEquals('node2', $nodes[0][1]->getData()); $this->assertCount(3, $nodes[1]); $this->assertEquals('node11', $nodes[1][0]->getData()); $this->assertEquals('node12', $nodes[1][1]->getData()); $this->assertEquals('node21', $nodes[1][2]->getData()); $this->assertCount(1, $nodes[2]); $this->assertEquals('node121', $nodes[2][0]->getData()); } } ?>