Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 218 lines (211 sloc) 3.552 kB
e4f9933 @chobie add hasRenderFlag method
authored
1 --TEST--
2 Check for determine enabled extensions.
3 --SKIPIF--
4 <?php if (!extension_loaded("sundown")) print "skip"; ?>
5 --FILE--
6 <?php
7 $r = new Sundown("http://chobie.org/");
8
9 $flags = array("filter_html","no_images","no_links","no_styles","safe_links_only","with_toc_data","hard_wrap","xhtml");
10 foreach ($flags as $flag) {
11 var_dump($r->hasRenderFlag($flag));
12 }
13
14 foreach ($flags as $flag) {
15 $r = new Sundown("http://chobie.org/", array($flag => true));
16 echo "test {$flag}:\n";
17 foreach ($flags as $f) {
18 var_dump($r->hasRenderFlag($f));
19 }
20 }
21
22 $extensions = array("no_intraemphasis","tables","fenced_code_blocks","autolink","strikethrough","lax_html_blocks","space_after_header","superscript");
23 $exts = array();
24 foreach ($extensions as $ext) {
25 $exts[$ext] = true;
26 }
27
28 $r = new Sundown("http://chobie.org/");
29 echo "render flags and extensions should not conflict 1:\n";
30 foreach ($flags as $flag) {
31 var_dump($r->hasRenderFlag($flag));
32 }
33 echo "render flags and extensions should not conflict 2:\n";
34 $r = new Sundown("http://chobie.org/",$exts);
35 foreach ($flags as $flag) {
36 var_dump($r->hasRenderFlag($flag));
37 }
38
39 foreach ($flags as $flag) {
40 $r = new Sundown("http://chobie.org/", array_merge($exts,array($flag => true)));
41 echo "test {$flag}:\n";
42 foreach ($flags as $f) {
43 var_dump($r->hasRenderFlag($f));
44 }
45 }
46
47 --EXPECT--
48 bool(false)
49 bool(false)
50 bool(false)
51 bool(false)
52 bool(false)
53 bool(false)
54 bool(false)
55 bool(false)
56 test filter_html:
57 bool(true)
58 bool(false)
59 bool(false)
60 bool(false)
61 bool(false)
62 bool(false)
63 bool(false)
64 bool(false)
65 test no_images:
66 bool(false)
67 bool(true)
68 bool(false)
69 bool(false)
70 bool(false)
71 bool(false)
72 bool(false)
73 bool(false)
74 test no_links:
75 bool(false)
76 bool(false)
77 bool(true)
78 bool(false)
79 bool(false)
80 bool(false)
81 bool(false)
82 bool(false)
83 test no_styles:
84 bool(false)
85 bool(false)
86 bool(false)
87 bool(true)
88 bool(false)
89 bool(false)
90 bool(false)
91 bool(false)
92 test safe_links_only:
93 bool(false)
94 bool(false)
95 bool(false)
96 bool(false)
97 bool(true)
98 bool(false)
99 bool(false)
100 bool(false)
101 test with_toc_data:
102 bool(false)
103 bool(false)
104 bool(false)
105 bool(false)
106 bool(false)
107 bool(true)
108 bool(false)
109 bool(false)
110 test hard_wrap:
111 bool(false)
112 bool(false)
113 bool(false)
114 bool(false)
115 bool(false)
116 bool(false)
117 bool(true)
118 bool(false)
119 test xhtml:
120 bool(false)
121 bool(false)
122 bool(false)
123 bool(false)
124 bool(false)
125 bool(false)
126 bool(false)
127 bool(true)
128 render flags and extensions should not conflict 1:
129 bool(false)
130 bool(false)
131 bool(false)
132 bool(false)
133 bool(false)
134 bool(false)
135 bool(false)
136 bool(false)
137 render flags and extensions should not conflict 2:
138 bool(false)
139 bool(false)
140 bool(false)
141 bool(false)
142 bool(false)
143 bool(false)
144 bool(false)
145 bool(false)
146 test filter_html:
147 bool(true)
148 bool(false)
149 bool(false)
150 bool(false)
151 bool(false)
152 bool(false)
153 bool(false)
154 bool(false)
155 test no_images:
156 bool(false)
157 bool(true)
158 bool(false)
159 bool(false)
160 bool(false)
161 bool(false)
162 bool(false)
163 bool(false)
164 test no_links:
165 bool(false)
166 bool(false)
167 bool(true)
168 bool(false)
169 bool(false)
170 bool(false)
171 bool(false)
172 bool(false)
173 test no_styles:
174 bool(false)
175 bool(false)
176 bool(false)
177 bool(true)
178 bool(false)
179 bool(false)
180 bool(false)
181 bool(false)
182 test safe_links_only:
183 bool(false)
184 bool(false)
185 bool(false)
186 bool(false)
187 bool(true)
188 bool(false)
189 bool(false)
190 bool(false)
191 test with_toc_data:
192 bool(false)
193 bool(false)
194 bool(false)
195 bool(false)
196 bool(false)
197 bool(true)
198 bool(false)
199 bool(false)
200 test hard_wrap:
201 bool(false)
202 bool(false)
203 bool(false)
204 bool(false)
205 bool(false)
206 bool(false)
207 bool(true)
208 bool(false)
209 test xhtml:
210 bool(false)
211 bool(false)
212 bool(false)
213 bool(false)
214 bool(false)
215 bool(false)
216 bool(false)
217 bool(true)
Something went wrong with that request. Please try again.