예제 #1
0
 /**
  * @param PhpQueryObject $pq
  * @dataProvider provider
  * @return void
  */
 public function testCssParser()
 {
     PhpQuery::$enableCssShorthand = FALSE;
     $expected_html = '<div style="color:red;display:none;margin:20px;padding:10px"><span>Hello World!</span></div>';
     $expected_pq = PhpQuery::newDocumentHTML($expected_html);
     $test_pq = PhpQuery::newDocumentHTML('<div style="margin:10px; padding:10px">');
     $test = pq('div');
     $test->append('<span>Hello World!</span>');
     $test->hide();
     $test->css('color', 'red');
     $test->css('margin', '20px');
     $this->assertEqualXMLStructure($expected_pq->find('div')->elements[0], $test->elements[0]);
 }