forked from mpdf/mpdf
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue538Test.php
More file actions
62 lines (49 loc) · 1.72 KB
/
Issue538Test.php
File metadata and controls
62 lines (49 loc) · 1.72 KB
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
55
56
57
58
59
60
61
62
<?php
namespace Issues;
use Mpdf\BaseMpdfTest;
use Mpdf\Output\Destination;
class Issue538Test extends BaseMpdfTest
{
public function testCompoundClassSelector()
{
$this->mpdf->WriteHTML('
<style>
.one {
font-weight: bold;
}
.two {
font-style: italic;
}
.one.two {
color: red;
}
span.three.four {
color: green;
}
span.three.four.five {
font-weight: bold;
}
.one.three {
font-size: xx-small;
}
</style>
<p class="one">First paragraph</p>
<p class="two">Second paragraph</p>
<p class="one two one">Third paragraph</p>
<p><span class="three four">A wild fox</span> jumped over <span class="five four three">a lazy dog</span></p>
<p class="one two three four">This should be really small</p>
');
$this->mpdf->SetCompression(false);
$output = $this->mpdf->Output('', Destination::STRING_RETURN);
$this->assertStringContainsString("BT /F2 11.000 Tf ET\nq 0.000 g 0 Tr BT 42.520 785.363 Td (First paragraph) Tj ET Q", $output);
$this->assertStringContainsString("BT /F3 11.000 Tf ET\nq 0.000 g 0 Tr BT 42.520 759.197 Td (Second paragraph) Tj ET Q", $output);
$this->assertStringContainsString("BT /F4 11.000 Tf ET\nq 1.000 0.000 0.000 rg 0 Tr BT 42.520 732.635 Td (Third paragraph) Tj ET Q", $output);
$this->assertStringContainsString("BT /F1 11.000 Tf ET\n" .
"/GS1 gs\n" .
"q 0.000 0.502 0.000 rg 0 Tr BT 42.520 705.867 Td (A wild fox) Tj ET Q\n" .
"q 0.000 g 0 Tr BT 90.183 705.867 Td ( jumped over ) Tj ET Q\n" .
"BT /F2 11.000 Tf ET\n" .
"q 0.000 0.502 0.000 rg 0 Tr BT 150.980 705.867 Td (a lazy dog) Tj ET Q", $output);
$this->assertStringContainsString("BT /F4 7.700 Tf ET\nq 1.000 0.000 0.000 rg 0 Tr BT 42.520 682.556 Td (This should be really small) Tj ET Q", $output);
}
}