Changeset 653 for trunk/tests
- Timestamp:
- Nov 28, 2018 1:40:13 AM (5 years ago)
- Location:
- trunk/tests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/EmailTest.php
r622 r653 99 99 $this->Email->setString('This is a {TEST}'); 100 100 $this->Email->replace(array( 101 'test' => 'â you guessed it â a test! '101 'test' => 'â you guessed it â a test! Sent from ' . __FILE__ 102 102 )); 103 103 $result = $this->Email->send(); -
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 } -
trunk/tests/run_tests.sh
r622 r653 7 7 # export DB_USER="test" 8 8 # export DB_PASS="..." 9 10 # Run an individual test like this: 11 # ./tests/run_tests.sh /Users/q/src/codebase/trunk/tests/UtilitiesTest.php 9 12 10 13 function err { … … 38 41 # Config options go in phpunit.xml 39 42 # phpunit --tap | grep -v '^ok ' 40 ../vendor/phpunit/phpunit/composer/bin/phpunit --stderr || err "\nSomething went wrong (code $?). If there is no output above, check the php_error_log";43 ../vendor/phpunit/phpunit/composer/bin/phpunit --stderr "$@" || err "\nSomething went wrong (code $?). If there is no output above, check the php_error_log"; 41 44
Note: See TracChangeset
for help on using the changeset viewer.