PluginProbe ʕ •ᴥ•ʔ
Independent Analytics – WordPress Analytics Plugin / 2.15.5
Independent Analytics – WordPress Analytics Plugin v2.15.5
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 1.19.1 1.2 1.20.0 1.21.0 1.22.0 1.22.1 1.23.0 1.23.1 1.24.0 1.24.1 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.28.1 1.28.2 1.28.3 1.29.0 1.3 1.30.0 1.30.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0.0 2.0.1 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.10 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.13.1 2.13.2 2.13.5 2.13.6 2.14.0 2.14.1 2.14.2 2.14.4 2.14.6 2.14.7 2.14.8 2.14.9 2.2.0 2.2.1 2.3.1 2.3.2 2.4.2 2.4.3 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.1 2.7.2 2.7.3 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7
independent-analytics / vendor / mustangostang / spyc / php4 / test.php4
independent-analytics / vendor / mustangostang / spyc / php4 Last commit date
5to4.php 2 years ago spyc.php4 2 years ago test.php4 2 years ago
test.php4
162 lines
1 <?php
2 #
3 # S P Y C
4 # a simple php yaml class
5 # v0.3
6 #
7 # author: [chris wanstrath, chris@ozmm.org]
8 # websites: [http://www.yaml.org, http://spyc.sourceforge.net/]
9 # license: [MIT License, http://www.opensource.org/licenses/mit-license.php]
10 # copyright: (c) 2005-2006 Chris Wanstrath
11 #
12 # We're gonna load a file into memory and see if we get what we expect.
13 # If not, we're gonna complain.
14 #
15 # Pretty lo-fi. Let's see if we can't get some unit testing going in the next,
16 # I dunno, 20 months? Alright. Go team.
17 #
18
19 error_reporting(E_ALL);
20
21 include('spyc.php4');
22
23 $yaml = Spyc::YAMLLoad('../spyc.yaml');
24
25 // print_r ($yaml);
26
27 # Added in .2
28 if ($yaml[1040] != "Ooo, a numeric key!")
29 die('Key: 1040 failed');
30
31 # Test mappings / types
32 if ($yaml['String'] != "Anyone's name, really.")
33 die('Key: String failed');
34
35 if ($yaml['Int'] !== 13)
36 die('Key: Int failed');
37
38 if ($yaml['True'] !== true)
39 die('Key: True failed');
40
41 if ($yaml['False'] !== false)
42 die('Key: False failed');
43
44 if ($yaml['Zero'] !== 0)
45 die('Key: Zero failed');
46
47 if (isset($yaml['Null']))
48 die('Key: Null failed');
49
50 if ($yaml['Float'] !== 5.34)
51 die('Key: Float failed');
52
53
54 # Test sequences
55 if ($yaml[0] != "PHP Class")
56 die('Sequence 0 failed');
57
58 if ($yaml[1] != "Basic YAML Loader")
59 die('Sequence 1 failed');
60
61 if ($yaml[2] != "Very Basic YAML Dumper")
62 die('Sequence 2 failed');
63
64 # A sequence of a sequence
65 if ($yaml[3] != array("YAML is so easy to learn.",
66 "Your config files will never be the same."))
67 die('Sequence 3 failed');
68
69 # Sequence of mappings
70 if ($yaml[4] != array("cpu" => "1.5ghz", "ram" => "1 gig",
71 "os" => "os x 10.4.1"))
72 die('Sequence 4 failed');
73
74 # Mapped sequence
75 if ($yaml['domains'] != array("yaml.org", "php.net"))
76 die("Key: 'domains' failed");
77
78 # A sequence like this.
79 if ($yaml[5] != array("program" => "Adium", "platform" => "OS X",
80 "type" => "Chat Client"))
81 die('Sequence 5 failed');
82
83 # A folded block as a mapped value
84 if ($yaml['no time'] != "There isn't any time for your tricks!\nDo you understand?")
85 die("Key: 'no time' failed");
86
87 # A literal block as a mapped value
88 if ($yaml['some time'] != "There is nothing but time\nfor your tricks.")
89 die("Key: 'some time' failed");
90
91 # Crazy combinations
92 if ($yaml['databases'] != array( array("name" => "spartan", "notes" =>
93 array( "Needs to be backed up",
94 "Needs to be normalized" ),
95 "type" => "mysql" )))
96 die("Key: 'databases' failed");
97
98 # You can be a bit tricky
99 if ($yaml["if: you'd"] != "like")
100 die("Key: 'if: you\'d' failed");
101
102 # Inline sequences
103 if ($yaml[6] != array("One", "Two", "Three", "Four"))
104 die("Sequence 6 failed");
105
106 # Nested Inline Sequences
107 if ($yaml[7] != array("One", array("Two", "And", "Three"), "Four", "Five"))
108 die("Sequence 7 failed");
109
110 # Nested Nested Inline Sequences
111 if ($yaml[8] != array( "This", array("Is", "Getting", array("Ridiculous", "Guys")),
112 "Seriously", array("Show", "Mercy")))
113 die("Sequence 8 failed");
114
115 # Inline mappings
116 if ($yaml[9] != array("name" => "chris", "age" => "young", "brand" => "lucky strike"))
117 die("Sequence 9 failed");
118
119 # Nested inline mappings
120 if ($yaml[10] != array("name" => "mark", "age" => "older than chris",
121 "brand" => array("marlboro", "lucky strike")))
122 die("Sequence 10 failed");
123
124 # References -- they're shaky, but functional
125 if ($yaml['dynamic languages'] != array('Perl', 'Python', 'PHP', 'Ruby'))
126 die("Key: 'dynamic languages' failed");
127
128 if ($yaml['compiled languages'] != array('C/C++', 'Java'))
129 die("Key: 'compiled languages' failed");
130
131 if ($yaml['all languages'] != array(
132 array('Perl', 'Python', 'PHP', 'Ruby'),
133 array('C/C++', 'Java')
134 ))
135 die("Key: 'all languages' failed");
136
137 # Added in .2.2: Escaped quotes
138 if ($yaml[11] != "you know, this shouldn't work. but it does.")
139 die("Sequence 11 failed.");
140
141 if ($yaml[12] != "that's my value.")
142 die("Sequence 12 failed.");
143
144 if ($yaml[13] != "again, that's my value.")
145 die("Sequence 13 failed.");
146
147 if ($yaml[14] != "here's to \"quotes\", boss.")
148 die("Sequence 14 failed.");
149
150 if ($yaml[15] != array( 'name' => "Foo, Bar's", 'age' => 20))
151 die("Sequence 15 failed.");
152
153 if ($yaml[16] != array( 0 => "a", 1 => array (0 => 1, 1 => 2), 2 => "b"))
154 die("Sequence 16 failed.");
155
156 if ($yaml['endloop'] != "Does this line in the end indeed make Spyc go to an infinite loop?")
157 die("[endloop] failed.");
158
159
160 print "spyc.yaml parsed correctly\n";
161
162 ?>