Skip to content

Commit

Permalink
skip testing encryption if it is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jun 20, 2012
1 parent c63674a commit 68f01ce
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function truncate(){
* test encrypting data
*/
public function testEncrypt(){
$this->skipIf(!function_exists('mcrypt_encrypt'), 'mcrypt does not seem to be installed');

Configure::write('Security.encryption_salt', '');
Configure::write('Security.encryption_secret', '­sç„¢˜4m™¤Àsç');

Expand Down Expand Up @@ -92,7 +94,9 @@ public function testEncrypt(){
/**
* test decrypting data
*/
public function testDecrypt(){
public function testDecrypt() {
$this->skipIf(!function_exists('mcrypt_encrypt'), 'mcrypt does not seem to be installed');

Configure::write('Security.encryption_secret', '­sç„¢˜4m™¤Àsç');
$result = $this->Category->decrypt('Gcav7FmvCHLJZj41u6pQXgAmvm2GKG6O0QPxaqYfRoQ=');
$expected = 'hello';
Expand Down Expand Up @@ -124,6 +128,8 @@ public function testDecrypt(){
* test finding and saving encrypted data
*/
public function testSaveAndFind(){
$this->skipIf(!function_exists('mcrypt_encrypt'), 'mcrypt does not seem to be installed');

$this->truncate();

/**
Expand Down

0 comments on commit 68f01ce

Please sign in to comment.