芝麻web文件管理V1.00
编辑当前文件:/home/conskgoa/doughi.co.uk/alt-php85-pecl-yaml_2.2.3-2.el8.tar
tests/yaml_parse_wiki_YtsBasicTests_004.phpt 0000644 00000001023 15220062747 0015172 0 ustar 00 --TEST-- Yaml YtsBasicTests - Deeply Nested Sequences --DESCRIPTION-- Sequences can be nested even deeper, with each level of indentation representing a level of depth. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { [0]=> array(1) { [0]=> array(2) { [0]=> string(3) "uno" [1]=> string(3) "dos" } } } tests/yaml_emit_008.phpt 0000644 00000002720 15220062747 0011160 0 ustar 00 --TEST-- yaml_emit - custom tags --SKIPIF-- --FILE-- '!emit008', 'data' => $obj->data, ); } } $emit_callbacks = array( 'Emit008Example' => array('Emit008Example', 'yamlEmit') ); $t = new Emit008Example(); $t->data = array ('a','b','c'); $yaml = yaml_emit( array( 'callback' => $t, ), YAML_ANY_ENCODING, YAML_ANY_BREAK, $emit_callbacks ); var_dump($yaml); /* make sure you can undo the custome serialization */ function parse_008 ($value, $tag, $flags) { $ret = new Emit008Example(); $ret->data = $value; return $ret; } $parse_callbacks = array( '!emit008' => 'parse_008', ); $array = yaml_parse($yaml, 0, $cnt, $parse_callbacks); var_dump($array['callback'] == $t); /* roundtrip with raw object */ var_dump($t == yaml_parse( yaml_emit($t, YAML_ANY_ENCODING, YAML_ANY_BREAK, $emit_callbacks), 0, $cnt, $parse_callbacks)); ?> --EXPECT-- string(39) "--- callback: !emit008 - a - b - c ... " bool(true) bool(true) tests/bug_72204.phpt 0000644 00000000620 15220062747 0010121 0 ustar 00 --TEST-- Test PECL bug #72204 --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["foo"]=> array(1) { ["bar"]=> bool(true) } ["baz"]=> array(1) { ["bar"]=> bool(false) } } tests/yaml_parse_wiki_YtsBlockMapping_003.phpt 0000644 00000001022 15220062747 0015472 0 ustar 00 --TEST-- Yaml YtsBlockMapping - Values aligned --DESCRIPTION-- Often times human editors of documents will align the values even though YAML emitters generally don't. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(3) { ["red"]=> string(5) "baron" ["white"]=> string(5) "walls" ["blue"]=> string(7) "berries" } tests/yaml_parse_spec_merge.phpt 0000644 00000002522 15220062747 0013136 0 ustar 00 --TEST-- Yaml 1.1 Spec - merge --SKIPIF-- --FILE-- --EXPECT-- array(8) { [0]=> array(2) { ["x"]=> int(1) ["y"]=> int(2) } [1]=> array(2) { ["x"]=> int(0) ["y"]=> int(2) } [2]=> array(1) { ["r"]=> int(10) } [3]=> array(1) { ["r"]=> int(1) } [4]=> array(4) { ["x"]=> int(1) ["y"]=> int(2) ["r"]=> int(10) ["label"]=> string(10) "center/big" } [5]=> array(4) { ["x"]=> int(1) ["y"]=> int(2) ["r"]=> int(10) ["label"]=> string(10) "center/big" } [6]=> array(4) { ["x"]=> int(1) ["y"]=> int(2) ["r"]=> int(10) ["label"]=> string(10) "center/big" } [7]=> array(4) { ["r"]=> int(10) ["x"]=> int(1) ["y"]=> int(2) ["label"]=> string(10) "center/big" } } tests/bug_69617.phpt 0000644 00000000472 15220062747 0010144 0 ustar 00 --TEST-- Test PECL bug #69617 --SKIPIF-- --FILE-- --EXPECT-- array(1) { ["a"]=> string(26) "O:1:"A":1:{s:3:"one";i:1;}" } tests/yaml_parse_wiki_YtsStrangeKeys_001.phpt 0000644 00000000602 15220062747 0015364 0 ustar 00 --TEST-- Yaml YtsStrangeKeys - Quoted line noise key --DESCRIPTION-- Check that quoted line noise parses as key. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { ["!@#%"]=> string(7) "bar baz" } tests/yaml_emit_007.phpt 0000644 00000000625 15220062747 0011161 0 ustar 00 --TEST-- yaml_emit - recursive structures --SKIPIF-- --FILE-- "a", "b" => "b", "c" => &$recursive, ); var_dump(yaml_emit($recursive)); // clean up a little or we may see false memory leak reports unset($recursive['c']); ?> --EXPECT-- string(56) "--- a: a b: b c: &refid1 a: a b: b c: *refid1 ... " tests/yaml_parse_file_001.phpt 0000644 00000003052 15220062747 0012323 0 ustar 00 --TEST-- yaml_parse_file - general --SKIPIF-- --INI-- yaml.decode_timestamp=1 date.timezone=GMT --FILE-- int(34843) ["date"]=> int(980208000) ["bill-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(27) "458 Walkman Dr. Suite #292 " ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["ship-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(27) "458 Walkman Dr. Suite #292 " ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["product"]=> array(2) { [0]=> array(4) { ["sku"]=> string(6) "BL394D" ["quantity"]=> int(4) ["description"]=> string(10) "Basketball" ["price"]=> float(450) } [1]=> array(4) { ["sku"]=> string(7) "BL4438H" ["quantity"]=> int(1) ["description"]=> string(10) "Super Hoop" ["price"]=> float(2392) } } ["tax"]=> float(251.42) ["total"]=> float(4443.52) ["comments"]=> string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338." } tests/bug_79866.phpt 0000644 00000002154 15220062747 0010152 0 ustar 00 --TEST-- Test PECL bug #79866 --SKIPIF-- --INI-- precision=14 serialize_precision=-1 --FILE-- 0, "1" => 1, "-1" => -1, "2." => 2., "2.0" => 2.0, "2.00" => 2.00, "2.000" => 2.000, "0.123456789" => 0.123456789, "-0.123456789" => -0.123456789, "2.3e6" => 2.3e6, "-2.3e6" => -2.3e6, "2.3e-6" => 2.3e-6, "-2.3e-6" => -2.3e-6, "INF" => INF, "NAN" => NAN, "0.000021" => 0.000021, ]; foreach( $floats as $idx => $float ) { $float = floatval($float); $got = yaml_emit($float); // Special case for NAN, which emits a warning with echo in PHP 8.5+ if (is_nan($float)) { $expect = "--- NAN\n...\n"; } else { // Original logic for all other floats ob_start(); echo $float; $native = ob_get_clean(); $expect = "--- {$native}\n...\n"; } if ( $got !== $expect ) { echo "== FAIL! {$idx} ==\n"; echo "expected:\n{$expect}\n"; echo "got:{$got}\n"; } } ?> --EXPECT-- tests/yaml_parse_spec_pairs.phpt 0000644 00000001636 15220062747 0013162 0 ustar 00 --TEST-- Yaml 1.1 Spec - pairs --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["Block tasks"]=> array(4) { [0]=> array(1) { ["meeting"]=> string(10) "with team." } [1]=> array(1) { ["meeting"]=> string(10) "with boss." } [2]=> array(1) { ["break"]=> string(6) "lunch." } [3]=> array(1) { ["meeting"]=> string(12) "with client." } } ["Flow tasks"]=> array(2) { [0]=> array(1) { ["meeting"]=> string(9) "with team" } [1]=> array(1) { ["meeting"]=> string(9) "with boss" } } } tests/yaml_parse_spec_timestamp.phpt 0000644 00000001331 15220062747 0014037 0 ustar 00 --TEST-- Yaml 1.1 Spec - timestamp --SKIPIF-- --INI-- yaml.decode_timestamp=1 date.timezone=GMT --FILE-- --EXPECT-- array(6) { ["canonical"]=> int(1008385183) ["valid iso8601"]=> int(1008385183) ["alternate iso8601"]=> int(1008385183) ["space separated"]=> int(1008385183) ["no time zone (Z)"]=> int(1008385183) ["date (00:00:00Z)"]=> int(1039824000) } tests/bug_59860.phpt 0000644 00000003164 15220062747 0010144 0 ustar 00 --TEST-- Test PECL bug #59860 --SKIPIF-- --FILE-- 'tag_callback', YAML_SEQ_TAG => 'tag_callback', )); ?> --EXPECT-- array(3) { [0]=> array(1) { ["a"]=> string(1) "b" } [1]=> string(21) "tag:yaml.org,2002:map" [2]=> int(0) } array(3) { [0]=> array(1) { ["c"]=> string(1) "d" } [1]=> string(21) "tag:yaml.org,2002:map" [2]=> int(0) } array(3) { [0]=> array(2) { [0]=> string(1) "e" [1]=> string(1) "f" } [1]=> string(21) "tag:yaml.org,2002:seq" [2]=> int(0) } array(3) { [0]=> array(2) { [0]=> string(1) "g" [1]=> string(1) "h" } [1]=> string(21) "tag:yaml.org,2002:seq" [2]=> int(0) } array(3) { [0]=> array(4) { ["implicit_map"]=> string(21) "tag:yaml.org,2002:map" ["explicit_map"]=> string(21) "tag:yaml.org,2002:map" ["implicit_seq"]=> string(21) "tag:yaml.org,2002:seq" ["explicit_seq"]=> string(21) "tag:yaml.org,2002:seq" } [1]=> string(21) "tag:yaml.org,2002:map" [2]=> int(0) } tests/yaml_parse_wiki_YtsBasicTests_007.phpt 0000644 00000001067 15220062747 0015205 0 ustar 00 --TEST-- Yaml YtsBasicTests - Nested Mappings --DESCRIPTION-- A value in a mapping can be another mapping. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["foo"]=> string(8) "whatever" ["bar"]=> array(3) { ["fruit"]=> string(5) "apple" ["name"]=> string(5) "steve" ["sport"]=> string(8) "baseball" } } tests/bug_61923.phpt 0000644 00000002234 15220062747 0010132 0 ustar 00 --TEST-- Test PECL bug #61923 --SKIPIF-- --INI-- serialize_precision=-1 --FILE-- --EXPECT-- array(2) { ["strings"]=> array(8) { [0]=> string(3) "1:0" [1]=> string(3) "0:1" [2]=> string(5) "1:0:0" [3]=> string(6) "+1:0:0" [4]=> string(6) "-1:0:0" [5]=> string(3) ":01" [6]=> string(2) ":1" [7]=> string(14) "18:53:17.00037" } ["numbers"]=> array(8) { [0]=> int(60) [1]=> int(1) [2]=> int(3600) [3]=> int(3600) [4]=> int(-3600) [5]=> int(1) [6]=> int(1) [7]=> float(67997.00037) } } string(161) "--- strings: - "1:0" - "0:1" - "1:0:0" - "+1:0:0" - "-1:0:0" - ":01" - ":1" - "18:53:17.00037" numbers: - 60 - 1 - 3600 - 3600 - -3600 - 1 - 1 - 67997.00037 ... " tests/bug_parsing_alias.phpt 0000644 00000001254 15220062747 0012263 0 ustar 00 --TEST-- Test PECL strange alias bug --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["basic"]=> array(1) { [0]=> array(1) { ["value"]=> int(22) } } ["keylevel0"]=> array(2) { ["keylevel1"]=> array(1) { ["value"]=> int(1) } ["keylevel1.1"]=> array(1) { ["keylevel2"]=> array(1) { ["value"]=> int(2) } } } } tests/yaml_parse_spec_int.phpt 0000644 00000000756 15220062747 0012640 0 ustar 00 --TEST-- Yaml 1.1 Spec - int --SKIPIF-- --FILE-- --EXPECT-- array(6) { ["canonical"]=> int(685230) ["decimal"]=> int(685230) ["octal"]=> int(685230) ["hexadecimal"]=> int(685230) ["binary"]=> int(685230) ["sexagesimal"]=> int(685230) } tests/bug_76309.phpt 0000644 00000000516 15220062747 0010137 0 ustar 00 --TEST-- Test PECL bug #76309 --SKIPIF-- --INI-- serialize_precision=-1 --FILE-- '1.0', 'b' => '2.', 'c' => '3', 'd' => '.', 'e' => 1.0, 'f' => 2., 'g' => 3, ] ); ?> --EXPECT-- --- a: "1.0" b: "2." c: "3" d: . e: 1 f: 2 g: 3 ... tests/yaml_parse_wiki_YtsBasicTests_001.phpt 0000644 00000001017 15220062747 0015172 0 ustar 00 --TEST-- Yaml YtsBasicTests - Simple Sequence --DESCRIPTION-- You can specify a list in YAML by placing each member of the list on a new line with an opening dash. These lists are called sequences. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(3) { [0]=> string(5) "apple" [1]=> string(6) "banana" [2]=> string(6) "carrot" } tests/bug_64694.phpt 0000644 00000000643 15220062747 0010144 0 ustar 00 --TEST-- Test PECL bug #64694 --SKIPIF-- --FILE-- --EXPECTF-- array(1) { ["[a]"]=> int(1) } Warning: yaml_parse(): Illegal offset type array (line 1, column 7) in %sbug_64694.php on line 12 array(0) { } tests/yaml_emit_005.phpt 0000644 00000000531 15220062747 0011153 0 ustar 00 --TEST-- yaml_emit - serializable --SKIPIF-- --FILE-- one; } } $a = new A; var_dump(yaml_emit(array('a' => $a))); ?> --EXPECT-- string(56) "--- a: !php/object "O:1:\"A\":1:{s:3:\"one\";i:1;}" ... " tests/yaml_parse_wiki_YtsBlockMapping_002.phpt 0000644 00000000713 15220062747 0015477 0 ustar 00 --TEST-- Yaml YtsBlockMapping - Multi Element Mapping --DESCRIPTION-- More than one key/value pair --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(3) { ["red"]=> string(5) "baron" ["white"]=> string(5) "walls" ["blue"]=> string(7) "berries" } tests/yaml_parse_008.phpt 0000644 00000004453 15220062747 0011341 0 ustar 00 --TEST-- yaml_parse - callbacks --SKIPIF-- --FILE-- $v) { $new_value .= "'{$k}' => '{$v}', "; } $value = trim($new_value, ', '); } return "
"; } // yaml with some custom tags $yaml_str = <<
"value_c" key_d : !tag_d | some text key_e : !tag_e > some text key_f : !tag_f [ one, two ] key_g : !tag_g { sky: blue, sea: green } key_h : !tag_h - one - two key_i : !tag_i sky: blue sea: green ... YAML; $yaml = yaml_parse($yaml_str, 0, $ndocs, array( "test-tag_a" => "tag_callback", "test2-tag_b" => "tag_callback", "tag:example.com,2011:test/tag_c" => "tag_callback", "test-tag_d" => "tag_callback", "test-tag_e" => "tag_callback", "test-tag_f" => "tag_callback", "test-tag_g" => "tag_callback", "test-tag_h" => "tag_callback", "test-tag_i" => "tag_callback", )); var_dump($yaml); var_dump($ndocs); ?> --EXPECT-- array(9) { ["key_a"]=> string(46) "
" ["key_b"]=> string(47) "
" ["key_c"]=> string(67) "
" ["key_d"]=> string(49) "
" ["key_e"]=> string(49) "
" ["key_f"]=> string(65) "
'one', '1' => 'two'], tag=[test-tag_f], flags=[0]>" ["key_g"]=> string(72) "
'blue', 'sea' => 'green'], tag=[test-tag_g], flags=[0]>" ["key_h"]=> string(65) "
'one', '1' => 'two'], tag=[test-tag_h], flags=[0]>" ["key_i"]=> string(72) "
'blue', 'sea' => 'green'], tag=[test-tag_i], flags=[0]>" } int(1) tests/yaml_parse_spec_bool.phpt 0000644 00000000523 15220062747 0012771 0 ustar 00 --TEST-- Yaml 1.1 Spec - bool --SKIPIF-- --FILE-- --EXPECT-- array(4) { ["canonical"]=> bool(true) ["answer"]=> bool(false) ["logical"]=> bool(true) ["option"]=> bool(true) } tests/yaml_parse_file_002.phpt 0000644 00000002424 15220062747 0012326 0 ustar 00 --TEST-- yaml_parse_file - error cases --SKIPIF-- --INI-- yaml.decode_timestamp=1 date.timezone=GMT ; E_ALL - E_DEPRECATED to hide Deprecated: yaml_parse_file(): Passing null to parameter #1... error_reporting=24575 --FILE-- getMessage()} in " . __FILE__ . " on line 4\n"; } try { // PHP7 emits a Warning here yaml_parse_file(''); } catch (ValueError $e) { // PHP8 raises this exception echo "\nWarning: yaml_parse_file(): {$e->getMessage()} in " . __FILE__ . " on line 11\n"; } yaml_parse_file('invalid'); try { // PHP7 emits a Warning here yaml_parse_file(); } catch (ArgumentCountError $e) { // PHP8 raises this exception echo "\nWarning: {$e->getMessage()} in " . __FILE__ . " on line 19\n"; } --EXPECTF-- Warning: yaml_parse_file(): Path must not be empty in %s on line %d Warning: yaml_parse_file(): Path must not be empty in %s on line %d Warning: yaml_parse_file(invalid): %r[Ff]%railed to open stream: No such file or directory in %s on line %d Warning: yaml_parse_file() expects at least 1 %r(argument|parameter)%r, 0 given in %s on line %d tests/yaml_parse_wiki_YtsMapInSeq_003.phpt 0000644 00000000666 15220062747 0014616 0 ustar 00 --TEST-- Yaml YtsMapInSeq - Strange keys --DESCRIPTION-- Test a map with "line noise" keys. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { [0]=> array(2) { ["!@#$"]=> string(3) "foo" ["-+!@"]=> string(3) "bar" } } tests/yaml_parse_005.phpt 0000644 00000003701 15220062747 0011331 0 ustar 00 --TEST-- yaml_parse - syck bug #12656 --CREDITS-- From syck bug #12656 http://pecl.php.net/bugs/bug.php?id=12656 --SKIPIF-- --FILE-- --EXPECT-- array(9) { ["models"]=> array(1) { [0]=> string(53) "/usr/home/enovodk/data/core/easyworks/current/models/" } ["behaviors"]=> array(1) { [0]=> string(63) "/usr/home/enovodk/data/core/easyworks/current/models/behaviors/" } ["controllers"]=> array(1) { [0]=> string(58) "/usr/home/enovodk/data/core/easyworks/current/controllers/" } ["components"]=> array(1) { [0]=> string(69) "/usr/home/enovodk/data/core/easyworks/current/controllers/components/" } ["apis"]=> array(1) { [0]=> string(62) "/usr/home/enovodk/data/core/easyworks/current/controllers/api/" } ["views"]=> array(1) { [0]=> string(52) "/usr/home/enovodk/data/core/easyworks/current/views/" } ["helpers"]=> array(1) { [0]=> string(60) "/usr/home/enovodk/data/core/easyworks/current/views/helpers/" } ["libs"]=> array(1) { [0]=> string(51) "/usr/home/enovodk/data/core/easyworks/current/libs/" } ["plugins"]=> array(1) { [0]=> string(54) "/usr/home/enovodk/data/core/easyworks/current/plugins/" } } tests/yaml_parse_spec_str.phpt 0000644 00000000333 15220062747 0012645 0 ustar 00 --TEST-- Yaml 1.1 Spec - str --SKIPIF-- --FILE-- --EXPECT-- array(1) { ["string"]=> string(4) "abcd" } tests/yaml_parse_wiki_YtsMapInSeq_001.phpt 0000644 00000000675 15220062747 0014614 0 ustar 00 --TEST-- Yaml YtsMapInSeq - Single key --DESCRIPTION-- Test maps with just one key. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(2) { [0]=> array(1) { ["foo"]=> string(3) "bar" } [1]=> array(1) { ["baz"]=> string(3) "bug" } } tests/yaml_parse_file_001.yaml 0000644 00000001204 15220062747 0012307 0 ustar 00 --- !
invoice: 34843 date : 2001-01-23 bill-to: &id001 given : Chris family : Dumars address: lines: | 458 Walkman Dr. Suite #292 city : Royal Oak state : MI postal : 48046 ship-to: *id001 product: - sku : BL394D quantity : 4 description : Basketball price : 450.00 - sku : BL4438H quantity : 1 description : Super Hoop price : 2392.00 tax : 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. tests/yaml_parse_002.phpt 0000644 00000001205 15220062747 0011323 0 ustar 00 --TEST-- yaml_parse - multiple documents --SKIPIF-- --FILE-- --EXPECT-- array(2) { [0]=> array(3) { ["time"]=> string(8) "20:03:20" ["player"]=> string(10) "Sammy Sosa" ["action"]=> string(13) "strike (miss)" } [1]=> array(3) { ["time"]=> string(8) "20:03:47" ["player"]=> string(10) "Sammy Sosa" ["action"]=> string(10) "grand slam" } } tests/bug_79494.phpt 0000644 00000001141 15220062747 0010142 0 ustar 00 --TEST-- Test PECL bug #74949 --SKIPIF-- --INI-- serialize_precision=-1 --FILE-- array ( 'audioEnabled' => array ( 0 => 132317787432502136, 1 => 0, ), 'eveampGain' => array ( 0 => 132316833510704299, 1 => 0.25, ), ), ); print yaml_emit($data); ?> --EXPECTF-- --- audio: audioEnabled: - %r(132317787432502136|1\.3231778743250214E\+17)%r - 0 eveampGain: - %r(132316833510704299|1\.323168335107043E\+17)%r - 0.25 ... tests/yaml_emit_004.phpt 0000644 00000000520 15220062747 0011150 0 ustar 00 --TEST-- yaml_emit - datetime --SKIPIF-- --INI-- date.timezone=GMT --FILE-- --EXPECT-- string(41) "--- 2008-08-03T14:52:10.000000+00:00 ... " tests/yaml_emit_001.phpt 0000644 00000004130 15220062747 0011146 0 ustar 00 --TEST-- yaml_emit - scalars --SKIPIF-- --INI-- serialize_precision=-1 --FILE-- ,.?/ These are extended characters: Iñtërnâtiônàlizætiøn EOD; var_dump(yaml_emit($str)); ?> --EXPECT-- string(10) "--- ~ ... " string(13) "--- true ... " string(14) "--- false ... " string(11) "--- 10 ... " string(12) "--- -10 ... " string(16) "--- 123.456 ... " string(17) "--- -123.456 ... " string(14) "--- "yes" ... " string(13) "--- "no" ... " string(12) "--- "~" ... " string(12) "--- '-' ... " string(13) "--- '''' ... " string(12) "--- '"' ... " string(33) "--- '# looks like a comment' ... " string(28) "--- '@looks_like_a_ref' ... " string(30) "--- '&looks_like_a_alias' ... " string(16) "--- '!!str' ... " string(41) "--- '%TAG ! tag:looks.like.one,999:' ... " string(21) "--- '!something' ... " string(21) "--- Hello world! ... " string(58) "--- |- This is a string with an embedded newline. ... " string(267) "--- "This string was made with a here doc.\n\nIt contains embedded newlines.\n \t\tIt also has some embedded tabs.\n\nHere are some symbols:\n`~!@#$%^&*()_-+={}[]|\\:\";'<>,.?/\n\nThese are extended characters: I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n\n\n" ... " tests/yaml_parse_004.phpt 0000644 00000000727 15220062747 0011335 0 ustar 00 --TEST-- yaml_parse - syck bug #11585 --CREDITS-- From syck bug #11585 http://pecl.php.net/bugs/bug.php?id=11585 --SKIPIF-- --FILE-- --EXPECTF-- Warning: yaml_parse(): alias broken_pointer_to_define is not registered (line 6, column 37) in %syaml_parse_004.php on line %d bool(false) tests/bug_75029.phpt 0000644 00000000632 15220062747 0010134 0 ustar 00 --TEST-- Test PECL bug #75029 --SKIPIF-- --FILE-- --EXPECT-- NULL array(1) { [0]=> NULL } array(3) { [0]=> string(3) "doc" [1]=> NULL [2]=> string(3) "doc" } NULL tests/bug_69465.phpt 0000644 00000001442 15220062747 0010143 0 ustar 00 --TEST-- Test PECL bug #69465 --SKIPIF-- --INI-- yaml.decode_timestamp=1 date.timezone=UTC --FILE-- --EXPECT-- array(12) { ["date1"]=> int(1431648000) ["date2"]=> string(10) "2015-05-15" ["date3"]=> string(10) "2015-05-15" ["bool1"]=> bool(true) ["bool2"]=> string(4) "true" ["bool3"]=> string(4) "true" ["int1"]=> int(1) ["int2"]=> string(1) "1" ["int3"]=> string(1) "1" ["float1"]=> float(1.5) ["float2"]=> string(3) "1.5" ["float3"]=> string(3) "1.5" } tests/yaml_parse_wiki_YtsStrangeKeys_002.phpt 0000644 00000000726 15220062747 0015374 0 ustar 00 --TEST-- Yaml YtsStrangeKeys - Unquoted line noise key --DESCRIPTION-- Check that unquoted line noise parses as key. This requires the line noise be tame enough to pass as an implicit plain key. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { ["-+!@#%"]=> string(7) "bar baz" } tests/bug_72540.phpt 0000644 00000000402 15220062747 0010122 0 ustar 00 --TEST-- Test PECL bug #72540 --SKIPIF-- --FILE-- --EXPECT-- bool(false) tests/yaml_parse_wiki_YtsMapInSeq_002.phpt 0000644 00000000651 15220062747 0014607 0 ustar 00 --TEST-- Yaml YtsMapInSeq - Multiple keys --DESCRIPTION-- Test a map with multiple keys. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { [0]=> array(2) { ["foo"]=> string(3) "bar" ["baz"]=> string(3) "bug" } } tests/yaml_parse_001.phpt 0000644 00000006706 15220062747 0011335 0 ustar 00 --TEST-- yaml_parse - general --SKIPIF-- --INI-- yaml.decode_timestamp=1 date.timezone=GMT --FILE-- invoice: 34843 date : 2001-01-23 bill-to: &id001 given : Chris family : Dumars address: lines: | 458 Walkman Dr. Suite #292 city : Royal Oak state : MI postal : 48046 ship-to: *id001 product: - sku : BL394D quantity : 4 description : Basketball price : 450.00 - sku : BL4438H quantity : 1 description : Super Hoop price : 2392.00 tax : 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. ')); var_dump(yaml_parse(' --- Time: 2001-11-23 15:01:42 -5 User: ed Warning: This is an error message for the log file --- Time: 2001-11-23 15:02:31 -5 User: ed Warning: A slightly different error message. --- Date: 2001-11-23 15:03:17 -5 User: ed Fatal: Unknown variable "bar" Stack: - file: TopClass.py line: 23 code: | x = MoreObject("345\n") - file: MoreClass.py line: 58 code: |- foo = bar ', -1)); ?> --EXPECT-- array(8) { ["invoice"]=> int(34843) ["date"]=> int(980208000) ["bill-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(27) "458 Walkman Dr. Suite #292 " ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["ship-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(27) "458 Walkman Dr. Suite #292 " ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["product"]=> array(2) { [0]=> array(4) { ["sku"]=> string(6) "BL394D" ["quantity"]=> int(4) ["description"]=> string(10) "Basketball" ["price"]=> float(450) } [1]=> array(4) { ["sku"]=> string(7) "BL4438H" ["quantity"]=> int(1) ["description"]=> string(10) "Super Hoop" ["price"]=> float(2392) } } ["tax"]=> float(251.42) ["total"]=> float(4443.52) ["comments"]=> string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338." } array(3) { [0]=> array(3) { ["Time"]=> int(1006545702) ["User"]=> string(2) "ed" ["Warning"]=> string(41) "This is an error message for the log file" } [1]=> array(3) { ["Time"]=> int(1006545751) ["User"]=> string(2) "ed" ["Warning"]=> string(35) "A slightly different error message." } [2]=> array(4) { ["Date"]=> int(1006545797) ["User"]=> string(2) "ed" ["Fatal"]=> string(22) "Unknown variable "bar"" ["Stack"]=> array(2) { [0]=> array(3) { ["file"]=> string(11) "TopClass.py" ["line"]=> int(23) ["code"]=> string(24) "x = MoreObject("345\n") " } [1]=> array(3) { ["file"]=> string(12) "MoreClass.py" ["line"]=> int(58) ["code"]=> string(9) "foo = bar" } } } } tests/yaml_emit_003.phpt 0000644 00000003172 15220062747 0011155 0 ustar 00 --TEST-- yaml_emit - mappings --SKIPIF-- --INI-- serialize_precision=-1 --FILE-- "Chris", "family"=> "Dumars", "address"=> array( "lines"=> "458 Walkman Dr. Suite #292", "city"=> "Royal Oak", "state"=> "MI", "postal"=> 48046, ), ); $invoice = array ( "invoice"=> 34843, "date"=> 980208000, "bill-to"=> $addr, "ship-to"=> $addr, "product"=> array( array( "sku"=> "BL394D", "quantity"=> 4, "description"=> "Basketball", "price"=> 450, ), array( "sku"=> "BL4438H", "quantity"=> 1, "description"=> "Super Hoop", "price"=> 2392, ), ), "tax"=> 251.42, "total"=> 4443.52, "comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.", ); var_dump(yaml_emit($invoice)); ?> --EXPECT-- string(620) "--- invoice: 34843 date: 980208000 bill-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 ship-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 product: - sku: BL394D quantity: 4 description: Basketball price: 450 - sku: BL4438H quantity: 1 description: Super Hoop price: 2392 tax: 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. ... " tests/yaml_parse_wiki_YtsBasicTests_008.phpt 0000644 00000001602 15220062747 0015201 0 ustar 00 --TEST-- Yaml YtsBasicTests - Mixed Mapping --DESCRIPTION-- A mapping can contain any assortment of mappings and sequences as values. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["foo"]=> string(8) "whatever" ["bar"]=> array(3) { [0]=> array(3) { ["fruit"]=> string(5) "apple" ["name"]=> string(5) "steve" ["sport"]=> string(8) "baseball" } [1]=> string(4) "more" [2]=> array(3) { ["python"]=> string(5) "rocks" ["perl"]=> string(6) "papers" ["ruby"]=> string(10) "scissorses" } } } tests/yaml_emit_002.phpt 0000644 00000003644 15220062747 0011160 0 ustar 00 --TEST-- yaml_emit - sequences --SKIPIF-- --INI-- serialize_precision=-1 --FILE-- ,.?/ These are extended characters: Iñtërnâtiônàlizætiøn EOD; $doc = array( null, true, false, 10, -10, 123.456, -123.456, "yes", "no", "~", "-", "'", '"', "I\\xF1t\\xEBrn\\xE2ti\\xF4n\\xE0liz\\xE6ti\\xF8n", "# looks like a comment", "@looks_like_a_ref", "&looks_like_a_alias", "!!str", "%TAG ! tag:looks.like.one,999:", "!something", "Hello world!", "This is a string with\nan embedded newline.", $str, ); echo "=== Array of scalars ===\n"; var_dump(yaml_emit($doc)); echo "=== Nested ===\n"; var_dump(yaml_emit(array( "top level", array( "in array", ), array( "in array", array( "in array", ), ), ))); echo "=== Degenerate ===\n"; var_dump(yaml_emit(array())); ?> --EXPECT-- === Array of scalars === string(604) "--- - ~ - true - false - 10 - -10 - 123.456 - -123.456 - "yes" - "no" - "~" - '-' - '''' - '"' - I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n - '# looks like a comment' - '@looks_like_a_ref' - '&looks_like_a_alias' - '!!str' - '%TAG ! tag:looks.like.one,999:' - '!something' - Hello world! - |- This is a string with an embedded newline. - "This string was made with a here doc.\n\nIt contains embedded newlines.\n \t\tIt also has some embedded tabs.\n\nHere are some symbols:\n`~!@#$%^&*()_-+={}[]|\\:\";'<>,.?/\n\nThese are extended characters: I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n\n\n" ... " === Nested === string(61) "--- - top level - - in array - - in array - - in array ... " === Degenerate === string(11) "--- [] ... " tests/bug_61770.phpt 0000644 00000000374 15220062747 0010135 0 ustar 00 --TEST-- Test PECL bug #61770 --SKIPIF-- --FILE-- --EXPECTF-- Warning: yaml_emit(): Invalid UTF-8 sequence in argument in %sbug_61770.php on line 2 bool(false) tests/yaml_parse_wiki_YtsBasicTests_005.phpt 0000644 00000001124 15220062747 0015175 0 ustar 00 --TEST-- Yaml YtsBasicTests - Simple Mapping --DESCRIPTION-- You can add a keyed list "also known as a dictionary or hash" to your document by placing each member of the list on a new line, with a colon seperating the key from its value. In YAML, this type of list is called a mapping. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["foo"]=> string(8) "whatever" ["bar"]=> string(5) "stuff" } tests/bug_77720.phpt 0000644 00000030513 15220062747 0010135 0 ustar 00 --TEST-- Test PECL bug #77720 --SKIPIF-- --FILE-- --EXPECTF-- Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 2, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 3, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 4, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 5, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 6, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 7, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 8, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 9, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 10, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 2) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 73) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 11, column 79) in %sbug_77720.php on line 15 Warning: yaml_parse(): Illegal offset type array (line 12, column 1) in %sbug_77720.php on line 15 array(11) { [0]=> array(9) { [0]=> string(3) "lol" [1]=> string(3) "lol" [2]=> string(3) "lol" [3]=> string(3) "lol" [4]=> string(3) "lol" [5]=> string(3) "lol" [6]=> string(3) "lol" [7]=> string(3) "lol" [8]=> string(3) "lol" } [1]=> array(0) { } [2]=> array(0) { } [3]=> array(0) { } [4]=> array(0) { } [5]=> array(0) { } [6]=> array(0) { } [7]=> array(0) { } [8]=> array(0) { } [9]=> array(0) { } [10]=> array(0) { } } tests/yaml_parse_006.phpt 0000644 00000003172 15220062747 0011334 0 ustar 00 --TEST-- yaml_parse - syck bug #14384 --CREDITS-- From syck bug #14384 http://pecl.php.net/bugs/bug.php?id=14384 --SKIPIF-- --FILE-- --EXPECTF-- Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 1), context while scanning for the next token (line 2, column 1) in %syaml_parse_006.php on line %d bool(false) Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 3), context while scanning for the next token (line 2, column 3) in %syaml_parse_006.php on line %d bool(false) array(1) { ["key"]=> string(16) "tab before value" } array(1) { ["key"]=> string(26) "space and tab before value" } Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 2), context while scanning for the next token (line 2, column 2) in %syaml_parse_006.php on line %d bool(false) Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 4), context while scanning for the next token (line 2, column 4) in %syaml_parse_006.php on line %d bool(false) tests/yaml_parse_spec_float.phpt 0000644 00000001032 15220062747 0013137 0 ustar 00 --TEST-- Yaml 1.1 Spec - float --SKIPIF-- --FILE-- --EXPECT-- array(6) { ["canonical"]=> float(685230.15) ["exponentioal"]=> float(685230.15) ["fixed"]=> float(685230.15) ["sexagesimal"]=> float(685230.15) ["negative infinity"]=> float(-INF) ["not a number"]=> float(NAN) } tests/bug_64019.phpt 0000644 00000001254 15220062747 0010132 0 ustar 00 --TEST-- Test PECL bug #64019 --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["configAnchors"]=> array(1) { [0]=> array(2) { [""]=> NULL ["configKey"]=> string(11) "configValue" } } ["config"]=> array(1) { ["<<"]=> NULL } } array(1) { ["config"]=> array(1) { ["<<"]=> NULL } } tests/yaml_parse_spec_set.phpt 0000644 00000000572 15220062747 0012635 0 ustar 00 --TEST-- Yaml 1.1 Spec - set --SKIPIF-- --FILE-- --EXPECT-- array(1) { ["baseball players"]=> array(3) { ["Mark McGwire"]=> NULL ["Sammy Sosa"]=> NULL ["Ken Griffey"]=> NULL } } tests/yaml_parse_003.phpt 0000644 00000001323 15220062747 0011325 0 ustar 00 --TEST-- yaml_parse - parse errors --SKIPIF-- --FILE-- --EXPECTF-- Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 16), context while scanning for the next token (line 2, column 16) in %syaml_parse_003.php on line %d bool(false) Warning: yaml_parse(): scanning error encountered during parsing: found character that cannot start any token (line 2, column 15), context while scanning for the next token (line 2, column 15) in %syaml_parse_003.php on line %d bool(false) tests/yaml_emit_file_basic.phpt 0000644 00000003574 15220062747 0012741 0 ustar 00 --TEST-- Test Github pull request #1 --SKIPIF-- --INI-- serialize_precision=-1 --FILE-- "Chris", "family"=> "Dumars", "address"=> array( "lines"=> "458 Walkman Dr. Suite #292", "city"=> "Royal Oak", "state"=> "MI", "postal"=> 48046, ), ); $invoice = array ( "invoice"=> 34843, "date"=> 980208000, "bill-to"=> $addr, "ship-to"=> $addr, "product"=> array( array( "sku"=> "BL394D", "quantity"=> 4, "description"=> "Basketball", "price"=> 450, ), array( "sku"=> "BL4438H", "quantity"=> 1, "description"=> "Super Hoop", "price"=> 2392, ), ), "tax"=> 251.42, "total"=> 4443.52, "comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.", ); $temp_filename = dirname(__FILE__) . 'yaml_emit_file_basic.tmp'; var_dump(yaml_emit_file($temp_filename, $invoice)); var_dump(file_get_contents($temp_filename)); ?> --CLEAN-- --EXPECT-- bool(true) string(620) "--- invoice: 34843 date: 980208000 bill-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 ship-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 product: - sku: BL394D quantity: 4 description: Basketball price: 450 - sku: BL4438H quantity: 1 description: Super Hoop price: 2392 tax: 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. ... " tests/bug_80324.phpt 0000644 00000000673 15220062747 0010133 0 ustar 00 --TEST-- Bug #80324 (Segfault in YAML with anonymous functions) --SKIPIF-- --FILE-- function ($str) {return $str;}, '!path' => function ($str) {return $str;}, )); var_dump($result); ?> --EXPECT-- array(2) { [0]=> string(3) "ENV" [1]=> string(4) "PATH" } tests/bug_74799.yaml 0000644 00000000025 15220062747 0010134 0 ustar 00 --- key: !value ... tests/yaml_parse_spec_binary.phpt 0000644 00000001775 15220062747 0013334 0 ustar 00 --TEST-- Yaml 1.1 Spec - binary --SKIPIF-- --INI-- yaml.decode_binary=1 --FILE-- --EXPECT-- bool(true) string(32) "a8363b3d0e4e39d9e77e244e216c7840" tests/yaml_emit_009.phpt 0000644 00000002300 15220062747 0011153 0 ustar 00 --TEST-- yaml_emit - custom tags with closures --SKIPIF-- --FILE-- function ($o) { return array( 'tag' => '!emit009', 'data' => $o->data, ); }, ); class Emit009Example { public $data; // data may be in any pecl/yaml suitable type } $t = new Emit009Example(); $t->data = array ('a','b','c'); $yaml = yaml_emit( array( 'callback' => $t, ), YAML_ANY_ENCODING, YAML_ANY_BREAK, $emit_callbacks ); var_dump($yaml); /* make sure you can undo the custome serialization */ function parse_009 ($value, $tag, $flags) { $ret = new Emit009Example(); $ret->data = $value; return $ret; } $parse_callbacks = array( '!emit009' => 'parse_009', ); $array = yaml_parse($yaml, 0, $cnt, $parse_callbacks); var_dump($array['callback'] == $t); /* roundtrip with raw object */ var_dump($t == yaml_parse( yaml_emit($t, YAML_ANY_ENCODING, YAML_ANY_BREAK, $emit_callbacks), 0, $cnt, $parse_callbacks)); ?> --EXPECT-- string(39) "--- callback: !emit009 - a - b - c ... " bool(true) bool(true) tests/bug_74799.phpt 0000644 00000001501 15220062747 0010145 0 ustar 00 --TEST-- Memory leak check --CREDITS-- Gleb Svitelskiy
--SKIPIF-- --FILE-- 'tag_callback']); unset($yamlString, $ndocs); $ndocs = null; yaml_parse_file(__DIR__.'/bug_74799.yaml', 0, $ndocs, ['!value' => 'tag_callback']); unset($ndocs); $array = ['key' => 'value']; yaml_emit($array); unset($array); $array = ['key' => 'value']; yaml_emit_file(__DIR__.'/bug_74799.tmp', $array); unset($array); var_dump($base_memory == memory_get_usage()); ?> --CLEAN-- --EXPECT-- bool(true) tests/yaml_parse_spec_omap.phpt 0000644 00000002013 15220062747 0012766 0 ustar 00 --TEST-- Yaml 1.1 Spec - omap --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["Bestiary"]=> array(3) { [0]=> array(1) { ["aardvark"]=> string(33) "African pig-like ant eater. Ugly." } [1]=> array(1) { ["anteater"]=> string(38) "South-American ant eater. Two species." } [2]=> array(1) { ["anaconda"]=> string(40) "South-American constrictor snake. Scaly." } } ["Numbers"]=> array(3) { [0]=> array(1) { ["one"]=> int(1) } [1]=> array(1) { ["two"]=> int(2) } [2]=> array(1) { ["three"]=> int(3) } } } tests/yaml_001.phpt 0000644 00000002121 15220062747 0010126 0 ustar 00 --TEST-- yaml - emit -> parse roundtrip --SKIPIF-- --FILE-- "Chris", "family"=> "Dumars", "address"=> array( "lines"=> "458 Walkman Dr. Suite #292", "city"=> "Royal Oak", "state"=> "MI", "postal"=> 48046, ), ); $invoice = array ( "invoice"=> 34843, "date"=> 980208000, "bill-to"=> $addr, "ship-to"=> $addr, "product"=> array( array( "sku"=> "BL394D", "quantity"=> 4, "description"=> "Basketball", "price"=> 450, ), array( "sku"=> "BL4438H", "quantity"=> 1, "description"=> "Super Hoop", "price"=> 2392, ), ), "tax"=> 251.42, "total"=> 4443.52, "comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.", "tags" => array("a","b","c"), ); $yaml = yaml_emit($invoice); $parsed = yaml_parse($yaml); var_dump($parsed == $invoice); ?> --EXPECT-- bool(true) tests/yaml_parse_wiki_YtsBlockMapping_004.phpt 0000644 00000000742 15220062747 0015503 0 ustar 00 --TEST-- Yaml YtsBlockMapping - Colons aligned --DESCRIPTION-- Spaces can come before the ': ' key/value separator. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(3) { ["red"]=> string(5) "baron" ["white"]=> string(5) "walls" ["blue"]=> string(7) "berries" } tests/bug_69616.phpt 0000644 00000000642 15220062747 0010142 0 ustar 00 --TEST-- Test PECL bug #69616 --SKIPIF-- --INI-- yaml.decode_php=1 --FILE-- --EXPECTF-- Notice: yaml_parse(): Failed to unserialize class in %sbug_69616.php on line 10 Notice: yaml_parse(): Failed to unserialize class in %sbug_69616.php on line 10 tests/bug_79567.phpt 0000644 00000000513 15220062747 0010145 0 ustar 00 --TEST-- Test PECL bug #79567 --SKIPIF-- --FILE-- [ 0 => 132317787432502136, 1 => 0, ], ]; $yaml = yaml_emit($data); $result = yaml_parse($yaml); print $result == $data ? "Yes!\n" : "No...\n"; ?> --EXPECT-- Yes! tests/yaml_parse_wiki_YtsBasicTests_003.phpt 0000644 00000001137 15220062747 0015177 0 ustar 00 --TEST-- Yaml YtsBasicTests - Mixed Sequences --DESCRIPTION-- Sequences can contain any YAML data, including strings and other sequences. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(4) { [0]=> string(5) "apple" [1]=> array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(4) "x123" } [2]=> string(6) "banana" [3]=> string(6) "carrot" } tests/yaml_parse_spec_map.phpt 0000644 00000001225 15220062747 0012613 0 ustar 00 --TEST-- Yaml 1.1 Spec - map --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["Block style"]=> array(3) { ["Clark"]=> string(5) "Evans" ["Brian"]=> string(8) "Ingerson" ["Oren"]=> string(8) "Ben-Kiki" } ["Flow style"]=> array(3) { ["Clark"]=> string(5) "Evans" ["Brian"]=> string(8) "Ingerson" ["Oren"]=> string(8) "Ben-Kiki" } } tests/yaml_emit_006.phpt 0000644 00000007250 15220062747 0011161 0 ustar 00 --TEST-- yaml_emit - ini settings --SKIPIF-- --INI-- yaml.output_canonical=0 yaml.output_indent=2 yaml.output_width=80 serialize_precision=-1 --FILE-- "Chris", "family"=> "Dumars", "address"=> array( "lines"=> "458 Walkman Dr. Suite #292", "city"=> "Royal Oak", "state"=> "MI", "postal"=> 48046, ), ); $invoice = array ( "invoice"=> 34843, "date"=> 980208000, "bill-to"=> $addr, "ship-to"=> $addr, "product"=> array( array( "sku"=> "BL394D", "quantity"=> 4, "description"=> "Basketball", "price"=> 450, ), array( "sku"=> "BL4438H", "quantity"=> 1, "description"=> "Super Hoop", "price"=> 2392, ), ), "tax"=> 251.42, "total"=> 4443.52, "comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.", ); var_dump(yaml_emit($invoice)); ini_set("yaml.output_canonical", "1"); ini_set("yaml.output_indent", "4"); ini_set("yaml.output_width", "40"); echo "== CANONICAL ==\n"; var_dump(yaml_emit($invoice)); ?> --EXPECT-- string(620) "--- invoice: 34843 date: 980208000 bill-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 ship-to: given: Chris family: Dumars address: lines: |- 458 Walkman Dr. Suite #292 city: Royal Oak state: MI postal: 48046 product: - sku: BL394D quantity: 4 description: Basketball price: 450 - sku: BL4438H quantity: 1 description: Super Hoop price: 2392 tax: 251.42 total: 4443.52 comments: Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338. ... " == CANONICAL == string(1822) "--- !!map { ? !!str "invoice" : !!int "34843", ? !!str "date" : !!int "980208000", ? !!str "bill-to" : !!map { ? !!str "given" : !!str "Chris", ? !!str "family" : !!str "Dumars", ? !!str "address" : !!map { ? !!str "lines" : !!str "458 Walkman Dr.\n Suite #292", ? !!str "city" : !!str "Royal Oak", ? !!str "state" : !!str "MI", ? !!str "postal" : !!int "48046", }, }, ? !!str "ship-to" : !!map { ? !!str "given" : !!str "Chris", ? !!str "family" : !!str "Dumars", ? !!str "address" : !!map { ? !!str "lines" : !!str "458 Walkman Dr.\n Suite #292", ? !!str "city" : !!str "Royal Oak", ? !!str "state" : !!str "MI", ? !!str "postal" : !!int "48046", }, }, ? !!str "product" : !!seq [ !!map { ? !!str "sku" : !!str "BL394D", ? !!str "quantity" : !!int "4", ? !!str "description" : !!str "Basketball", ? !!str "price" : !!int "450", }, !!map { ? !!str "sku" : !!str "BL4438H", ? !!str "quantity" : !!int "1", ? !!str "description" : !!str "Super Hoop", ? !!str "price" : !!int "2392", }, ], ? !!str "tax" : !!float "251.42", ? !!str "total" : !!float "4443.52", ? !!str "comments" : !!str "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.", } ... " tests/yaml_parse_wiki_YtsBasicTests_002.phpt 0000644 00000001031 15220062747 0015167 0 ustar 00 --TEST-- Yaml YtsBasicTests - Nested Sequences --DESCRIPTION-- You can include a sequence within another sequence by giving the sequence an empty dash, followed by an indented list. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { [0]=> array(3) { [0]=> string(3) "foo" [1]=> string(3) "bar" [2]=> string(3) "baz" } } tests/yaml_parse_spec_null.phpt 0000644 00000001423 15220062747 0013010 0 ustar 00 --TEST-- Yaml 1.1 Spec - null --SKIPIF-- --FILE-- --EXPECT-- array(3) { [0]=> NULL [1]=> array(4) { ["empty"]=> NULL ["canonical"]=> NULL ["english"]=> NULL [""]=> string(8) "null key" } [2]=> array(1) { ["sparse"]=> array(5) { [0]=> NULL [1]=> string(9) "2nd entry" [2]=> NULL [3]=> string(9) "4th entry" [4]=> NULL } } } tests/yaml_parse_spec_seq.phpt 0000644 00000002526 15220062747 0012633 0 ustar 00 --TEST-- Yaml 1.1 Spec - seq --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["Block style"]=> array(9) { [0]=> string(7) "Mercury" [1]=> string(5) "Venus" [2]=> string(5) "Earth" [3]=> string(4) "Mars" [4]=> string(7) "Jupiter" [5]=> string(6) "Saturn" [6]=> string(6) "Uranus" [7]=> string(7) "Neptune" [8]=> string(5) "Pluto" } ["Flow style"]=> array(9) { [0]=> string(7) "Mercury" [1]=> string(5) "Venus" [2]=> string(5) "Earth" [3]=> string(4) "Mars" [4]=> string(7) "Jupiter" [5]=> string(6) "Saturn" [6]=> string(6) "Uranus" [7]=> string(7) "Neptune" [8]=> string(5) "Pluto" } } tests/yaml_parse_url_001.phpt 0000644 00000003067 15220062747 0012214 0 ustar 00 --TEST-- yaml_parse_url - general --SKIPIF-- --INI-- yaml.decode_timestamp=1 date.timezone=GMT --FILE-- --EXPECT-- array(8) { ["invoice"]=> int(34843) ["date"]=> int(980208000) ["bill-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(27) "458 Walkman Dr. Suite #292 " ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["ship-to"]=> &array(3) { ["given"]=> string(5) "Chris" ["family"]=> string(6) "Dumars" ["address"]=> array(4) { ["lines"]=> string(27) "458 Walkman Dr. Suite #292 " ["city"]=> string(9) "Royal Oak" ["state"]=> string(2) "MI" ["postal"]=> int(48046) } } ["product"]=> array(2) { [0]=> array(4) { ["sku"]=> string(6) "BL394D" ["quantity"]=> int(4) ["description"]=> string(10) "Basketball" ["price"]=> float(450) } [1]=> array(4) { ["sku"]=> string(7) "BL4438H" ["quantity"]=> int(1) ["description"]=> string(10) "Super Hoop" ["price"]=> float(2392) } } ["tax"]=> float(251.42) ["total"]=> float(4443.52) ["comments"]=> string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338." } tests/bug_60628.phpt 0000644 00000002751 15220062747 0010137 0 ustar 00 --TEST-- Test PECL bug #260628 --SKIPIF-- --FILE-- $value, 'another' => 'test', ); } /* baseline. do like operation in native php. */ $native = array( "data" => array("look upper"), ); $native["data"] = tag_callback($native["data"], "!mytag", 0); echo "-- native value --\n"; var_dump($native); echo "-- end native value --\n"; $cnt = null; $array = yaml_parse($data, 0, $cnt, array( '!mytag' => 'tag_callback', )); echo "-- parsed value --\n"; var_dump($array); echo "-- end parsed value --\n"; ?> --EXPECT-- -- callback value -- array(1) { [0]=> string(10) "look upper" } string(6) "!mytag" int(0) -- end callback value -- -- native value -- array(1) { ["data"]=> array(2) { ["data"]=> array(1) { [0]=> string(10) "look upper" } ["another"]=> string(4) "test" } } -- end native value -- -- callback value -- array(1) { [0]=> string(10) "look upper" } string(6) "!mytag" int(0) -- end callback value -- -- parsed value -- array(1) { ["data"]=> array(2) { ["data"]=> array(1) { [0]=> string(10) "look upper" } ["another"]=> string(4) "test" } } -- end parsed value -- tests/yaml_002.phpt 0000644 00000002107 15220062747 0010133 0 ustar 00 --TEST-- yaml - emit -> parse roundtrip with datetime --SKIPIF-- --INI-- date.timezone=GMT yaml.decode_timestamp=2 --FILE-- new DateTime("2001-12-15T02:59:43.1Z"), "valid iso8601" => new DateTime("2001-12-14t21:59:43.10-05:00"), "alternate iso8601" => new DateTime("2001-12-14T21:59:43.10-0500"), "space separated" => new DateTime("2001-12-14 21:59:43.10 -5"), "no time zone (Z)" => new DateTime("2001-12-15 2:59:43.10"), "date (0000:00Z)" => new DateTime("2002-12-14"), ); $yaml = yaml_emit($original); var_dump($yaml); $parsed = yaml_parse($yaml); var_dump($parsed == $original); ?> --EXPECT-- string(303) "--- canonical: 2001-12-15T02:59:43.100000+00:00 valid iso8601: 2001-12-14T21:59:43.100000-05:00 alternate iso8601: 2001-12-14T21:59:43.100000-05:00 space separated: 2001-12-14T21:59:43.100000-05:00 no time zone (Z): 2001-12-15T02:59:43.100000+00:00 date (0000:00Z): 2002-12-14T00:00:00.000000+00:00 ... " bool(true) tests/yaml_parse_007.phpt 0000644 00000000630 15220062747 0011331 0 ustar 00 --TEST-- yaml_parse - serializable --SKIPIF-- --INI-- yaml.decode_php=1 --FILE-- one; } } var_dump(yaml_parse(' --- a: !php/object "O:1:\"A\":1:{s:3:\"one\";i:1;}" ... ')); ?> --EXPECTF-- array(1) { ["a"]=> object(A)#%d (1) { ["one"]=> int(1) } } tests/yaml_parse_wiki_YtsBasicTests_009.phpt 0000644 00000001055 15220062747 0015204 0 ustar 00 --TEST-- Yaml YtsBasicTests - Sequence-Mapping Shortcut --DESCRIPTION-- If you are adding a mapping to a sequence, you can place the mapping on the same line as the dash as a shortcut. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { [0]=> array(1) { ["work on YAML.py"]=> array(1) { [0]=> string(13) "work on Store" } } } tests/yaml_parse_wiki_YtsBasicTests_006.phpt 0000644 00000000742 15220062747 0015203 0 ustar 00 --TEST-- Yaml YtsBasicTests - Sequence in a Mapping --DESCRIPTION-- A value in a mapping can be a sequence. --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(2) { ["foo"]=> string(8) "whatever" ["bar"]=> array(2) { [0]=> string(3) "uno" [1]=> string(3) "dos" } } tests/yaml_parse_wiki_YtsBlockMapping_001.phpt 0000644 00000000552 15220062747 0015477 0 ustar 00 --TEST-- Yaml YtsBlockMapping - One Element Mapping --DESCRIPTION-- A mapping with one key/value pair --CREDITS-- Bryan Davis bd808@bd808.com # yaml.kwiki.org import/conversion --SKIPIF-- --FILE-- --EXPECT-- array(1) { ["foo"]=> string(3) "bar" } tests/bug_21995.phpt 0000644 00000000611 15220062747 0010134 0 ustar 00 --TEST-- Test PECL bug #21995 --SKIPIF-- --FILE-- "yaml_cbk", )); ?> --EXPECT-- string(3) "boo" string(3) "doo" string(1) "a" string(1) "d"