Documentation

CryptexTest extends TestCase
in package

FinalYes

CryptexTest performs unit testing for the Cryptex class.

Tags
category

Tests

author

Michael Mawhinney

copyright

2023

license

https://opensource.org/licenses/MIT/ MIT

version
4.0.0

Table of Contents

Properties

$ciphertext  : string
$key  : string
$plaintext  : string
$salt  : string
$saltLength  : int

Methods

testDecryptWithInvalidCiphertext()  : void
Tests the `decrypt()` method with invalid ciphertext.
testEncryptDecrypt()  : void
Tests the `encrypt()` and `decrypt()` methods with valid inputs.
testEncryptDecryptWithInvalidInput()  : void
Tests the `encrypt()` and `decrypt()` methods with invalid input values.
testEncryptDecryptWithInvalidKeyOrSalt()  : void
Tests the `encrypt()` and `decrypt()` methods with invalid key or salt.
testGenerateSalt()  : void
Tests the `generateSalt()` method.
testKeyNonAlphanumericCharacters()  : void
Tests the `encrypt()` and `decrypt()` methods with a key that contains non-alphanumeric characters.
testLargePlaintext()  : void
Tests the `encrypt()` and `decrypt()` methods with a large plaintext string.
testNonAlphanumericCharacters()  : void
Tests the `encrypt()` and `decrypt()` methods with a plaintext string that contains non-alphanumeric characters.
setUp()  : void
Sets up each test by initializing required variables and generating encrypted data for decryption tests.

Properties

$ciphertext

private string $ciphertext

Ciphertext string for encryption and decryption tests.

$key

private string $key

Key for encryption and decryption tests.

$plaintext

private string $plaintext

Plaintext string for encryption and decryption tests.

$salt

private string $salt

Salt for encryption and decryption tests.

$saltLength

private int $saltLength

Length of the salt value.

Methods

testDecryptWithInvalidCiphertext()

Tests the `decrypt()` method with invalid ciphertext.

public testDecryptWithInvalidCiphertext() : void

testEncryptDecrypt()

Tests the `encrypt()` and `decrypt()` methods with valid inputs.

public testEncryptDecrypt() : void

testEncryptDecryptWithInvalidInput()

Tests the `encrypt()` and `decrypt()` methods with invalid input values.

public testEncryptDecryptWithInvalidInput() : void

testEncryptDecryptWithInvalidKeyOrSalt()

Tests the `encrypt()` and `decrypt()` methods with invalid key or salt.

public testEncryptDecryptWithInvalidKeyOrSalt() : void

testGenerateSalt()

Tests the `generateSalt()` method.

public testGenerateSalt() : void

testKeyNonAlphanumericCharacters()

Tests the `encrypt()` and `decrypt()` methods with a key that contains non-alphanumeric characters.

public testKeyNonAlphanumericCharacters() : void

testLargePlaintext()

Tests the `encrypt()` and `decrypt()` methods with a large plaintext string.

public testLargePlaintext() : void

testNonAlphanumericCharacters()

Tests the `encrypt()` and `decrypt()` methods with a plaintext string that contains non-alphanumeric characters.

public testNonAlphanumericCharacters() : void

setUp()

Sets up each test by initializing required variables and generating encrypted data for decryption tests.

protected setUp() : void

        
On this page

Search results