1<?php
2
3class TestBorderTop extends GenericTest {
4  function testBorderTop1() {
5    $tree = $this->runPipeline(file_get_contents('test.border-top.1.html'));
6
7    $element =& $tree->get_element_by_id('div1');
8    $border =& $element->getCSSProperty(CSS_BORDER);
9    $right =& $border->get_right();
10    $this->assertEqual($right->get_style(), BS_NONE);
11    $bottom =& $border->get_bottom();
12    $this->assertEqual($bottom->get_style(), BS_NONE);
13    $left =& $border->get_left();
14    $this->assertEqual($left->get_style(), BS_NONE);
15    $top =& $border->get_top();
16    $this->assertEqual($top->get_style(), BS_SOLID);
17    $width =& $top->get_width();
18    $this->assertEqual($width, px2pt(1));
19    $color =& $top->get_color();
20    $this->assertEqual($color->r, 0);
21    $this->assertEqual($color->g, 0);
22    $this->assertEqual($color->b, 0);
23
24    $element =& $tree->get_element_by_id('div2');
25    $border =& $element->getCSSProperty(CSS_BORDER);
26    $right =& $border->get_right();
27    $this->assertEqual($right->get_style(), BS_NONE);
28    $bottom =& $border->get_bottom();
29    $this->assertEqual($bottom->get_style(), BS_NONE);
30    $left =& $border->get_left();
31    $this->assertEqual($left->get_style(), BS_NONE);
32    $top =& $border->get_top();
33    $this->assertEqual($top->get_style(), BS_SOLID);
34    $width =& $top->get_width();
35    $this->assertEqual($width, px2pt(1));
36    $color =& $top->get_color();
37    $this->assertEqual($color->r, 0);
38    $this->assertEqual($color->g, 0);
39    $this->assertEqual($color->b, 0);
40  }
41}
42
43?>