From 21b402552bdf584c64e061c4422fc06783b7d2d8 Mon Sep 17 00:00:00 2001 From: Jaime Perez Crespo <jaime.perez@uninett.no> Date: Sun, 14 Jun 2015 16:30:51 +0200 Subject: [PATCH] Revert "Add some tests for SimpleSAML\Utils\Crypto." This reverts commit aec9571dc85c861ac0b6e081782aae30f9b6d2c1. --- tests/lib/SimpleSAML/Utils/CryptoTest.php | 48 ----------------------- 1 file changed, 48 deletions(-) delete mode 100644 tests/lib/SimpleSAML/Utils/CryptoTest.php diff --git a/tests/lib/SimpleSAML/Utils/CryptoTest.php b/tests/lib/SimpleSAML/Utils/CryptoTest.php deleted file mode 100644 index 3b0ad1409..000000000 --- a/tests/lib/SimpleSAML/Utils/CryptoTest.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - - -/** - * Tests for SimpleSAML\Utils\Crypto. - */ -class CryptoTest extends PHPUnit_Framework_TestCase -{ - - /** - * Test invalid input provided to the aesDecrypt() method. - * - * @expectedException InvalidArgumentException - */ - public function testAesDecryptBadInput() { - SimpleSAML\Utils\Crypto::aesDecrypt(array()); - } - - - /** - * Test that aesDecrypt() works properly, being able to decrypt some previously known (and correct) - * ciphertext. - */ - public function testAesDecrypt() { - $c = SimpleSAML_Configuration::loadFromArray(array( - 'secretsalt' => 'SUPER_SECRET_SALT', - )); - - $plaintext = 'SUPER_SECRET_TEXT'; - $ciphertext = 'GA5lvW9TbAErqGvHFfZMUkdIg6zCJYmjFSGERAhByYNcMts70N4fWLjUm7/aVygPm55GbGhEG2himXJUHR1Ibg=='; - $this->assertEquals($plaintext, SimpleSAML\Utils\Crypto::aesDecrypt(base64_decode($ciphertext))); - } - - - /** - * Test that aesEncrypt() produces ciphertexts that aesDecrypt() can decrypt. - */ - public function testAesEncrypt() { - $c = SimpleSAML_Configuration::loadFromArray(array( - 'secretsalt' => 'SUPER_SECRET_SALT', - )); - - $original_plaintext = 'SUPER_SECRET_TEXT'; - $ciphertext = SimpleSAML\Utils\Crypto::aesEncrypt($original_plaintext); - $decrypted_plaintext = SimpleSAML\Utils\Crypto::aesDecrypt($ciphertext); - $this->assertEquals($original_plaintext, $decrypted_plaintext); - } -} -- GitLab