Lines Matching +full:php +full:- +full:version
1 <?php
14 $this->cli = new CliMock();
15 $this->cli->stderr = fopen('php://memory', 'r+');
16 $this->cli->stdout = fopen('php://memory', 'r+');
22 $this->assertEquals(
24 $this->cli->main(['vobject', '--hi'])
26 rewind($this->cli->stderr);
27 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
33 $this->assertEquals(
35 $this->cli->main(['vobject', '-q'])
37 $this->assertTrue($this->cli->quiet);
39 rewind($this->cli->stderr);
40 $this->assertEquals(0, strlen(stream_get_contents($this->cli->stderr)));
46 $this->assertEquals(
48 $this->cli->main(['vobject', '-h'])
50 rewind($this->cli->stderr);
51 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
57 $this->assertEquals(
59 $this->cli->main(['vobject', '--format=jcard'])
62 rewind($this->cli->stderr);
63 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
65 $this->assertEquals('jcard', $this->cli->format);
71 $this->assertEquals(
73 $this->cli->main(['vobject', '--format=foo'])
76 rewind($this->cli->stderr);
77 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
79 $this->assertNull($this->cli->format);
85 $this->assertEquals(
87 $this->cli->main(['vobject', '--inputformat=foo'])
90 rewind($this->cli->stderr);
91 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
93 $this->assertNull($this->cli->format);
100 $this->assertEquals(
102 $this->cli->main(['vobject', 'color'])
105 rewind($this->cli->stderr);
106 $this->assertTrue(strlen(stream_get_contents($this->cli->stderr)) > 100);
112 $this->assertEquals(
114 $this->cli->main(['vobject', 'color', 'a', 'b', 'c'])
121 $this->assertEquals(
123 $this->cli->main(['vobject', 'foo', '-'])
130 $inputStream = fopen('php://memory', 'r+');
134 VERSION:3.0
140 $this->cli->stdin = $inputStream;
142 $this->assertEquals(
144 $this->cli->main(['vobject', 'convert', '--format=json', '-'])
147 rewind($this->cli->stdout);
148 $version = Version::VERSION;
149 $this->assertEquals(
150 …'["vcard",[["version",{},"text","4.0"],["prodid",{},"text","-\/\/Sabre\/\/Sabre VObject ' . $versi…
151 stream_get_contents($this->cli->stdout)
159 $this->markTestSkipped('This test required PHP 5.4.0');
162 $inputStream = fopen('php://memory', 'r+');
166 VERSION:3.0
172 $this->cli->stdin = $inputStream;
174 $this->assertEquals(
176 $this->cli->main(['vobject', 'convert', '--format=jcard', '--pretty', '-'])
179 rewind($this->cli->stdout);
181 // PHP 5.5.12 changed the output
191 $this->assertStringStartsWith(
193 stream_get_contents($this->cli->stdout)
200 $inputStream = fopen('php://memory', 'r+');
204 VERSION:3.0
210 $this->cli->stdin = $inputStream;
212 $this->assertEquals(
214 $this->cli->main(['vobject', 'convert', '--format=jcal', '--inputformat=mimedir', '-'])
221 $inputStream = fopen('php://memory', 'r+');
228 "version",
241 "-\/\/Sabre\/\/Sabre VObject 3.1.0\/\/EN"
256 $this->cli->stdin = $inputStream;
258 $this->assertEquals(
260 …$this->cli->main(['vobject', 'convert', '--format=mimedir', '--inputformat=json', '--pretty', '-'])
263 rewind($this->cli->stdout);
266 VERSION:4.0
267 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
273 $this->assertEquals(
275 stream_get_contents($this->cli->stdout)
284 $this->assertEquals(
286 $this->cli->main(['vobject', 'convert', 'foo.json', $outputFile])
289 $this->assertEquals('json', $this->cli->inputFormat);
290 $this->assertEquals('json', $this->cli->format);
298 $this->assertEquals(
300 $this->cli->main(['vobject', 'convert', 'foo.ics', $outputFile])
303 $this->assertEquals('mimedir', $this->cli->inputFormat);
304 $this->assertEquals('mimedir', $this->cli->format);
310 $inputStream = fopen('php://memory', 'r+');
314 VERSION:3.0
315 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
322 $this->cli->stdin = $inputStream;
324 $this->assertEquals(
326 $this->cli->main(['vobject', 'convert', '--format=vcard40', '--pretty', '-'])
329 rewind($this->cli->stdout);
331 $version = Version::VERSION;
334 VERSION:4.0
335 PRODID:-//Sabre//Sabre VObject $version//EN
341 $this->assertEquals(
343 stream_get_contents($this->cli->stdout)
350 $inputStream = fopen('php://memory', 'r+');
354 VERSION:4.0
355 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
362 $this->cli->stdin = $inputStream;
364 $this->assertEquals(
366 $this->cli->main(['vobject', 'convert', '--format=vcard30', '--pretty', '-'])
369 $version = Version::VERSION;
371 rewind($this->cli->stdout);
374 VERSION:3.0
375 PRODID:-//Sabre//Sabre VObject $version//EN
381 $this->assertEquals(
383 stream_get_contents($this->cli->stdout)
390 $inputStream = fopen('php://memory', 'r+');
394 VERSION:4.0
395 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
402 $this->cli->stdin = $inputStream;
404 $this->assertEquals(
406 $this->cli->main(['vobject', 'convert', '--format=vcard21', '--pretty', '-'])
413 $inputStream = fopen('php://memory', 'r+');
417 VERSION:4.0
418 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
426 $this->cli->stdin = $inputStream;
427 $result = $this->cli->main(['vobject', 'validate', '-']);
429 $this->assertEquals(
438 $inputStream = fopen('php://memory', 'r+');
442 VERSION:2.0
448 $this->cli->stdin = $inputStream;
450 $this->assertEquals(
452 $this->cli->main(['vobject', 'validate', '-'])
459 $inputStream = fopen('php://memory', 'r+');
463 VERSION:5.0
469 $this->cli->stdin = $inputStream;
471 $this->assertEquals(
473 $this->cli->main(['vobject', 'validate', '-'])
480 $inputStream = fopen('php://memory', 'r+');
484 VERSION:5.0
490 $this->cli->stdin = $inputStream;
492 $this->assertEquals(
494 $this->cli->main(['vobject', 'repair', '-'])
497 rewind($this->cli->stdout);
498 …->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…
503 $inputStream = fopen('php://memory', 'r+');
507 VERSION:2.0
508 PRODID:-//Sabre//Sabre VObject 3.1.0//EN
519 $this->cli->stdin = $inputStream;
521 $result = $this->cli->main(['vobject', 'repair', '-']);
523 rewind($this->cli->stderr);
524 $error = stream_get_contents($this->cli->stderr);
526 $this->assertEquals(
542 $inputStream = fopen('php://memory', 'r+');
544 $version = Version::VERSION;
552 VERSION:2.0
553 PRODID:-//Sabre//Sabre VObject {$version}//EN
558 REQUEST-STATUS:5;foo
566 $this->cli->stdin = $inputStream;
568 $result = $this->cli->main(['vobject', 'color', '-']);
570 rewind($this->cli->stderr);
571 $error = stream_get_contents($this->cli->stderr);
573 $this->assertEquals(
589 $inputStream = fopen('php://memory', 'r+');
591 $version = Version::VERSION;
599 VERSION:4.0
600 PRODID:-//Sabre//Sabre VObject {$version}//EN
608 $this->cli->stdin = $inputStream;
610 $result = $this->cli->main(['vobject', 'color', '-']);
612 rewind($this->cli->stderr);
613 $error = stream_get_contents($this->cli->stderr);
615 $this->assertEquals(