Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
class TestPagebreakBr extends GenericTest {
4
  function testPagebreakNormal() {
5
    $media = new Media(array('width' => 100, 'height' => 200/mm2pt(1)),
6
                       array('top'=>0, 'bottom'=>0, 'left'=>0, 'right'=>0));
7
    $tree = $this->runPipeline('
8
<html>
9
<head>
10
body   { font-size: 10pt; line-height: 1; padding: 0; margin: 0; }
11
</style>
12
</head>
13
<body>
14
<div style="width: 1em;">
15
LINE1
16
LINE2
17
LINE3
18
LINE4
19
LINE5
20
</div>
21
</body>
22
</html>
23
', $media);
24
 
25
    $locations = PageBreakLocator::_getBreakLocations($tree);
26
    $this->assertEqual(count($locations),
27
                       6);
28
  }
29
 
30
  function testPagebreakWithBR() {
31
    $media = new Media(array('width' => 100, 'height' => 200/mm2pt(1)),
32
                       array('top'=>0, 'bottom'=>0, 'left'=>0, 'right'=>0));
33
    $tree = $this->runPipeline('
34
<html>
35
<head>
36
body   { font-size: 10pt; line-height: 1; padding: 0; margin: 0; }
37
</style>
38
</head>
39
<body>
40
<div>
41
LINE1<br/>
42
LINE2<br/>
43
LINE3<br/>
44
LINE4<br/>
45
LINE5<br/>
46
</div>
47
</body>
48
</html>
49
', $media);
50
 
51
    $locations = PageBreakLocator::_getBreakLocations($tree);
52
    $this->assertEqual(count($locations),
53
                       6);
54
  }
55
}
56
 
57
?>