removeQuotes() public static method

Remove leading and trailing quotes.
public static removeQuotes ( $str )
 public function testRemoveQuotes()
 {
     $this->assertEquals('foo', Util::removeQuotes('"foo"'));
     $this->assertEquals('foo', Util::removeQuotes("'foo'"));
     $this->assertEquals('"foo\'', Util::removeQuotes("\"foo'"));
     $this->assertEquals('f"o"o', Util::removeQuotes('f"o"o'));
 }
Beispiel #2
0
 /**
  * Provides :contains-exactly QueryPath pseudoclass.
  *
  * This is an EXACT match.
  */
 protected function containsExactly($node, $value)
 {
     $text = $node->textContent;
     $value = Util::removeQuotes($value);
     return isset($text) && $text == $value;
 }