Skip to content

Commit 67d04c3

Browse files
committed
add more unit tests
1 parent 8b8d117 commit 67d04c3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/MCryptCompatTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,27 @@ public function testAESBasicSuccess()
1212
$compat = bin2hex(phpseclib_mcrypt_encrypt('rijndael-128', str_repeat('a', 16), 'asdf', 'cbc', str_repeat('a', 16)));
1313
$this->assertEquals($mcrypt, $compat);
1414
}
15+
16+
public function testListAlgorithms()
17+
{
18+
$this->assertInternalType('array', phpseclib_mcrypt_list_algorithms());
19+
}
20+
21+
/**
22+
* @expectedException PHPUnit_Framework_Error_Warning
23+
*/
24+
public function testBadParamsMcrypt()
25+
{
26+
mcrypt_encrypt('rijndael-128', 'abc', 'asdf', 'cbc', 'zz');
27+
}
28+
29+
/**
30+
* pretty much the same thing as testBadParamsMcrypt
31+
*
32+
* @expectedException PHPUnit_Framework_Error_Warning
33+
*/
34+
public function testBadParamsMcryptCompat()
35+
{
36+
phpseclib_mcrypt_encrypt('rijndael-128', 'abc', 'asdf', 'cbc', 'zz');
37+
}
1538
}

0 commit comments

Comments
 (0)