/** * Hook handler for CreateDefaultQuestionPageFilter hook * @see extensions/wikia/Answers/PrefilledDefaultQuestion.php#L15 * @see extensions/wikia/Answers/DefaultQuestion.php#L50 * * @static * * @param Title $title -- instance of Title class * * @return Bool -- is word bad or not */ public static function badWordsTest($title) { wfProfileIn(__METHOD__); $language = RequestContext::getMain()->getLanguage(); $phalanxModel = new PhalanxContentModel($title, $language->getCode()); $ret = $phalanxModel->match_question_title(); wfProfileOut(__METHOD__); return $ret; }
/** * @group Slow * @slowExecutionTime 0.04619 ms * @dataProvider phalanxTitleDataProvider */ public function testPhalanxContentModelQuestionTitle($title, $block, $language, $result) { $titleMock = $this->setUpTitle($title); $this->setUpTest($block); $model = new PhalanxContentModel($titleMock, $language); $ret = (int) $model->match_question_title(); $this->assertEquals($result, $ret); }