示例#1
0
 /**
  * @testdox toJS() returns a JavaScript Code
  */
 public function testToJS()
 {
     $regexp = new Regexp('/foo/i');
     $this->assertInstanceOf('s9e\\TextFormatter\\Configurator\\JavaScript\\Code', $regexp->toJS());
 }
示例#2
0
 /**
  * Encode a Regexp object into JavaScript
  *
  * @param  Regexp $regexp
  * @return string
  */
 protected function encodeRegexp(Regexp $regexp)
 {
     return (string) $regexp->toJS();
 }