summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
Diffstat (limited to '_test')
-rw-r--r--_test/cases/inc/auth_password.test.php6
-rw-r--r--_test/cases/inc/common_cleanText.test.php34
-rw-r--r--_test/cases/inc/parser/parser_links.test.php15
3 files changed, 55 insertions, 0 deletions
diff --git a/_test/cases/inc/auth_password.test.php b/_test/cases/inc/auth_password.test.php
index 928552a14..394f0b2f5 100644
--- a/_test/cases/inc/auth_password.test.php
+++ b/_test/cases/inc/auth_password.test.php
@@ -12,6 +12,7 @@ class auth_password_test extends UnitTestCase {
'md5' => '8fa22d62408e5351553acdd91c6b7003',
'sha1' => 'b456d3b0efd105d613744ffd549514ecafcfc7e1',
'ssha' => '{SSHA}QMHG+uC7bHNYKkmoLbNsNI38/dJhYmNk',
+ 'lsmd5' => '{SMD5}HGbkPrkWgy9KgcRGWlrsUWFiY2RlZmdo',
'crypt' => 'ablvoGr1hvZ5k',
'mysql' => '4a1fa3780bd6fd55',
'my411' => '*e5929347e25f82e19e4ebe92f1dc6b6e7c2dbd29',
@@ -48,6 +49,11 @@ class auth_password_test extends UnitTestCase {
}
}
+ function test_bcrypt_self(){
+ $hash = auth_cryptPassword('foobcrypt','bcrypt');
+ $this->assertTrue(auth_verifyPassword('foobcrypt',$hash));
+ }
+
function test_verifyPassword_nohash(){
$this->assertTrue(auth_verifyPassword('foo','$1$$n1rTiFE0nRifwV/43bVon/'));
}
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 :
diff --git a/_test/cases/inc/parser/parser_links.test.php b/_test/cases/inc/parser/parser_links.test.php
index 53871e110..d0fb19570 100644
--- a/_test/cases/inc/parser/parser_links.test.php
+++ b/_test/cases/inc/parser/parser_links.test.php
@@ -400,6 +400,21 @@ class TestOfDoku_Parser_Links extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripByteIndex',$this->H->calls),$calls);
}
+
+ function testWindowsShareLinkHyphen() {
+ $this->P->addMode('windowssharelink',new Doku_Parser_Mode_WindowsShareLink());
+ $this->P->parse('Foo \\\server\share-hyphen Bar');
+ $calls = array (
+ array('document_start',array()),
+ array('p_open',array()),
+ array('cdata',array("\n".'Foo ')),
+ array('windowssharelink',array('\\\server\share-hyphen',NULL)),
+ array('cdata',array(' Bar')),
+ array('p_close',array()),
+ array('document_end',array()),
+ );
+ $this->assertEqual(array_map('stripByteIndex',$this->H->calls),$calls);
+ }
function testWindowsShareLinkInternal() {
$this->P->addMode('internallink',new Doku_Parser_Mode_InternalLink());