Differences Between: [Versions 402 and 403]
Test encryption.
Copyright: | 2020 The Open University |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 265 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 1 file lib/tests/fixtures/testable_encryption.php |
encryption_test:: (15 methods):
tearDown()
setUp()
require_sodium()
encryption_method_provider()
test_create_key()
test_encrypt_and_decrypt_empty()
test_encrypt_nokeys()
test_decrypt_wrongmethod()
test_decrypt_tooshort()
test_decrypt_notbase64()
test_decrypt_nokeys()
test_auto_key_generation()
test_invalid_key()
test_modified_data()
test_encrypt_and_decrypt_realdata()
Class: encryption_test - X-Ref
Test encryption.tearDown() X-Ref |
Clear junk created by tests. |
setUp() X-Ref |
No description |
require_sodium(string $method) X-Ref |
Tests using Sodium need to check the extension is available. param: string $method Encryption method |
encryption_method_provider() X-Ref |
Many of the tests work with both encryption methods. return: array[] Array of method options for test |
test_create_key(string $method) X-Ref |
Tests the create_keys and get_key functions. param: string $method Encryption method |
test_encrypt_and_decrypt_empty() X-Ref |
Tests encryption and decryption with empty strings. |
test_encrypt_nokeys(string $method) X-Ref |
Tests encryption when the keys weren't created yet. param: string $method Encryption method |
test_decrypt_wrongmethod() X-Ref |
Tests decryption when the data has a different encryption method |
test_decrypt_tooshort(string $method) X-Ref |
Tests decryption when not enough data is supplied to get the IV and some data. param: string $method Encryption method |
test_decrypt_notbase64(string $method) X-Ref |
Tests decryption when data is not valid base64. param: string $method Encryption method |
test_decrypt_nokeys(string $method) X-Ref |
Tests decryption when the keys weren't created yet. param: string $method Encryption method |
test_auto_key_generation(string $method) X-Ref |
Test automatic generation of keys when needed. param: string $method Encryption method |
test_invalid_key(string $method) X-Ref |
Checks that invalid key causes failures. param: string $method Encryption method |
test_modified_data(string $method) X-Ref |
Checks that modified data causes failures. param: string $method Encryption method |
test_encrypt_and_decrypt_realdata(string $method) X-Ref |
Tests encryption and decryption for real. param: string $method Encryption method |