public function testGrep() { include_once TMX . 'fr/cache_fr_central.php'; $obj = new _Search(); $obj->setSearchTerms('Marque')->setRegexWholeWords('whole_word'); $this->array($obj->grep($tmx))->isEqualTo(["browser/chrome/browser/places/places.properties:bookmarkResultLabel" => "Marque-page", "browser/chrome/browser/syncQuota.properties:collection.bookmarks.label" => "Marque-pages", "browser/chrome/browser/places/bookmarkProperties.properties:dialogTitleAddMulti" => "Nouveaux marque-pages"]); }
public function testMultipleRegexChanges() { $obj = new _Search(); $obj->setSearchTerms('A new hope')->setRegexWholeWords('whole_word')->setRegexPerfectMatch(false)->setRegexCaseInsensitive('sensitive'); $this->string($obj->getRegex())->isEqualTo('~\\bA new hope\\b~u'); $obj->setSearchTerms('Return of the jedi')->setRegexWholeWords('')->setRegexPerfectMatch(true)->setRegexCaseInsensitive(''); $this->string($obj->getRegex())->isEqualTo('~^Return of the jedi$~iu'); }