public function testExcludeWordsIsNotCaseSensitive() { $text = 'You Will Be Here'; $wordsToExclude = array('will', 'here'); $result = WordExcluder::excludeWordsFromText($text, $wordsToExclude); $this->assertEquals('You Be', $result); }
/** * @param $text * @return string */ public function slugify($text) { $text = $this->deletePunctuationMarks($text); if ($this->wordsToExclude) { $text = WordExcluder::excludeWordsFromText($text, $this->wordsToExclude); } $text = $this->handleWhiteSpaces($text); $text = mb_strtolower($text, 'UTF-8'); if ($this->rules) { $text = strtr($text, $this->rules); } return $text; }