typogrify-smartypants.test in Typogrify 6
Same filename and directory in other branches
typogrify.class.test Unit tests for the basic typogrify functionality.
File
tests/typogrify-smartypants.testView 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">“</span>Jayhawks” <span class="amp">&</span> <span class="caps">KU</span> fans act extremely 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> in…. </p>
HTML;
$result = _typogrify_process($before, 'test');
$this
->assertEqual($result, $after, t('Original Typogrify example.'));
}
}
Classes
Name | Description |
---|---|
TypogrifySmartyPantsTestCase | @file typogrify.class.test Unit tests for the basic typogrify functionality. |