X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Ftypogrify%2Fsrc%2FTests%2FTypogrifySmartyPantsTestCase.php;fp=web%2Fmodules%2Fcontrib%2Ftypogrify%2Fsrc%2FTests%2FTypogrifySmartyPantsTestCase.php;h=0da76240daad6179681163b6ca6eb2df3bc55beb;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/typogrify/src/Tests/TypogrifySmartyPantsTestCase.php b/web/modules/contrib/typogrify/src/Tests/TypogrifySmartyPantsTestCase.php new file mode 100644 index 000000000..0da76240d --- /dev/null +++ b/web/modules/contrib/typogrify/src/Tests/TypogrifySmartyPantsTestCase.php @@ -0,0 +1,61 @@ + t('Typogrify with SmartyPants'), + 'description' => t('Test the application of the full package of Typogrify and SmartyPants.'), + 'group' => t('Typogrify'), + ); + } + + /** + * Implement setUp(). + */ + public function setUp() { + parent::setUp('typogrify'); + global $filter; + $filter = (object) array( + 'settings' => array( + 'smartypants_enabled' => 1, + 'smartypants_hyphens' => 2, + 'wrap_ampersand' => 1, + 'widont_enabled' => 1, + 'wrap_abbr' => 0, + 'wrap_caps' => 1, + 'wrap_initial_quotes' => 1, + 'hyphenate_shy' => 0, + 'wrap_numbers' => 0, + 'ligatures' => array(), + 'arrows' => array(), + 'quotes' => array(), + ), + ); + + } + + /** + * Original example compatibility-test. + */ + public function testOriginalTypogrifyExample() { + + $before = <<"Jayhawks" & KU fans act extremely obnoxiously +

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....

+HTML; + $after = <<“Jayhawks” & KU fans act extremely obnoxiously +

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….

+HTML; + + global $filter; + $result = _typogrify_process($before, $filter, NULL, 'en', NULL, NULL); + $this->assertEqual($result, $after, t('Original Typogrify example.')); + + } +}