1<?php
2
3class 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>
10body   { font-size: 10pt; line-height: 1; padding: 0; margin: 0; }
11</style>
12</head>
13<body>
14<div style="width: 1em;">
15LINE1
16LINE2
17LINE3
18LINE4
19LINE5
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>
36body   { font-size: 10pt; line-height: 1; padding: 0; margin: 0; }
37</style>
38</head>
39<body>
40<div>
41LINE1<br/>
42LINE2<br/>
43LINE3<br/>
44LINE4<br/>
45LINE5<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?>