checks if testUser exists before resetting
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 16 Mar 2015 15:29:11 +0000 (16:29 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 16 Mar 2015 16:23:36 +0000 (17:23 +0100)
* and removing some unused variables

Change-Id: Ic9fd021173c3d51d87e733ecc884e59c64fe36bb
Reviewed-on: http://gerrit.tine20.com/customers/1734
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Felamimail/Controller/Cache/MessageTest.php

index 6ba73ad..156c824 100644 (file)
@@ -118,7 +118,7 @@ class Felamimail_Controller_Cache_MessageTest extends PHPUnit_Framework_TestCase
         }
         
         // reset user if changed
-        if (Tinebase_Core::getUser()->getId() !== $this->_testUser->getId()) {
+        if (is_object($this->_testUser) && Tinebase_Core::getUser()->getId() !== $this->_testUser->getId()) {
             Tinebase_Core::set(Tinebase_Core::USER, $this->_testUser);
         }
     }
@@ -202,7 +202,6 @@ class Felamimail_Controller_Cache_MessageTest extends PHPUnit_Framework_TestCase
         $this->_headerValueToDelete = 'HEADER X-Tine20TestMessage multipart/alternative';
         
         // update message cache
-        $updatedFolder = $this->_controller->updateCache($this->_folder, 10, 1);
         $loopCount = 1;
         do {
             $updatedFolder = $this->_controller->updateCache($this->_folder, 10, 1);
@@ -239,7 +238,7 @@ class Felamimail_Controller_Cache_MessageTest extends PHPUnit_Framework_TestCase
     public function testUpdateCountersOnly()
     {
         // update message cache
-        $updatedFolder = $this->_controller->updateCache($this->_folder, 30, 1);
+        $this->_controller->updateCache($this->_folder, 30, 1);
         
         $this->_appendMessage('multipart_alternative.eml', $this->_testFolderName);
         $this->_headerValueToDelete = 'HEADER X-Tine20TestMessage multipart/alternative';