[TASK] Speed up salted password unit test
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 2 Nov 2012 15:05:47 +0000 (16:05 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 2 Nov 2012 15:21:04 +0000 (16:21 +0100)
The patch removes tests in blowfish and phpass salting classes that
test maximum iteration count returns a valid salt. The underlying
salt code is slow by design, so the tests also take ages. The
functionality itself is already covered by the minimum salt count
test as well, thus - after speaking with Marcus Krause - we decided
to remove them without substitution to reduce the unit test suite
runtime.

Resolves: #42639
Releases: 6.0

Change-Id: I4bf94dc8ae4726fa131f6113546442fb00718753
Reviewed-on: http://review.typo3.org/16141
Reviewed-by: Wouter Wolters
Tested-by: Marcus Krause
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/saltedpasswords/Tests/Unit/Salt/BlowfishSaltTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/PhpassSaltTest.php

index 2930c7f..1a278c5 100644 (file)
@@ -135,20 +135,6 @@ class BlowfishSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
-       public function createdSaltedHashOfProperStructureForMaximumHashCount() {
-               $this->skipTestIfBlowfishIsNotAvailable();
-               $password = 'password';
-               $maxHashCount = $this->objectInstance->getMaxHashCount();
-               $this->objectInstance->setHashCount($maxHashCount);
-               $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
-               $this->assertTrue($this->objectInstance->isValidSaltedPW($saltedHashPassword));
-               // reset hashcount
-               $this->objectInstance->setHashCount(NULL);
-       }
-
-       /**
-        * @test
-        */
        public function createdSaltedHashOfProperStructureForMinimumHashCount() {
                $this->skipTestIfBlowfishIsNotAvailable();
                $password = 'password';
index 5ac6b45..3531579 100644 (file)
@@ -121,19 +121,6 @@ class PhpassSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
-       public function createdSaltedHashOfProperStructureForMaximumHashCount() {
-               $password = 'password';
-               $maxHashCount = $this->objectInstance->getMaxHashCount();
-               $this->objectInstance->setHashCount($maxHashCount);
-               $saltedHashPassword = $this->objectInstance->getHashedPassword($password);
-               $this->assertTrue($this->objectInstance->isValidSaltedPW($saltedHashPassword));
-               // reset hashcount
-               $this->objectInstance->setHashCount(NULL);
-       }
-
-       /**
-        * @test
-        */
        public function createdSaltedHashOfProperStructureForMinimumHashCount() {
                $password = 'password';
                $minHashCount = $this->objectInstance->getMinHashCount();