You are here

typogrify-smartypants.test in Typogrify 6

Same filename and directory in other branches
  1. 7 tests/typogrify-smartypants.test

typogrify.class.test Unit tests for the basic typogrify functionality.

File

tests/typogrify-smartypants.test
View source
<?php

// $Id$

/**
 * @file typogrify.class.test
 * Unit tests for the basic typogrify functionality.
 */
class TypogrifySmartyPantsTestCase extends DrupalWebTestCase {

  /**
   * Implementation of getInfo().
   */
  function getInfo() {
    return array(
      'name' => t('Typogrify with SmartyPants'),
      'description' => t('Test the application of the full package of Typogrify and SmartyPants.'),
      'group' => t('Typogrify'),
    );
  }

  /**
   * Implementation of setUp().
   */
  function setUp() {
    parent::setUp('typogrify');
    module_load_include('class.php', 'typogrify');
    module_load_include('php', 'typogrify', 'unicode-conversion');
    module_load_include('php', 'typogrify', 'smartypants');
  }
  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><span class="dquo">&#8220;</span>Jayhawks&#8221; <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. &#8220;Excepteur sint occaecat &#8216;cupidatat&#8217; non proident&#8221; sunt <span class="caps">RFID22</span>&nbsp;in&#8230;. </p>
HTML;
    $result = _typogrify_process($before, 'test');
    $this
      ->assertEqual($result, $after, t('Original Typogrify example.'));
  }

}

Classes

Namesort descending Description
TypogrifySmartyPantsTestCase @file typogrify.class.test Unit tests for the basic typogrify functionality.