-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAesEncryptorTest.php
More file actions
42 lines (38 loc) · 1.06 KB
/
AesEncryptorTest.php
File metadata and controls
42 lines (38 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php declare(strict_types=1);
namespace Tests\FileEncryptor;
use PHPUnit\Framework\TestCase;
/**
* 测试 php-file-encryptor\FileEncryptor\AesEncryptor
*
* @author fdipzone
*/
final class AesEncryptorTest extends TestCase
{
/**
* @covers \FileEncryptor\AesEncryptor::name
*/
public function testName()
{
$encrypt_key = '123456';
$aes_encryptor = new \FileEncryptor\AesEncryptor($encrypt_key);
$this->assertEquals('aes encryptor', $aes_encryptor->name());
}
/**
* @covers \FileEncryptor\AesEncryptor::cipherAlgo
*/
public function testCipherAlgo()
{
$encrypt_key = '123456';
$aes_encryptor = new \FileEncryptor\AesEncryptor($encrypt_key);
$this->assertEquals('AES-256-CBC', $aes_encryptor->cipherAlgo());
}
/**
* @covers \FileEncryptor\AesEncryptor::iv
*/
public function testIv()
{
$encrypt_key = '123456';
$aes_encryptor = new \FileEncryptor\AesEncryptor($encrypt_key);
$this->assertTrue(strlen($aes_encryptor->iv())==16);
}
}