1<?php 2 3class TestFloat extends GenericTest { 4 function testFloatLeft() { 5 $tree = $this->runPipeline(' 6<html> 7<head> 8<style type="text/css"> 9body { font-size: 10mm; } 10#div1 { float: left; } 11</style> 12</head> 13<body> 14<div id="div1"> </div> 15</body> 16</html> 17'); 18 19 $first_div = $tree->get_element_by_id('div1'); 20 $body = $tree; 21 22 $this->assertEqual($body->get_left(), 23 $first_div->get_left_margin()); 24 } 25 26 function testFloatRight() { 27 $tree = $this->runPipeline(' 28<html> 29<head> 30<style type="text/css"> 31body { font-size: 10mm; } 32#div1 { float: right; } 33</style> 34</head> 35<body> 36<div id="div1"> </div> 37</body> 38</html> 39'); 40 41 $first_div = $tree->get_element_by_id('div1'); 42 $body = $tree; 43 44 $this->assertEqual($body->get_right(), 45 $first_div->get_right_margin()); 46 } 47} 48 49?>