[BUGFIX] Deprecated functions used in on fresh 6.0 final
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Security / Cryptography / HashServiceTest.php
index 2780728..e7b2e46 100644 (file)
@@ -40,8 +40,8 @@ class HashServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @test
         * @author Sebastian Kurfürst
         */
-       public function generateHashReturnsHashStringIfStringIsGiven() {
-               $hash = $this->hashService->generateHash('asdf');
+       public function generateHmacReturnsHashStringIfStringIsGiven() {
+               $hash = $this->hashService->generateHmac('asdf');
                $this->assertTrue(is_string($hash));
        }
 
@@ -49,8 +49,8 @@ class HashServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @test
         * @author Sebastian Kurfürst
         */
-       public function generateHashReturnsHashStringWhichContainsSomeSalt() {
-               $hash = $this->hashService->generateHash('asdf');
+       public function generateHmacReturnsHashStringWhichContainsSomeSalt() {
+               $hash = $this->hashService->generateHmac('asdf');
                $this->assertNotEquals(sha1('asdf'), $hash);
        }
 
@@ -58,9 +58,9 @@ class HashServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @test
         * @author Sebastian Kurfürst
         */
-       public function generateHashReturnsDifferentHashStringsForDifferentInputStrings() {
-               $hash1 = $this->hashService->generateHash('asdf');
-               $hash2 = $this->hashService->generateHash('blubb');
+       public function generateHmacReturnsDifferentHashStringsForDifferentInputStrings() {
+               $hash1 = $this->hashService->generateHmac('asdf');
+               $hash2 = $this->hashService->generateHmac('blubb');
                $this->assertNotEquals($hash1, $hash2);
        }
 
@@ -69,28 +69,28 @@ class HashServiceTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         * @expectedException \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForHashGenerationException
         * @author Sebastian Kurfürst
         */
-       public function generateHashThrowsExceptionIfNoStringGiven() {
-               $hash = $this->hashService->generateHash(NULL);
+       public function generateHmacThrowsExceptionIfNoStringGiven() {
+               $hash = $this->hashService->generateHmac(NULL);
        }
 
        /**
         * @test
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function generatedHashCanBeValidatedAgain() {
+       public function generatedHmacCanBeValidatedAgain() {
                $string = 'asdf';
-               $hash = $this->hashService->generateHash($string);
-               $this->assertTrue($this->hashService->validateHash($string, $hash));
+               $hash = $this->hashService->generateHmac($string);
+               $this->assertTrue($this->hashService->validateHmac($string, $hash));
        }
 
        /**
         * @test
         * @author Sebastian Kurfürst <sebastian@typo3.org>
         */
-       public function generatedHashWillNotBeValidatedIfHashHasBeenChanged() {
+       public function generatedHmacWillNotBeValidatedIfHashHasBeenChanged() {
                $string = 'asdf';
                $hash = 'myhash';
-               $this->assertFalse($this->hashService->validateHash($string, $hash));
+               $this->assertFalse($this->hashService->validateHmac($string, $hash));
        }
 
        /**