summaryrefslogtreecommitdiffstats
path: root/tests/lib/SimpleSAML/Utils
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2016-02-26 11:19:55 +0100
committerJaime Perez Crespo <jaime.perez@uninett.no>2016-02-26 11:21:06 +0100
commit4d5872017213c96e9075d724a3733fd96114c3ac (patch)
tree434ecb2e39e66491f06cc3185ddc7b4e392ddc90 /tests/lib/SimpleSAML/Utils
parentdd9facac9728f9bca710f8c745a2b3ec14c066a6 (diff)
downloadsimplesamlphp-4d5872017213c96e9075d724a3733fd96114c3ac.zip
simplesamlphp-4d5872017213c96e9075d724a3733fd96114c3ac.tar.gz
simplesamlphp-4d5872017213c96e9075d724a3733fd96114c3ac.tar.bz2
Move CryptoTest to SimpleSAML\Test\Utils\CryptoTest.
Diffstat (limited to 'tests/lib/SimpleSAML/Utils')
-rw-r--r--tests/lib/SimpleSAML/Utils/CryptoTest.php27
1 files changed, 19 insertions, 8 deletions
diff --git a/tests/lib/SimpleSAML/Utils/CryptoTest.php b/tests/lib/SimpleSAML/Utils/CryptoTest.php
index e2f0312..e8f0bfa 100644
--- a/tests/lib/SimpleSAML/Utils/CryptoTest.php
+++ b/tests/lib/SimpleSAML/Utils/CryptoTest.php
@@ -1,20 +1,24 @@
<?php
+namespace SimpleSAML\Test\Utils;
+
/**
* Tests for SimpleSAML\Utils\Crypto.
*/
-class CryptoTest extends PHPUnit_Framework_TestCase
+class CryptoTest extends \PHPUnit_Framework_TestCase
{
/**
* Test invalid input provided to the aesDecrypt() method.
*
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
+ *
+ * @covers SimpleSAML\Utils\Crypto::_aesDecrypt
*/
public function testAesDecryptBadInput()
{
- $m = new ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesDecrypt');
+ $m = new \ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesDecrypt');
$m->setAccessible(true);
$m->invokeArgs(null, array(array(), 'SECRET'));
@@ -24,11 +28,13 @@ class CryptoTest extends PHPUnit_Framework_TestCase
/**
* Test invalid input provided to the aesEncrypt() method.
*
- * @expectedException InvalidArgumentException
+ * @expectedException \InvalidArgumentException
+ *
+ * @covers SimpleSAML\Utils\Crypto::_aesEncrypt
*/
public function testAesEncryptBadInput()
{
- $m = new ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesEncrypt');
+ $m = new \ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesEncrypt');
$m->setAccessible(true);
$m->invokeArgs(null, array(array(), 'SECRET'));
@@ -38,6 +44,8 @@ class CryptoTest extends PHPUnit_Framework_TestCase
/**
* Test that aesDecrypt() works properly, being able to decrypt some previously known (and correct)
* ciphertext.
+ *
+ * @covers SimpleSAML\Utils\Crypto::_aesDecrypt
*/
public function testAesDecrypt()
{
@@ -46,7 +54,7 @@ class CryptoTest extends PHPUnit_Framework_TestCase
}
$secret = 'SUPER_SECRET_SALT';
- $m = new ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesDecrypt');
+ $m = new \ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesDecrypt');
$m->setAccessible(true);
$plaintext = 'SUPER_SECRET_TEXT';
@@ -57,6 +65,9 @@ class CryptoTest extends PHPUnit_Framework_TestCase
/**
* Test that aesEncrypt() produces ciphertexts that aesDecrypt() can decrypt.
+ *
+ * @covers SimpleSAML\Utils\Crypto::_aesDecrypt
+ * @covers SimpleSAML\Utils\Crypto::_aesEncrypt
*/
public function testAesEncrypt()
{
@@ -65,8 +76,8 @@ class CryptoTest extends PHPUnit_Framework_TestCase
}
$secret = 'SUPER_SECRET_SALT';
- $e = new ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesEncrypt');
- $d = new ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesDecrypt');
+ $e = new \ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesEncrypt');
+ $d = new \ReflectionMethod('\SimpleSAML\Utils\Crypto', '_aesDecrypt');
$e->setAccessible(true);
$d->setAccessible(true);