root / trunk / ext / php / tests / 002.phpt

Revision 243, 0.7 kB (checked in by indeyets, 21 months ago)

(PHP Stuff) tests to verify that syck extension works fine with both correct and incorrect input

Line 
1--TEST--
2Check valid-yaml parsing
3--SKIPIF--
4<?php if (!extension_loaded("syck")) print "skip"; ?>
5--POST--
6--GET--
7--INI--
8--FILE--
9<?php
10$yaml = <<<EOY
11---
12test:
13  hash: {key: value, key2: "value 2", key3: 3, key4: null}
14  array: [value, "value 2", 3, null]
15EOY;
16
17var_dump(syck_load($yaml));
18?>
19--EXPECT--
20array(1) {
21  ["test"]=>
22  array(2) {
23    ["hash"]=>
24    array(4) {
25      ["key"]=>
26      string(5) "value"
27      ["key2"]=>
28      string(7) "value 2"
29      ["key3"]=>
30      int(3)
31      ["key4"]=>
32      NULL
33    }
34    ["array"]=>
35    array(4) {
36      [0]=>
37      string(5) "value"
38      [1]=>
39      string(7) "value 2"
40      [2]=>
41      int(3)
42      [3]=>
43      NULL
44    }
45  }
46}
Note: See TracBrowser for help on using the browser.