-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDesEncryptorTest.php
More file actions
42 lines (38 loc) · 1.05 KB
/
DesEncryptorTest.php
File metadata and controls
42 lines (38 loc) · 1.05 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\DesEncryptor
*
* @author fdipzone
*/
final class DesEncryptorTest extends TestCase
{
/**
* @covers \FileEncryptor\DesEncryptor::name
*/
public function testName()
{
$encrypt_key = '123456';
$des_encryptor = new \FileEncryptor\DesEncryptor($encrypt_key);
$this->assertEquals('des encryptor', $des_encryptor->name());
}
/**
* @covers \FileEncryptor\DesEncryptor::cipherAlgo
*/
public function testCipherAlgo()
{
$encrypt_key = '123456';
$des_encryptor = new \FileEncryptor\DesEncryptor($encrypt_key);
$this->assertEquals('DES', $des_encryptor->cipherAlgo());
}
/**
* @covers \FileEncryptor\DesEncryptor::iv
*/
public function testIv()
{
$encrypt_key = '123456';
$des_encryptor = new \FileEncryptor\DesEncryptor($encrypt_key);
$this->assertTrue(strlen($des_encryptor->iv())==8);
}
}