/
write_css_basic.phpt
54 lines (43 loc) · 980 Bytes
/
write_css_basic.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--TEST--
MarkdownDocument::writeCss basic test
--SKIPIF--
<?php
if (!extension_loaded('discount'))
die('SKIP discount extension not loaded');
--FILE--
<?php
$t1 = <<<EOD
<style type="text/css">
.mystyle {}
</style>
dfd<style type="text/css">
.mystyle2 {}
</style>
<style type="text/css">
.mystyle3 {}
EOD;
$md = MarkdownDocument::createFromString($t1);
$md->compile();
var_dump($md->writeCss($f = fopen('php://temp', 'r+b')));
echo stream_get_contents($f, -1, 0);
echo "\n======\n";
$md = MarkdownDocument::createFromString($t1);
$md->compile(MarkdownDocument::NOHTML);
var_dump($md->writeCss($f = fopen('php://temp', 'r+b')));
echo stream_get_contents($f, -1, 0);
echo "\n======\n";
$md = MarkdownDocument::createFromString('');
$md->compile();
var_dump($md->writeCss($f = fopen('php://temp', 'r+b')));
echo stream_get_contents($f, -1, 0);
echo "\nDone.\n";
--EXPECT--
bool(true)
<style type="text/css">
.mystyle {}
</style>
======
bool(true)
======
bool(true)
Done.