diff options
author | Dominik Eckelmann <deckelmann@gmail.com> | 2012-03-14 12:52:36 +0100 |
---|---|---|
committer | Dominik Eckelmann <deckelmann@gmail.com> | 2012-03-14 12:52:36 +0100 |
commit | 3a6d76070be7220b8e5f7c04443aa923bc8cddf2 (patch) | |
tree | dfd00b5d0c5f58ee313eb376a8cb1ee99512bf83 /_test/cases/inc/common_cleanText.test.php | |
parent | 03d7247e047c21d2733f837148a1499f56784ae3 (diff) | |
parent | d0caa5642f6e322a026bd5bdac4585ff1b2f40da (diff) | |
download | rpg-3a6d76070be7220b8e5f7c04443aa923bc8cddf2.tar.gz rpg-3a6d76070be7220b8e5f7c04443aa923bc8cddf2.tar.bz2 |
Merge branch 'master' of https://github.com/splitbrain/dokuwiki
Conflicts:
lib/exe/xmlrpc.php
Diffstat (limited to '_test/cases/inc/common_cleanText.test.php')
-rw-r--r-- | _test/cases/inc/common_cleanText.test.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/_test/cases/inc/common_cleanText.test.php b/_test/cases/inc/common_cleanText.test.php new file mode 100644 index 000000000..936ed1d76 --- /dev/null +++ b/_test/cases/inc/common_cleanText.test.php @@ -0,0 +1,34 @@ +<?php + +require_once DOKU_INC.'inc/init.php'; +require_once DOKU_INC.'inc/common.php'; + +class common_clientIP_test extends UnitTestCase { + + function test_unix(){ + $unix = 'one + two + + three'; + + $this->assertEqual($unix,cleanText($unix)); + } + + function test_win(){ + $unix = 'one + two + + three'; + $win = 'one
+ two
+
+ three'; + + $this->assertEqual(bin2hex($unix),'6f6e650a2020202020202020202020202020202074776f0a0a202020202020202020202020202020207468726565'); + $this->assertEqual(bin2hex($win),'6f6e650d0a2020202020202020202020202020202074776f0d0a0d0a202020202020202020202020202020207468726565'); + $this->assertNotEqual($unix,$win); + $this->assertEqual($unix,cleanText($win)); + } +} + +//Setup VIM: ex: et ts=4 : |