From 318ac0bd8681591507980697730aaf1972df7492 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 3 Jan 2013 17:47:40 +0100 Subject: [PATCH] [issue/39] Abstract test case for Crypt_AES. --- tests/Crypt/AES/TestCase.php | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/Crypt/AES/TestCase.php diff --git a/tests/Crypt/AES/TestCase.php b/tests/Crypt/AES/TestCase.php new file mode 100644 index 00000000..d5884129 --- /dev/null +++ b/tests/Crypt/AES/TestCase.php @@ -0,0 +1,27 @@ + + * @copyright MMXIII Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +abstract class Crypt_AES_TestCase extends PHPUnit_Framework_TestCase +{ + static public function setUpBeforeClass() + { + require_once('Crypt/AES.php'); + + if (!defined('CRYPT_AES_MODE')) + { + define('CRYPT_AES_MODE', CRYPT_AES_MODE_INTERNAL); + } + } + + public function setUp() + { + if (defined('CRYPT_AES_MODE') && CRYPT_AES_MODE !== CRYPT_AES_MODE_INTERNAL) + { + $this->markTestSkipped('Skipping test because CRYPT_AES_MODE is not defined as CRYPT_AES_MODE_INTERNAL.'); + } + } +}