public function testQPMerge() { $options = array('test1' => 'val1', 'test2' => 'val2'); $options2 = array('test1' => 'val3', 'test4' => 'val4'); QueryPathOptions::set($options); QueryPathOptions::merge($options2); $results = QueryPathOptions::get(); $this->assertTrue(QueryPathOptions::has('test4')); $this->assertEquals('val3', $results['test1']); }
public function testIgnoreParserWarnings() { $qp = @qp('<html><body><b><i>BAD!</b></i></body>', NULL, array('ignore_parser_warnings' => TRUE)); $this->assertTrue(strpos($qp->html(), '<i>BAD!</i>') !== FALSE); QueryPathOptions::merge(array('ignore_parser_warnings' => TRUE)); $qp = @qp('<html><body><b><i>BAD!</b></i></body>'); $this->assertTrue(strpos($qp->html(), '<i>BAD!</i>') !== FALSE); $qp = @qp('<html><body><blarg>BAD!</blarg></body>'); $this->assertTrue(strpos($qp->html(), '<blarg>BAD!</blarg>') !== FALSE, $qp->html()); QueryPathOptions::set(array()); // Reset to empty options. }