annotate vendor/sabre/vobject/tests/VObject/CliTest.php @ 7:430dbd5346f7

vendor sabre as distributed
author Charlie Root
date Sat, 13 Jan 2018 09:06:10 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
1 <?php
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
2
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
3 namespace Sabre\VObject;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
4
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
5 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
6 * Tests the cli.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
7 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
8 * Warning: these tests are very rudimentary.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
9 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
10 class CliTest extends \PHPUnit_Framework_TestCase {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
11
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
12 public function setUp() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
13
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
14 $this->cli = new CliMock();
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
15 $this->cli->stderr = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
16 $this->cli->stdout = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
17
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
18 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
19
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
20 public function testInvalidArg() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
21
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
22 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
23 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
24 $this->cli->main(array('vobject', '--hi'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
25 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
26 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
27 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
28
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
29 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
30
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
31 public function testQuiet() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
32
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
33 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
34 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
35 $this->cli->main(array('vobject', '-q'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
36 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
37 $this->assertTrue($this->cli->quiet);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
38
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
39 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
40 $this->assertEquals(0, strlen(stream_get_contents($this->cli->stderr)));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
41
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
42 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
43
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
44 public function testHelp() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
45
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
46 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
47 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
48 $this->cli->main(array('vobject', '-h'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
49 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
50 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
51 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
52
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
53 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
54
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
55 public function testFormat() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
56
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
57 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
58 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
59 $this->cli->main(array('vobject', '--format=jcard'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
60 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
61
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
62 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
63 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
64
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
65 $this->assertEquals('jcard', $this->cli->format);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
66
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
67 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
68
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
69 public function testFormatInvalid() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
70
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
71 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
72 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
73 $this->cli->main(array('vobject', '--format=foo'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
74 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
75
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
76 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
77 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
78
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
79 $this->assertNull($this->cli->format);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
80
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
81 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
82
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
83 public function testInputFormatInvalid() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
84
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
85 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
86 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
87 $this->cli->main(array('vobject', '--inputformat=foo'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
88 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
89
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
90 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
91 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
92
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
93 $this->assertNull($this->cli->format);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
94
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
95 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
96
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
97
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
98 public function testNoInputFile() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
99
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
100 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
101 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
102 $this->cli->main(array('vobject', 'color'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
103 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
104
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
105 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
106 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
107
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
108 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
109
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
110 public function testTooManyArgs() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
111
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
112 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
113 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
114 $this->cli->main(array('vobject', 'color', 'a', 'b', 'c'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
115 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
116
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
117 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
118
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
119 public function testUnknownCommand() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
120
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
121 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
122 1,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
123 $this->cli->main(array('vobject', 'foo', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
124 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
125
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
126 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
127
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
128 public function testConvertJson() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
129
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
130 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
131
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
132 fwrite($inputStream, <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
133 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
134 VERSION:3.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
135 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
136 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
137 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
138 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
139 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
140 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
141
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
142 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
143 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
144 $this->cli->main(array('vobject', 'convert','--format=json', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
145 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
146
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
147 rewind($this->cli->stdout);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
148 $version = Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
149 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
150 '["vcard",[["version",{},"text","4.0"],["prodid",{},"text","-\/\/Sabre\/\/Sabre VObject '. $version .'\/\/EN"],["fn",{},"text","Cowboy Henk"]]]',
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
151 stream_get_contents($this->cli->stdout)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
152 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
153
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
154 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
155
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
156 public function testConvertJCardPretty() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
157
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
158 if (version_compare(PHP_VERSION, '5.4.0') < 0) {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
159 $this->markTestSkipped('This test required PHP 5.4.0');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
160 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
161
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
162 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
163
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
164 fwrite($inputStream, <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
165 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
166 VERSION:3.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
167 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
168 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
169 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
170 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
171 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
172 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
173
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
174 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
175 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
176 $this->cli->main(array('vobject', 'convert','--format=jcard', '--pretty', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
177 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
178
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
179 rewind($this->cli->stdout);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
180 $version = Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
181
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
182 // PHP 5.5.12 changed the output
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
183
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
184 $expected = <<<JCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
185 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
186 "vcard",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
187 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
188 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
189 "versi
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
190 JCARD;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
191
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
192 $this->assertStringStartsWith(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
193 $expected,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
194 stream_get_contents($this->cli->stdout)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
195 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
196
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
197 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
198
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
199 public function testConvertJCalFail() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
200
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
201 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
202
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
203 fwrite($inputStream, <<<ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
204 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
205 VERSION:3.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
206 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
207 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
208 ICS
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
209 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
210 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
211 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
212
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
213 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
214 2,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
215 $this->cli->main(array('vobject', 'convert','--format=jcal', '--inputformat=mimedir', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
216 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
217
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
218 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
219
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
220 public function testConvertMimeDir() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
221
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
222 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
223
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
224 fwrite($inputStream, <<<JCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
225 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
226 "vcard",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
227 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
228 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
229 "version",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
230 {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
231
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
232 },
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
233 "text",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
234 "4.0"
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
235 ],
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
236 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
237 "prodid",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
238 {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
239
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
240 },
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
241 "text",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
242 "-\/\/Sabre\/\/Sabre VObject 3.1.0\/\/EN"
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
243 ],
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
244 [
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
245 "fn",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
246 {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
247
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
248 },
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
249 "text",
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
250 "Cowboy Henk"
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
251 ]
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
252 ]
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
253 ]
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
254 JCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
255 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
256 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
257 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
258
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
259 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
260 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
261 $this->cli->main(array('vobject', 'convert','--format=mimedir', '--inputformat=json', '--pretty', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
262 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
263
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
264 rewind($this->cli->stdout);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
265 $expected = <<<VCF
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
266 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
267 VERSION:4.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
268 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
269 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
270 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
271
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
272 VCF;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
273
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
274 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
275 strtr($expected, array("\n"=>"\r\n")),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
276 stream_get_contents($this->cli->stdout)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
277 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
278
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
279 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
280
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
281 public function testConvertDefaultFormats() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
282
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
283 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
284 $outputFile = SABRE_TEMPDIR . 'bar.json';
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
285
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
286 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
287 2,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
288 $this->cli->main(array('vobject', 'convert','foo.json',$outputFile))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
289 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
290
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
291 $this->assertEquals('json', $this->cli->inputFormat);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
292 $this->assertEquals('json', $this->cli->format);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
293
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
294 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
295
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
296 public function testConvertDefaultFormats2() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
297
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
298 $outputFile = SABRE_TEMPDIR . 'bar.ics';
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
299
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
300 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
301 2,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
302 $this->cli->main(array('vobject', 'convert','foo.ics',$outputFile))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
303 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
304
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
305 $this->assertEquals('mimedir', $this->cli->inputFormat);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
306 $this->assertEquals('mimedir', $this->cli->format);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
307
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
308 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
309
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
310 public function testVCard3040() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
311
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
312 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
313
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
314 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
315 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
316 VERSION:3.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
317 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
318 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
319 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
320
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
321 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
322 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
323 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
324 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
325
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
326 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
327 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
328 $this->cli->main(array('vobject', 'convert','--format=vcard40', '--pretty', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
329 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
330
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
331 rewind($this->cli->stdout);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
332
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
333 $version = Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
334 $expected = <<<VCF
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
335 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
336 VERSION:4.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
337 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
338 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
339 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
340
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
341 VCF;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
342
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
343 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
344 strtr($expected, array("\n"=>"\r\n")),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
345 stream_get_contents($this->cli->stdout)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
346 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
347
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
348 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
349
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
350 public function testVCard4030() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
351
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
352 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
353
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
354 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
355 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
356 VERSION:4.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
357 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
358 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
359 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
360
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
361 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
362 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
363 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
364 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
365
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
366 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
367 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
368 $this->cli->main(array('vobject', 'convert','--format=vcard30', '--pretty', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
369 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
370
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
371 $version = Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
372
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
373 rewind($this->cli->stdout);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
374 $expected = <<<VCF
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
375 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
376 VERSION:3.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
377 PRODID:-//Sabre//Sabre VObject $version//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
378 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
379 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
380
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
381 VCF;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
382
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
383 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
384 strtr($expected, array("\n"=>"\r\n")),
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
385 stream_get_contents($this->cli->stdout)
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
386 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
387
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
388 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
389
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
390 public function testVCard4021() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
391
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
392 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
393
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
394 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
395 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
396 VERSION:4.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
397 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
398 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
399 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
400
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
401 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
402 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
403 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
404 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
405
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
406 // vCard 2.1 is not supported yet, so this returns a failure.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
407 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
408 2,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
409 $this->cli->main(array('vobject', 'convert','--format=vcard21', '--pretty', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
410 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
411
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
412 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
413
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
414 function testValidate() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
415
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
416 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
417
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
418 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
419 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
420 VERSION:4.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
421 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
422 UID:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
423 FN:Cowboy Henk
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
424 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
425
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
426 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
427 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
428 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
429 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
430 $result = $this->cli->main(array('vobject', 'validate', '-'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
431
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
432 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
433 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
434 $result
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
435 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
436
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
437 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
438
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
439 function testValidateFail() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
440
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
441 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
442
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
443 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
444 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
445 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
446 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
447
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
448 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
449 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
450 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
451 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
452 // vCard 2.1 is not supported yet, so this returns a failure.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
453 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
454 2,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
455 $this->cli->main(array('vobject', 'validate', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
456 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
457
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
458 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
459
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
460 function testValidateFail2() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
461
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
462 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
463
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
464 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
465 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
466 VERSION:5.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
467 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
468
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
469 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
470 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
471 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
472 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
473 // vCard 2.1 is not supported yet, so this returns a failure.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
474 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
475 2,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
476 $this->cli->main(array('vobject', 'validate', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
477 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
478
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
479 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
480
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
481 function testRepair() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
482
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
483 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
484
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
485 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
486 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
487 VERSION:5.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
488 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
489
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
490 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
491 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
492 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
493 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
494 // vCard 2.1 is not supported yet, so this returns a failure.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
495 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
496 2,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
497 $this->cli->main(array('vobject', 'repair', '-'))
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
498 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
499
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
500 rewind($this->cli->stdout);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
501 $this->assertRegExp("/^BEGIN:VCARD\r\nVERSION:2.1\r\nUID:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\r\nEND:VCARD\r\n$/", stream_get_contents($this->cli->stdout));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
502 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
503
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
504 function testRepairNothing() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
505
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
506 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
507
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
508 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
509 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
510 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
511 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
512 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
513 UID:foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
514 DTSTAMP:20140122T233226Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
515 DTSTART:20140101T120000Z
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
516 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
517 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
518
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
519 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
520 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
521 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
522 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
523 // vCard 2.1 is not supported yet, so this returns a failure.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
524
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
525 $result = $this->cli->main(array('vobject', 'repair', '-'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
526
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
527 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
528 $error = stream_get_contents($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
529
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
530 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
531 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
532 $result,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
533 "This should have been error free. stderr output:\n" . $error
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
534 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
535
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
536 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
537
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
538 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
539 * Note: this is a very shallow test, doesn't dig into the actual output,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
540 * but just makes sure there's no errors thrown.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
541 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
542 * The colorizer is not a critical component, it's mostly a debugging tool.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
543 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
544 function testColorCalendar() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
545
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
546 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
547
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
548 $version = Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
549
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
550 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
551 * This object is not valid, but it's designed to hit every part of the
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
552 * colorizer source.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
553 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
554 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
555 BEGIN:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
556 VERSION:2.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
557 PRODID:-//Sabre//Sabre VObject {$version}//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
558 BEGIN:VTIMEZONE
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
559 END:VTIMEZONE
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
560 BEGIN:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
561 ATTENDEE;RSVP=TRUE:mailto:foo@example.org
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
562 REQUEST-STATUS:5;foo
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
563 ATTACH:blabla
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
564 END:VEVENT
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
565 END:VCALENDAR
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
566
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
567 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
568 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
569 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
570 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
571 // vCard 2.1 is not supported yet, so this returns a failure.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
572
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
573 $result = $this->cli->main(array('vobject', 'color', '-'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
574
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
575 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
576 $error = stream_get_contents($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
577
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
578 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
579 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
580 $result,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
581 "This should have been error free. stderr output:\n" . $error
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
582 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
583
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
584 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
585
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
586 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
587 * Note: this is a very shallow test, doesn't dig into the actual output,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
588 * but just makes sure there's no errors thrown.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
589 *
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
590 * The colorizer is not a critical component, it's mostly a debugging tool.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
591 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
592 function testColorVCard() {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
593
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
594 $inputStream = fopen('php://memory','r+');
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
595
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
596 $version = Version::VERSION;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
597
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
598 /**
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
599 * This object is not valid, but it's designed to hit every part of the
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
600 * colorizer source.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
601 */
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
602 fwrite($inputStream, <<<VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
603 BEGIN:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
604 VERSION:4.0
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
605 PRODID:-//Sabre//Sabre VObject {$version}//EN
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
606 ADR:1;2;3;4a,4b;5;6
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
607 group.TEL:123454768
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
608 END:VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
609
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
610 VCARD
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
611 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
612 rewind($inputStream);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
613 $this->cli->stdin = $inputStream;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
614 // vCard 2.1 is not supported yet, so this returns a failure.
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
615
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
616 $result = $this->cli->main(array('vobject', 'color', '-'));
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
617
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
618 rewind($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
619 $error = stream_get_contents($this->cli->stderr);
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
620
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
621 $this->assertEquals(
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
622 0,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
623 $result,
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
624 "This should have been error free. stderr output:\n" . $error
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
625 );
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
626
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
627 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
628 }
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
629
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
630 class CliMock extends Cli {
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
631
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
632 public $log = array();
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
633
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
634 public $quiet = false;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
635
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
636 public $format;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
637
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
638 public $pretty;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
639
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
640 public $stdin;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
641
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
642 public $stdout;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
643
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
644 public $stderr;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
645
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
646 public $inputFormat;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
647
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
648 public $outputFormat;
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
649
430dbd5346f7 vendor sabre as distributed
Charlie Root
parents:
diff changeset
650 }