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