/** * @test */ public function getShortHTMLText() { // Sans ajouter de bouton... $fullText = "Mauris facilisis, erat sollicitudin porttitor imperdiet, {{LIRE_LA_SUITE}}nulla nibh ultrices quam"; $expected = "Mauris facilisis, erat sollicitudin porttitor imperdiet,"; $this->assertEquals($expected, h::trim(ViewHelper::getShortHTMLText($fullText, ''))); // Avec un bouton ajouté... $fullText = "Mauris facilisis, erat sollicitudin porttitor imperdiet, {{LIRE_LA_SUITE}}nulla nibh ultrices quam"; $buttonMore = ViewHelper::getButtonMore(); $expected = "Mauris facilisis, erat sollicitudin porttitor imperdiet, {$buttonMore}"; $this->assertEquals($expected, h::trim(ViewHelper::getShortHTMLText($fullText))); }