Permalink
Browse files

Revert change done in 11f543f.

The change is unneeded now as Security::encrypt() no longer throws exception
for falsey values.
  • Loading branch information...
1 parent bba3e78 commit 27979286b272c9e5dfd4dd540ca4cb2674caaf31 @ADmad ADmad committed Dec 15, 2013
@@ -472,7 +472,7 @@ protected function _encrypt($value) {
if (is_array($value)) {
$value = $this->_implode($value);
}
- if (!$this->_encrypted || !$value) {
+ if (!$this->_encrypted) {
return $value;
}
$prefix = "Q2FrZQ==.";
@@ -202,11 +202,11 @@ public function testWriteSimple() {
}
/**
- * test write() Encrypted data with null & empty string & boolean value
+ * test write() encrypted data with falsey value
*
* @return void
*/
- public function testWriteWithNullEmptyString() {
+ public function testWriteWithFalseyValue() {
$this->Cookie->type('aes');
$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#HKis~#^';
@@ -228,7 +228,11 @@ public function testWriteWithNullEmptyString() {
$this->Cookie->write('Testing', '0');
$result = $this->Cookie->read('Testing');
- $this->assertEquals('0', $result);
+ $this->assertSame('0', $result);
+
+ $this->Cookie->write('Testing', 0);
+ $result = $this->Cookie->read('Testing');
+ $this->assertSame(0, $result);
}
/**

0 comments on commit 2797928

Please sign in to comment.