100, 'height' => 200/mm2pt(1)), array('top'=>0, 'bottom'=>0, 'left'=>0, 'right'=>0)); $tree = $this->runPipeline(' body { font-size: 10pt; line-height: 1; padding: 0; margin: 0; }
TEXT1TEXT2
TEXT3TEXT4
TEXT5TEXT6
', $media); $locations = PageBreakLocator::_getBreakLocations($tree); $this->assertEqual(count($locations), 4); } function testPagebreakTable2() { $media = new Media(array('width' => 100, 'height' => 200/mm2pt(1)), array('top'=>0, 'bottom'=>0, 'left'=>0, 'right'=>0)); $tree = $this->runPipeline(' body { font-size: 10pt; line-height: 1; padding: 0; margin: 0; } table { line-height: 1; }
TEXT1_1
TEXT1_2
', $media); $locations = PageBreakLocator::_getBreakLocations($tree); $table = $tree->get_element_by_id('table'); $cell = $tree->get_element_by_id('cell'); $line1 = $cell->content[0]->getLineBox(0); $this->assertEqual(count($locations), 3, "Testing number of page breaks inside a table with one cell & several text lines inside [%s]"); $this->assertEqual($locations[0]->location, $table->get_top_margin(), "First page break should be at the table top [%s]"); $this->assertEqual($locations[1]->location, $line1->bottom, "Second page break should be at the bottom of the first line box in the table cell [%s]"); $this->assertEqual($locations[2]->location, $table->get_bottom_margin(), "Last page break should be at the table bottom [%s]"); } } ?>