Example #1
0
 /**
  * @covers Phossa\RegEx\RegEx::quotedString
  */
 public function testQuotedString()
 {
     // pattern
     $regex = RegEx::quotedString(RegExOption::OPTION_DEFAULT ^ RegExOption::OPTION_CLOSURE);
     $pattern = Utility::toPattern($regex);
     // normal string
     $str1 = 'test \'single\' "double" \'single
     cross\' "double
     cross" "no close';
     $this->assertEquals(5, preg_match_all($pattern, $str1, $m));
     $this->assertEquals('"no close', $m[0][4]);
 }