From 552ff5b0231d5db6ea3f6677cb2bb9af48fd69b1 Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Wed, 4 Apr 2012 11:02:11 +0200 Subject: used default php unit config exclude high cpu usage tests --- _testing/unittests/inc/auth_password.cputest.php | 70 ++++++++++++++++++++++++ _testing/unittests/inc/auth_password.test.php | 70 ------------------------ _testing/unittests/inc/utf8_romanize.cputest.php | 36 ++++++++++++ _testing/unittests/inc/utf8_romanize.test.php | 36 ------------ 4 files changed, 106 insertions(+), 106 deletions(-) create mode 100644 _testing/unittests/inc/auth_password.cputest.php delete mode 100644 _testing/unittests/inc/auth_password.test.php create mode 100644 _testing/unittests/inc/utf8_romanize.cputest.php delete mode 100644 _testing/unittests/inc/utf8_romanize.test.php (limited to '_testing/unittests/inc') diff --git a/_testing/unittests/inc/auth_password.cputest.php b/_testing/unittests/inc/auth_password.cputest.php new file mode 100644 index 000000000..4c922d0e3 --- /dev/null +++ b/_testing/unittests/inc/auth_password.cputest.php @@ -0,0 +1,70 @@ + '$1$abcdefgh$SYbjm2AEvSoHG7Xapi8so.', + 'apr1' => '$apr1$abcdefgh$C/GzYTF4kOVByYLEoD5X4.', + 'md5' => '8fa22d62408e5351553acdd91c6b7003', + 'sha1' => 'b456d3b0efd105d613744ffd549514ecafcfc7e1', + 'ssha' => '{SSHA}QMHG+uC7bHNYKkmoLbNsNI38/dJhYmNk', + 'lsmd5' => '{SMD5}HGbkPrkWgy9KgcRGWlrsUWFiY2RlZmdo', + 'crypt' => 'ablvoGr1hvZ5k', + 'mysql' => '4a1fa3780bd6fd55', + 'my411' => '*e5929347e25f82e19e4ebe92f1dc6b6e7c2dbd29', + 'kmd5' => 'a579299436d7969791189acadd86fcb716', + 'pmd5' => '$P$abcdefgh1RC6Fd32heUzl7EYCG9uGw.', + 'hmd5' => '$H$abcdefgh1ZbJodHxmeXVAhEzTG7IAp.', + 'djangomd5' => 'md5$abcde$d0fdddeda8cd92725d2b54148ac09158', + 'djangosha1' => 'sha1$abcde$c8e65a7f0acc9158843048a53dcc5a6bc4d17678', + ); + + + function test_cryptPassword(){ + foreach($this->passes as $method => $hash){ + $info = "testing method $method"; + $this->assertEquals(auth_cryptPassword('foo'.$method, $method,'abcdefgh12345678912345678912345678'), + $hash, $info); + } + } + + function test_verifyPassword(){ + foreach($this->passes as $method => $hash){ + $info = "testing method $method"; + $this->assertTrue(auth_verifyPassword('foo'.$method, $hash), $info); + } + } + + function test_verifySelf(){ + foreach($this->passes as $method => $hash){ + $info = "testing method $method"; + $hash = auth_cryptPassword('foo'.$method,$method); + $this->assertTrue(auth_verifyPassword('foo'.$method, $hash), $info); + } + } + + function test_bcrypt_self(){ + $hash = auth_cryptPassword('foobcrypt','bcrypt'); + $this->assertTrue(auth_verifyPassword('foobcrypt',$hash)); + } + + function test_verifyPassword_fixedbcrypt(){ + $this->assertTrue(auth_verifyPassword('foobcrypt','$2a$12$uTWercxbq4sjp2xAzv3we.ZOxk51m5V/Bv5bp2H27oVFJl5neFQoC')); + } + + function test_verifyPassword_nohash(){ + $this->assertTrue(auth_verifyPassword('foo','$1$$n1rTiFE0nRifwV/43bVon/')); + } + + function test_verifyPassword_fixedpmd5(){ + $this->assertTrue(auth_verifyPassword('test12345','$P$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0')); + $this->assertTrue(auth_verifyPassword('test12345','$H$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0')); + } + +} + +//Setup VIM: ex: et ts=4 : diff --git a/_testing/unittests/inc/auth_password.test.php b/_testing/unittests/inc/auth_password.test.php deleted file mode 100644 index 4c922d0e3..000000000 --- a/_testing/unittests/inc/auth_password.test.php +++ /dev/null @@ -1,70 +0,0 @@ - '$1$abcdefgh$SYbjm2AEvSoHG7Xapi8so.', - 'apr1' => '$apr1$abcdefgh$C/GzYTF4kOVByYLEoD5X4.', - 'md5' => '8fa22d62408e5351553acdd91c6b7003', - 'sha1' => 'b456d3b0efd105d613744ffd549514ecafcfc7e1', - 'ssha' => '{SSHA}QMHG+uC7bHNYKkmoLbNsNI38/dJhYmNk', - 'lsmd5' => '{SMD5}HGbkPrkWgy9KgcRGWlrsUWFiY2RlZmdo', - 'crypt' => 'ablvoGr1hvZ5k', - 'mysql' => '4a1fa3780bd6fd55', - 'my411' => '*e5929347e25f82e19e4ebe92f1dc6b6e7c2dbd29', - 'kmd5' => 'a579299436d7969791189acadd86fcb716', - 'pmd5' => '$P$abcdefgh1RC6Fd32heUzl7EYCG9uGw.', - 'hmd5' => '$H$abcdefgh1ZbJodHxmeXVAhEzTG7IAp.', - 'djangomd5' => 'md5$abcde$d0fdddeda8cd92725d2b54148ac09158', - 'djangosha1' => 'sha1$abcde$c8e65a7f0acc9158843048a53dcc5a6bc4d17678', - ); - - - function test_cryptPassword(){ - foreach($this->passes as $method => $hash){ - $info = "testing method $method"; - $this->assertEquals(auth_cryptPassword('foo'.$method, $method,'abcdefgh12345678912345678912345678'), - $hash, $info); - } - } - - function test_verifyPassword(){ - foreach($this->passes as $method => $hash){ - $info = "testing method $method"; - $this->assertTrue(auth_verifyPassword('foo'.$method, $hash), $info); - } - } - - function test_verifySelf(){ - foreach($this->passes as $method => $hash){ - $info = "testing method $method"; - $hash = auth_cryptPassword('foo'.$method,$method); - $this->assertTrue(auth_verifyPassword('foo'.$method, $hash), $info); - } - } - - function test_bcrypt_self(){ - $hash = auth_cryptPassword('foobcrypt','bcrypt'); - $this->assertTrue(auth_verifyPassword('foobcrypt',$hash)); - } - - function test_verifyPassword_fixedbcrypt(){ - $this->assertTrue(auth_verifyPassword('foobcrypt','$2a$12$uTWercxbq4sjp2xAzv3we.ZOxk51m5V/Bv5bp2H27oVFJl5neFQoC')); - } - - function test_verifyPassword_nohash(){ - $this->assertTrue(auth_verifyPassword('foo','$1$$n1rTiFE0nRifwV/43bVon/')); - } - - function test_verifyPassword_fixedpmd5(){ - $this->assertTrue(auth_verifyPassword('test12345','$P$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0')); - $this->assertTrue(auth_verifyPassword('test12345','$H$9IQRaTwmfeRo7ud9Fh4E2PdI0S3r.L0')); - } - -} - -//Setup VIM: ex: et ts=4 : diff --git a/_testing/unittests/inc/utf8_romanize.cputest.php b/_testing/unittests/inc/utf8_romanize.cputest.php new file mode 100644 index 000000000..66e3b76c9 --- /dev/null +++ b/_testing/unittests/inc/utf8_romanize.cputest.php @@ -0,0 +1,36 @@ + + */ + function test_japanese(){ + $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt'); + $line = 1; + foreach($tests as $test){ + list($jap,$rom) = explode(';',trim($test)); + + $chk = utf8_romanize($jap); + #if($chk != $rom) echo "$jap\t->\t$chk\t!=\t$rom\t($line)\n"; + $this->assertEquals($chk,$rom); + $line++; + } + } + + /** + * Test romanization of character that would usually be deaccented in a different + * way FS#1117 + * + * @author Andreas Gohr + */ + function test_deaccented(){ + $this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö")); + } +} +//Setup VIM: ex: et ts=4 : diff --git a/_testing/unittests/inc/utf8_romanize.test.php b/_testing/unittests/inc/utf8_romanize.test.php deleted file mode 100644 index 66e3b76c9..000000000 --- a/_testing/unittests/inc/utf8_romanize.test.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - function test_japanese(){ - $tests = file(dirname(__FILE__).'/utf8_kanaromaji.txt'); - $line = 1; - foreach($tests as $test){ - list($jap,$rom) = explode(';',trim($test)); - - $chk = utf8_romanize($jap); - #if($chk != $rom) echo "$jap\t->\t$chk\t!=\t$rom\t($line)\n"; - $this->assertEquals($chk,$rom); - $line++; - } - } - - /** - * Test romanization of character that would usually be deaccented in a different - * way FS#1117 - * - * @author Andreas Gohr - */ - function test_deaccented(){ - $this->assertEquals("a A a A a o O",utf8_romanize("å Å ä Ä ä ö Ö")); - } -} -//Setup VIM: ex: et ts=4 : -- cgit v1.2.3