You are here

function TypogrifySmartyPantsTestCase::testOriginalTypogrifyExample in Typogrify 7

Same name and namespace in other branches
  1. 6 tests/typogrify-smartypants.test \TypogrifySmartyPantsTestCase::testOriginalTypogrifyExample()

Original example compatibility-test.

File

tests/typogrify-smartypants.test, line 52
Unit tests for the basic typogrify functionality.

Class

TypogrifySmartyPantsTestCase
@file Unit tests for the basic typogrify functionality.

Code

function testOriginalTypogrifyExample() {
  $before = <<<HTML
<h2>"Jayhawks" & KU fans act extremely obnoxiously</h2>
<p>By J.D. Salinger, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "Excepteur sint occaecat 'cupidatat' non proident" sunt RFID22 in.... </p>
HTML;
  $after = <<<HTML
<h2>“Jayhawks” <span class="amp">&amp;</span> <span class="caps">KU</span> fans act extremely&nbsp;obnoxiously</h2>
<p>By <span class="caps">J.D.</span> Salinger, Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. “Excepteur sint occaecat ‘cupidatat’ non proident” sunt <span class="caps">RFID22</span>&nbsp;in&#8230;. </p>
HTML;
  global $filter;
  $result = _typogrify_process($before, $filter, NULL, 'en', NULL, NULL);
  $this
    ->assertEqual($result, $after, t('Original Typogrify example.'));
}