]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixing test helper and undoing fubar in class...
authorClark Tomlinson <fallen013@gmail.com>
Tue, 31 Mar 2015 16:21:30 +0000 (12:21 -0400)
committerThomas Müller <thomas.mueller@tmit.eu>
Tue, 7 Apr 2015 11:30:29 +0000 (13:30 +0200)
apps/encryption/lib/session.php
apps/encryption/tests/lib/SessionTest.php

index 785991ec2e04e60cca090bbff8a63644264d52f5..5e9739137691cef29146c6317220e7b00d3f063a 100644 (file)
@@ -54,7 +54,7 @@ class Session {
         */
        public function getStatus() {
                $status = $this->session->get('encryptionInitialized');
-               if (!$status) {
+               if (is_null($status)) {
                        $status = self::NOT_INITIALIZED;
                }
 
@@ -69,8 +69,7 @@ class Session {
         */
        public function getPrivateKey() {
                $key = $this->session->get('privateKey');
-               
-               if (!$key) {
+               if (is_null($key)) {
                        throw new Exceptions\PrivateKeyMissingException('no private key stored in session');
                }
                return $key;
@@ -83,7 +82,7 @@ class Session {
         */
        public function isPrivateKeySet() {
                $key = $this->session->get('privateKey');
-               if (!$key) {
+               if (is_null($key)) {
                        return false;
                }
 
index ea7ddf37a4b1f48fb86c6e19004f4ae2c1110b38..dbf3ecc45a12652fa1e5b13fb4e3ff70414dfa4d 100644 (file)
@@ -104,7 +104,7 @@ class SessionTest extends TestCase {
                if (!empty(self::$tempStorage[$key])) {
                        return self::$tempStorage[$key];
                }
-               return false;
+               return null;
        }
 
        /**