Permalink
Browse files

Fix version compare

  • Loading branch information...
1 parent c2fd4b1 commit 823e08f507f7e7344b126d21f50f7299c2cf1c76 @timoh6 committed Jul 3, 2012
@@ -51,7 +51,7 @@ public function testEncryptAndDecrypt()
public function testPkcs7Pad()
{
- if (PHP_VERSION >= '5.3.2')
+ if (version_compare(PHP_VERSION, '5.3.2') >= 0)
{
$string1 = 'abcdefg';
$expectedPaddedString1 = 'abcdefg' . str_repeat(chr(9), 9);
@@ -74,7 +74,7 @@ public function testPkcs7Pad()
public function testPkcs7Strip()
{
- if (PHP_VERSION >= '5.3.2')
+ if (version_compare(PHP_VERSION, '5.3.2') >= 0)
{
$paddedString1 = 'abcdefg' . str_repeat(chr(9), 9);
$expectedStrippedString1 = 'abcdefg';
@@ -97,7 +97,7 @@ public function testPkcs7Strip()
public function testPkcs7StripSetsDataAsFalseOnInvalidPad()
{
- if (PHP_VERSION >= '5.3.2')
+ if (version_compare(PHP_VERSION, '5.3.2') >= 0)
{
$result1 = 'abc';
$expectedResult1 = false;
@@ -4,7 +4,7 @@ class TCrypto_CryptoHandler_OpenSslAes128CbcTest extends PHPUnit_Framework_TestC
{
protected function setUp()
{
- if (!extension_loaded('openssl') || PHP_VERSION < '5.3.3')
+ if (!extension_loaded('openssl') || version_compare(PHP_VERSION, '5.3.3') < 0)
{
$this->markTestSkipped('The OpenSSl extension is not available, or PHP version is less than 5.3.3.');
}
@@ -4,7 +4,7 @@ class TCrypto_CryptoHandler_OpenSslAes256CbcTest extends PHPUnit_Framework_TestC
{
protected function setUp()
{
- if (!extension_loaded('openssl') || PHP_VERSION < '5.3.3')
+ if (!extension_loaded('openssl') || version_compare(PHP_VERSION, '5.3.3') < 0)
{
$this->markTestSkipped('The OpenSSl extension is not available, or PHP version is less than 5.3.3.');
}
@@ -86,7 +86,7 @@ public function testConstructFailsWithInvalidArguments()
*/
public function testCannotHashKeysLongerThan32Bytes()
{
- if (PHP_VERSION >= '5.3.2')
+ if (version_compare(PHP_VERSION, '5.3.2') >= 0)
{
$keymanager = $this->getMock('TCrypto\\KeyManager\\Filesystem');
$storage = new TCrypto\StorageHandler\ArrayStorage();

0 comments on commit 823e08f

Please sign in to comment.