| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
class TestPagebreakFixedHeight extends GenericTest {
|
|
|
4 |
function testPagebreakFixedHeight1() {
|
|
|
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(file_get_contents('test.pagebreak.fixed.height.1.html'), $media);
|
|
|
8 |
|
|
|
9 |
$page_heights = PageBreakLocator::getPages($tree,
|
|
|
10 |
mm2pt($media->real_height()),
|
|
|
11 |
mm2pt($media->height() - $media->margins['top']));
|
|
|
12 |
|
|
|
13 |
$div = $tree->get_element_by_id('div');
|
|
|
14 |
|
|
|
15 |
$this->assertEqual(count($page_heights), 2,
|
|
|
16 |
sprintf("Two pages expected, got %s",
|
|
|
17 |
count($page_heights)));
|
|
|
18 |
$this->assertEqual($page_heights[0],
|
|
|
19 |
200);
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
?>
|