Changeset 653 for trunk/tests/UtilitiesTest.php
- Timestamp:
- Nov 28, 2018 1:40:13 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/UtilitiesTest.php
r545 r653 35 35 function setUp() 36 36 { 37 define('_CLI', true);37 // define('_CLI', true); 38 38 require dirname(__FILE__) . '/_config.inc.php'; 39 39 require_once '../lib/Utilities.inc.php'; … … 255 255 } 256 256 257 function test_fancyTxt() 258 { 259 $strings = [ 260 'Due to the <a href="https://en.wikipedia.org/wiki/Camp_Fire_(2018)">fires in "Paradise," CA</a> it\'s a bad day.' => '⢠Due to the <a href="https://en.wikipedia.org/wiki/Camp_Fire_(2018)">fires in âParadise,â CA</a> itâs a bad day.', 261 'Simply--"\'check back\' later"--in 6\'3"...' => '⢠Simply â ââcheck backâ laterâ â in 6\'3"âŠ', 262 '"Double "double \'single\'""--?' => '⢠"Double âdouble âsingleââ" â ?', 263 '<a href="javascript:openPopup(\'/foo/bar.php\')">Click here</a>....' => '⢠<a href="javascript:openPopup(\'/foo/bar.php\')">Click here</a>....', 264 'If you have any questions please <a href="/contact/">contact the ants\' mailboxes</a>.' => '⢠If you have any questions please <a href="/contact/">contact the antsâ mailboxes</a>.', 265 'This URL: "http://äŸå.å·ç纞/?x=y&1=2#asdf"' => '⢠This URL: âhttp://äŸå.å·ç纞/?x=y&1=2#asdfâ', 266 // '\'...\' and "..."' => '⢠ââŠâ and ââŠâ', // FIXME: this one doesn't work. 267 '\'1...\' and "2..."' => '⢠â1âŠâ and â2âŠâ', 268 '\'One\'s self...\' and "Twosome"' => '⢠âOneâs selfâŠâ and âTwosomeâ', 269 '"\'Well,\' said I, \'the gentleman at No. 4.\'"' => '⢠ââWell,â said I, âthe gentleman at No. 4.ââ', 270 '"...an office in Leadenhall Street--and--" 271 "O\'Reilly\'s office?" 272 "What!" he roared. 273 "Yes, to-day."* She stood smiling.' 274 => 275 '⢠ââŠan office in Leadenhall Street â and â â 276 âOâReillyâs office?â 277 âWhat!â he roared. 278 âYes, to-day.â* She stood smiling.', 279 ]; 280 foreach ($strings as $input => $expected) { 281 $result = fancyTxt($input, ['/^/', '/^·/'], ['· ', 'â¢']); 282 $this->assertEquals($expected, $result, sprintf('Failed with input: %s', $input)); 283 } 284 } 257 285 }
Note: See TracChangeset
for help on using the changeset viewer.