public function renderTestContent($content) { // Protection for calling the_content filter not on current test content $isSimilar = 50 > levenshtein($this->prepareToLevenshein($this->test->getContent()), $this->prepareToLevenshein($content)); if (!$isSimilar) { return $content; } // Protection for many times calling the_content filter if (!is_null($this->filteredTestContent)) { return $this->filteredTestContent; } $action = $this->getTestPassingAction(); $template = $this->wp->locateTemplate('entry-content-wpt-test-' . $action . '.php'); $template = $template ? $template : 'Test/Passer/' . $action; $this->wp->doAction('wp_testing_passer_render_content', $this->test); $this->wp->doAction('wp_testing_passer_render_content_' . $action, $this->test); $this->filteredTestContent = $this->createActionProcessor($action)->renderContent($content, $template); return $this->filteredTestContent; }