getCompiled() public static method

public static getCompiled ( ) : array
return array
Beispiel #1
0
 public function testGetCompiled()
 {
     Query::setCompiled([]);
     $selector = '.post h2';
     $xpath = '//*[contains(concat(" ", normalize-space(@class), " "), " post ")]//h2';
     $compiled = [$selector => $xpath];
     Query::compile($selector);
     $this->assertEquals($compiled, Query::getCompiled());
 }
Beispiel #2
0
 public function testGetCompiled()
 {
     Query::setCompiled([]);
     $selector = '#foo .bar baz';
     $xpath = '//*[@id="foo"]//*[contains(concat(" ", normalize-space(@class), " "), " bar ")]//baz';
     $compiled = [$selector => $xpath];
     Query::compile($selector);
     $this->assertEquals($compiled, Query::getCompiled());
 }
Beispiel #3
0
 public function testGetCompiled()
 {
     Query::setCompiled([]);
     $selector = '.post h2';
     $xpath = "//*[contains(concat(' ', normalize-space(@class), ' '), ' post ')]";
     $compiled = [$selector => $xpath];
     $xpath = Query::compile($selector);
     $compiled = Query::getCompiled();
     $this->assertEquals($compiled, Query::getCompiled());
 }
Beispiel #4
0
 public function testGetCompiled()
 {
     Query::setCompiled([]);
     $selector = '.post h2';
     $xpath = Query::compile($selector);
     $compiled = Query::getCompiled();
     $this->assertTrue(is_array($compiled));
     $this->assertEquals(1, count($compiled));
     $this->assertTrue(array_key_exists($selector, $compiled));
     $this->assertEquals($xpath, $compiled[$selector]);
 }