public function testQPMerge() { $options = array('test1' => 'val1', 'test2' => 'val2'); $options2 = array('test1' => 'val3', 'test4' => 'val4'); Options::set($options); Options::merge($options2); $results = Options::get(); $this->assertTrue(Options::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); \QueryPath\Options::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()); \QueryPath\Options::set(array()); // Reset to empty options. }