function test() { $tree = TreeBuilder::build(file_get_contents(dirname(__FILE__) . '/test.default.header.html') . file_get_contents(HTML2PS_DIR . 'default.css') . file_get_contents(dirname(__FILE__) . '/test.default.footer.html')); $pipeline = new Pipeline(); $pipeline->scan_styles($tree); $css = $pipeline->get_current_css(); $input_rules = $css->tag_filtered['input']; $this->assertEquals(count($input_rules), 10); }
function test() { $tree = TreeBuilder::build(file_get_contents(dirname(__FILE__) . '/test.process.class.case.html')); $pipeline = new Pipeline(); $pipeline->configure(array('renderimages' => true)); $pipeline->scan_styles($tree); $css = $pipeline->get_current_css(); $this->assertEquals(count($css->rules), 1); $rule = $css->rules[0]; $this->assertEquals(array(SELECTOR_ID, 'quickSummary'), $rule->selector[1][0]); }
function test() { $tree = TreeBuilder::build(file_get_contents(dirname(__FILE__) . '/test.process.2.html')); $pipeline = new Pipeline(); $pipeline->scan_styles($tree); $css = $pipeline->get_current_css(); $this->assertEquals(count($css->rules), 1); $rule = $css->rules[0]; $selector = $rule->selector; $this->assertEquals($selector[1][0][0], SELECTOR_CLASS); $this->assertEquals($selector[1][0][1], 'test'); }
function test() { $tree = TreeBuilder::build(file_get_contents(dirname(__FILE__) . '/test.process.margin.left.html')); $pipeline = new Pipeline(); $pipeline->configure(array('renderimages' => true)); $pipeline->scan_styles($tree); $css = $pipeline->get_current_css(); $this->assertEquals(count($css->rules), 1); $rule = $css->rules[0]; $margin = $rule->body->_properties[0]->_value; $this->assertEquals(UNIT_PX, $margin->_units->_unit); $this->assertEquals(600, $margin->_units->_number); }
function test() { $tree = TreeBuilder::build(file_get_contents(dirname(__FILE__) . '/test.process.7.html')); $pipeline = new Pipeline(); $pipeline->configure(array('renderimages' => true)); $pipeline->scan_styles($tree); $css = $pipeline->get_current_css(); $this->assertEquals(count($css->rules), 1); $rule = $css->rules[0]; $this->assertEquals(count($rule->body->_properties), 1); $property = $rule->body->_properties[0]; $this->assertEquals($property->_code, CSS_BACKGROUND); $this->assertEquals($property->_value->_image->_url, 'http://localhost/intl/en_com/images/logo_plain.png'); }
function test() { $tree = TreeBuilder::build(file_get_contents(dirname(__FILE__) . '/test.process.8.html')); $pipeline = new Pipeline(); $pipeline->configure(array('renderimages' => true)); $pipeline->scan_styles($tree); $css = $pipeline->get_current_css(); $this->assertEquals(count($css->rules), 1); $rule = $css->rules[0]; $this->assertEquals(count($rule->body->_properties), 1); $property = $rule->body->_properties[0]; $this->assertEquals($property->_code, CSS_BACKGROUND_COLOR); $this->assertEquals($property->_value->r, 1); $this->assertEquals($property->_value->g, 1); $this->assertEquals($property->_value->b, 1); $this->assertEquals($property->_value->transparent, false); }
function test() { $tree = TreeBuilder::build(file_get_contents(dirname(__FILE__) . '/test.process.padding.html')); $pipeline = new Pipeline(); $pipeline->configure(array('renderimages' => true)); $pipeline->scan_styles($tree); $css = $pipeline->get_current_css(); $this->assertEquals(count($css->rules), 1); $rule = $css->rules[0]; $padding = $rule->body->_properties[1]->_value; $this->assertEquals(UNIT_PX, $padding->top->_units->_unit); $this->assertEquals(0, $padding->top->_units->_number); $this->assertEquals(UNIT_PX, $padding->right->_units->_unit); $this->assertEquals(175, $padding->right->_units->_number); $this->assertEquals(UNIT_PX, $padding->bottom->_units->_unit); $this->assertEquals(0, $padding->bottom->_units->_number); $this->assertEquals(UNIT_PX, $padding->left->_units->_unit); $this->assertEquals(110, $padding->left->_units->_number); }