[TASK] Clean up form protection tests 30/19430/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 29 Mar 2013 12:29:32 +0000 (13:29 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 29 Mar 2013 12:37:30 +0000 (13:37 +0100)
The form protection tests need a refactoring to use the new flash
message handling. Additionally, the tests are adapted to use better
mocking and accessible proxies where needed.

Change-Id: I5d3b008770bc1b74eeff8fd568f01084915cd226
Resolves: #46772
Related: #44593
Releases: 6.1
Reviewed-on: https://review.typo3.org/19430
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/FormProtection/BackendFormProtection.php
typo3/sysext/core/Classes/Messaging/FlashMessageService.php
typo3/sysext/core/Tests/Unit/FormProtection/BackendFormProtectionTest.php
typo3/sysext/core/Tests/Unit/FormProtection/InstallToolFormProtectionTest.php

index c7cbdd7..00eb7ed 100644 (file)
@@ -120,9 +120,17 @@ class BackendFormProtection extends \TYPO3\CMS\Core\FormProtection\AbstractFormP
         * @return void
         */
        protected function createValidationErrorMessage() {
         * @return void
         */
        protected function createValidationErrorMessage() {
-               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:error.formProtection.tokenInvalid'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, !(isset($GLOBALS['TYPO3_AJAX']) && $GLOBALS['TYPO3_AJAX'] === TRUE));
+               $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+                       'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
+                       $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:error.formProtection.tokenInvalid'),
+                       '',
+                       \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
+                       !(isset($GLOBALS['TYPO3_AJAX']) && $GLOBALS['TYPO3_AJAX'] === TRUE)
+               );
                /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
                /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
-               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+               $flashMessageService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+                       'TYPO3\\CMS\\Core\\Messaging\\FlashMessageService'
+               );
                /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
                $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
                $defaultFlashMessageQueue->enqueue($flashMessage);
                /** @var $defaultFlashMessageQueue \TYPO3\CMS\Core\Messaging\FlashMessageQueue */
                $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
                $defaultFlashMessageQueue->enqueue($flashMessage);
index 73a0eab..0f34477 100644 (file)
@@ -50,7 +50,10 @@ class FlashMessageService implements \TYPO3\CMS\Core\SingletonInterface {
         */
        public function getMessageQueueByIdentifier($identifier = 'core.template.flashMessages') {
                if (!isset($this->flashMessageQueues[$identifier])) {
         */
        public function getMessageQueueByIdentifier($identifier = 'core.template.flashMessages') {
                if (!isset($this->flashMessageQueues[$identifier])) {
-                       $this->flashMessageQueues[$identifier] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Messaging\FlashMessageQueue', $identifier);
+                       $this->flashMessageQueues[$identifier] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
+                               'TYPO3\CMS\Core\Messaging\FlashMessageQueue',
+                               $identifier
+                       );
                }
                return $this->flashMessageQueues[$identifier];
        }
                }
                return $this->flashMessageQueues[$identifier];
        }
index bed28bd..4a961de 100644 (file)
@@ -25,17 +25,25 @@ namespace TYPO3\CMS\Core\Tests\Unit\FormProtection;
 ***************************************************************/
 
 /**
 ***************************************************************/
 
 /**
- * Testcase for the \TYPO3\CMS\Core\FormProtection\BackendFormProtection class.
+ * Testcase
  *
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
 class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
  *
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
 class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
-        * @var \TYPO3\CMS\Core\FormProtection\BackendFormProtection
+        * @var $fixture \TYPO3\CMS\Core\FormProtection\BackendFormProtection|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
         */
-       private $fixture;
+       protected $fixture;
 
 
+       /**
+        * Backup of current singleton instances
+        */
+       protected $singletonInstances;
+
+       /**
+        * Set up
+        */
        public function setUp() {
                $GLOBALS['BE_USER'] = $this->getMock(
                        't3lib_beUserAuth',
        public function setUp() {
                $GLOBALS['BE_USER'] = $this->getMock(
                        't3lib_beUserAuth',
@@ -43,74 +51,28 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                );
                $GLOBALS['BE_USER']->user['uid'] = 1;
 
                );
                $GLOBALS['BE_USER']->user['uid'] = 1;
 
-               $className = $this->createAccessibleProxyClass();
-               $this->fixture = $this->getMock($className, array('acquireLock', 'releaseLock'));
+               $this->fixture = $this->getAccessibleMock(
+                       'TYPO3\\CMS\\Core\\FormProtection\BackendFormProtection',
+                       array('acquireLock', 'releaseLock')
+               );
+
+               $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
        }
 
        public function tearDown() {
        }
 
        public function tearDown() {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::resetSingletonInstances($this->singletonInstances);
                $this->fixture->__destruct();
                $this->fixture->__destruct();
-               unset($this->fixture);
-               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::getAllMessagesAndFlush();
        }
 
        }
 
-
        //////////////////////
        // Utility functions
        //////////////////////
 
        /**
        //////////////////////
        // Utility functions
        //////////////////////
 
        /**
-        * Creates a subclass \TYPO3\CMS\Core\FormProtection\BackendFormProtection with retrieveTokens made
-        * public.
-        *
-        * @return string the name of the created class, will not be empty
-        */
-       private function createAccessibleProxyClass() {
-               $namespace = 'TYPO3\\CMS\\Core\\FormProtection';
-               $className = 'BackendFormProtectionAccessibleProxy';
-               if (!class_exists($namespace . '\\' .$className)) {
-                       eval(
-                               'namespace ' . $namespace . ';' .
-                               'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\FormProtection\\BackendFormProtection {' .
-                               '  public function createValidationErrorMessage() {' .
-                               '    parent::createValidationErrorMessage();' .
-                               '  }' .
-                               '  public function retrieveSessionToken() {' .
-                               '    return parent::retrieveSessionToken();' .
-                               '  }' .
-                               '  public function setSessionToken($sessionToken) {' .
-                               '    $this->sessionToken = $sessionToken;' .
-                               '  }' .
-                               '}'
-                       );
-               }
-               $className = $namespace . '\\' . $className;
-               return $className;
-       }
-
-       /**
-        * Mock session methods in t3lib_beUserAuth
-        *
-        * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication Instance of BE_USER object with mocked session storage methods
+        * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication|\PHPUnit_Framework_MockObject_MockObject
         */
         */
-       private function createBackendUserSessionStorageStub() {
-               $namespace = 'TYPO3\\CMS\\Core\\Authentication';
-               $className = 'BackendUserAuthenticationMocked';
-               if (!class_exists($namespace . '\\' .$className)) {
-                       eval(
-                               'namespace ' . $namespace . ';' .
-                               'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication {' .
-                               '  protected $session=array();' .
-                               '  public function getSessionData($key) {' .
-                               '    return $this->session[$key];' .
-                               '  }' .
-                               '  public function setAndSaveSessionData($key, $data) {' .
-                               '    $this->session[$key] = $data;' .
-                               '  }' .
-                               '}'
-                       );
-               }
-               $className = $namespace . '\\' . $className;
-               return $this->getMock($className, array('foo'));// $className;
+       protected function getBackendUser() {
+               return $GLOBALS['BE_USER'];
        }
 
        ////////////////////////////////////
        }
 
        ////////////////////////////////////
@@ -120,34 +82,13 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
        /**
         * @test
         */
-       public function createAccessibleProxyCreatesBackendFormProtectionSubclass() {
-               $className = $this->createAccessibleProxyClass();
-
-               $this->assertTrue(
-                       (new $className()) instanceof \TYPO3\CMS\Core\FormProtection\BackendFormProtection
+       public function getBackendUserReturnsInstanceOfBackendUserAuthenticationClass() {
+               $this->assertInstanceOf(
+                       'TYPO3\\CMS\\Core\\Authentication\BackendUserAuthentication',
+                       $this->getBackendUser()
                );
        }
 
                );
        }
 
-       /**
-        * @test
-        */
-       public function createBackendUserSessionStorageStubWorkProperly() {
-               $GLOBALS['BE_USER'] = $this->createBackendUserSessionStorageStub();
-
-               $allTokens = array(
-                       '12345678' => array(
-                                       'formName' => 'foo',
-                                       'action' => 'edit',
-                                       'formInstanceName' => '42'
-                               ),
-               );
-
-               $GLOBALS['BE_USER']->setAndSaveSessionData('tokens', $allTokens);
-
-               $this->assertEquals($GLOBALS['BE_USER']->getSessionData('tokens'), $allTokens);
-       }
-
-
        //////////////////////////////////////////////////////////
        // Tests concerning the reading and saving of the tokens
        //////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////
        // Tests concerning the reading and saving of the tokens
        //////////////////////////////////////////////////////////
@@ -156,10 +97,12 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function retrieveTokenReadsTokenFromSessionData() {
         * @test
         */
        public function retrieveTokenReadsTokenFromSessionData() {
-               $GLOBALS['BE_USER']->expects($this->once())->method('getSessionData')
-                       ->with('formSessionToken')->will($this->returnValue(array()));
-
-               $this->fixture->retrieveSessionToken();
+               $this->getBackendUser()
+                       ->expects($this->once())
+                       ->method('getSessionData')
+                       ->with('formSessionToken')
+                       ->will($this->returnValue(array()));
+               $this->fixture->_call('retrieveSessionToken');
        }
 
        /**
        }
 
        /**
@@ -171,13 +114,17 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $action = 'edit';
                $formInstanceName = '42';
 
                $action = 'edit';
                $formInstanceName = '42';
 
-               $tokenId = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac($formName . $action . $formInstanceName . $sessionToken);
+               $tokenId = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac(
+                       $formName . $action . $formInstanceName . $sessionToken
+               );
 
 
-               $GLOBALS['BE_USER']->expects($this->atLeastOnce())->method('getSessionData')
+               $this->getBackendUser()
+                       ->expects($this->atLeastOnce())
+                       ->method('getSessionData')
                        ->with('formSessionToken')
                        ->will($this->returnValue($sessionToken));
 
                        ->with('formSessionToken')
                        ->will($this->returnValue($sessionToken));
 
-               $this->fixture->retrieveSessionToken();
+               $this->fixture->_call('retrieveSessionToken');
 
                $this->assertTrue(
                        $this->fixture->validateToken($tokenId, $formName, $action, $formInstanceName)
 
                $this->assertTrue(
                        $this->fixture->validateToken($tokenId, $formName, $action, $formInstanceName)
@@ -185,13 +132,13 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        }
 
        /**
        }
 
        /**
-        * @expectedException UnexpectedValueException
+        * @expectedException \UnexpectedValueException
         * @test
         */
        public function restoreSessionTokenFromRegistryThrowsExceptionIfSessionTokenIsEmpty() {
         * @test
         */
        public function restoreSessionTokenFromRegistryThrowsExceptionIfSessionTokenIsEmpty() {
-               $this->fixture->injectRegistry(
-                       $this->getMock('t3lib_Registry')
-               );
+               /** @var $registryMock \TYPO3\CMS\Core\Registry */
+               $registryMock = $this->getMock('TYPO3\\CMS\\Core\\Registry');
+               $this->fixture->injectRegistry($registryMock);
                $this->fixture->setSessionTokenFromRegistry();
        }
 
                $this->fixture->setSessionTokenFromRegistry();
        }
 
@@ -199,12 +146,12 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function persistSessionTokenWritesTokenToSession() {
         * @test
         */
        public function persistSessionTokenWritesTokenToSession() {
-               $sessionToken = '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd';
-               $this->fixture->setSessionToken($sessionToken);
-
-               $GLOBALS['BE_USER']->expects($this->once())
-                       ->method('setAndSaveSessionData')->with('formSessionToken', $sessionToken);
-
+               $sessionToken = uniqid('test_');
+               $this->fixture->_set('sessionToken', $sessionToken);
+               $this->getBackendUser()
+                       ->expects($this->once())
+                       ->method('setAndSaveSessionData')
+                       ->with('formSessionToken', $sessionToken);
                $this->fixture->persistSessionToken();
        }
 
                $this->fixture->persistSessionToken();
        }
 
@@ -216,38 +163,78 @@ class BackendFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
        /**
         * @test
         */
-       public function createValidationErrorMessageAddsErrorFlashMessage() {
-               $GLOBALS['BE_USER'] = $this->createBackendUserSessionStorageStub();
-               $this->fixture->createValidationErrorMessage();
-
-               $messages = \TYPO3\CMS\Core\Messaging\FlashMessageQueue::getAllMessagesAndFlush();
-
-               $this->assertNotEmpty($messages);
-               $this->assertContains(
-                       $GLOBALS['LANG']->sL(
-                               'LLL:EXT:lang/locallang_core.xml:error.formProtection.tokenInvalid'
-                       ),
-                       $messages[0]->render()
+       public function createValidationErrorMessageAddsFlashMessage() {
+               /** @var $flashMessageServiceMock \TYPO3\CMS\Core\Messaging\FlashMessageService|\PHPUnit_Framework_MockObject_MockObject */
+               $flashMessageServiceMock = $this->getMock('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+               \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(
+                       'TYPO3\\CMS\\Core\\Messaging\\FlashMessageService',
+                       $flashMessageServiceMock
+               );
+               $flashMessageQueueMock = $this->getMock(
+                       'TYPO3\\CMS\\Core\\Messaging\\FlashMessageQueue',
+                       array(),
+                       array(),
+                       '',
+                       FALSE
                );
                );
+               $flashMessageServiceMock
+                       ->expects($this->once())
+                       ->method('getMessageQueueByIdentifier')
+                       ->will($this->returnValue($flashMessageQueueMock));
+
+               $flashMessageQueueMock
+                       ->expects($this->once())
+                       ->method('enqueue')
+                       ->with($this->isInstanceOf('TYPO3\\CMS\\Core\\Messaging\\FlashMessage'))
+                       ->will($this->returnCallback(array($this, 'enqueueFlashMessageCallback')));
+
+               $this->fixture->_call('createValidationErrorMessage');
+       }
+
+       /**
+        * @param \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage
+        */
+       public function enqueueFlashMessageCallback(\TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage) {
+               $this->assertEquals(\TYPO3\CMS\Core\Messaging\FlashMessage::ERROR, $flashMessage->getSeverity());
        }
 
        /**
         * @test
         */
        public function createValidationErrorMessageAddsErrorFlashMessageButNotInSessionInAjaxRequest() {
        }
 
        /**
         * @test
         */
        public function createValidationErrorMessageAddsErrorFlashMessageButNotInSessionInAjaxRequest() {
-               $GLOBALS['BE_USER'] = $this->createBackendUserSessionStorageStub();
-               $GLOBALS['TYPO3_AJAX'] = TRUE;
-               $this->fixture->createValidationErrorMessage();
+               /** @var $flashMessageServiceMock \TYPO3\CMS\Core\Messaging\FlashMessageService|\PHPUnit_Framework_MockObject_MockObject */
+               $flashMessageServiceMock = $this->getMock('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
+               \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(
+                       'TYPO3\\CMS\\Core\\Messaging\\FlashMessageService',
+                       $flashMessageServiceMock
+               );
+               $flashMessageQueueMock = $this->getMock(
+                       'TYPO3\\CMS\\Core\\Messaging\\FlashMessageQueue',
+                       array(),
+                       array(),
+                       '',
+                       FALSE
+               );
+               $flashMessageServiceMock
+                       ->expects($this->once())
+                       ->method('getMessageQueueByIdentifier')
+                       ->will($this->returnValue($flashMessageQueueMock));
 
 
-               $messages = \TYPO3\CMS\Core\Messaging\FlashMessageQueue::getAllMessages();
+               $flashMessageQueueMock
+                       ->expects($this->once())
+                       ->method('enqueue')
+                       ->with($this->isInstanceOf('TYPO3\\CMS\\Core\\Messaging\\FlashMessage'))
+                       ->will($this->returnCallback(array($this, 'enqueueAjaxFlashMessageCallback')));
 
 
-               $this->assertNotEmpty($messages);
-               $this->assertContains(
-                       $GLOBALS['LANG']->sL(
-                               'LLL:EXT:lang/locallang_core.xml:error.formProtection.tokenInvalid'
-                       ),
-                       $messages[0]->render()
-               );
+               $GLOBALS['TYPO3_AJAX'] = TRUE;
+               $this->fixture->_call('createValidationErrorMessage');
+       }
+
+       /**
+        * @param \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage
+        */
+       public function enqueueAjaxFlashMessageCallback(\TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage) {
+               $this->assertFalse($flashMessage->isSessionMessage());
        }
 }
 ?>
\ No newline at end of file
        }
 }
 ?>
\ No newline at end of file
index 0af00d0..fe9cfea 100644 (file)
@@ -24,89 +24,43 @@ namespace TYPO3\CMS\Core\Tests\Unit\FormProtection;
 * This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 
 * This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
 
-require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('install') . 'mod/class.tx_install.php');
-
 /**
 /**
- * Testcase for the \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection class.
+ * Testcase
  *
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
 class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
  *
  * @author Oliver Klee <typo3-coding@oliverklee.de>
  */
 class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
+
        /**
        /**
-        * @var \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection
+        * @var \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
         */
         */
-       private $fixture;
+       protected $fixture;
 
        /**
 
        /**
-        * backup of $_SESSION
-        *
-        * @var array
+        * @var array Backup of $_SESSION
         */
         */
-       private $sessionBackup;
+       protected $sessionBackup;
 
 
+       /**
+        * Set up
+        */
        public function setUp() {
                $this->sessionBackup = $_SESSION;
 
        public function setUp() {
                $this->sessionBackup = $_SESSION;
 
-               $className = $this->createAccessibleProxyClass();
-               $this->fixture = new $className();
+               $this->fixture = $this->getAccessibleMock(
+                       'TYPO3\\CMS\\Core\\FormProtection\\InstallToolFormProtection',
+                       array('dummy')
+               );
        }
 
        }
 
+       /**
+        * Tear down
+        */
        public function tearDown() {
                $this->fixture->__destruct();
        public function tearDown() {
                $this->fixture->__destruct();
-               unset($this->fixture);
-
-               \TYPO3\CMS\Core\Messaging\FlashMessageQueue::getAllMessagesAndFlush();
-
                $_SESSION = $this->sessionBackup;
        }
 
                $_SESSION = $this->sessionBackup;
        }
 
-
-       //////////////////////
-       // Utility functions
-       //////////////////////
-
-       /**
-        * Creates a subclass \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection with retrieveTokens made
-        * public.
-        *
-        * @return string the name of the created class, will not be empty
-        */
-       private function createAccessibleProxyClass() {
-               $className = 't3lib_formprotection_InstallToolFormProtectionAccessibleProxy';
-               if (!class_exists($className)) {
-                       eval(
-                               'class ' . $className . ' extends \\TYPO3\\CMS\\Core\\FormProtection\\InstallToolFormProtection {' .
-                               '  public $sessionToken;' .
-                               '  public function createValidationErrorMessage() {' .
-                               '    parent::createValidationErrorMessage();' .
-                               '  }' .
-                               '  public function retrieveSessionToken() {' .
-                               '    parent::retrieveSessionToken();' .
-                               '  }' .
-                               '}'
-                       );
-               }
-
-               return $className;
-       }
-
-
-       ////////////////////////////////////
-       // Tests for the utility functions
-       ////////////////////////////////////
-
-       /**
-        * @test
-        */
-       public function createAccessibleProxyCreatesInstallToolFormProtectionSubclass() {
-               $className = $this->createAccessibleProxyClass();
-
-               $this->assertTrue(
-                       (new $className()) instanceof \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection
-               );
-       }
-
-
        //////////////////////////////////////////////////////////
        // Tests concerning the reading and saving of the tokens
        //////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////
        // Tests concerning the reading and saving of the tokens
        //////////////////////////////////////////////////////////
@@ -124,7 +78,7 @@ class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
                $_SESSION['installToolFormToken'] = $sessionToken;
 
 
                $_SESSION['installToolFormToken'] = $sessionToken;
 
-               $this->fixture->retrieveSessionToken();
+               $this->fixture->_call('retrieveSessionToken');
 
                $this->assertTrue(
                        $this->fixture->validateToken($tokenId, $formName, $action, $formInstanceName)
 
                $this->assertTrue(
                        $this->fixture->validateToken($tokenId, $formName, $action, $formInstanceName)
@@ -137,7 +91,7 @@ class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function persistSessionTokenWritesTokensToSession() {
                $_SESSION['installToolFormToken'] = 'foo';
 
        public function persistSessionTokenWritesTokensToSession() {
                $_SESSION['installToolFormToken'] = 'foo';
 
-               $this->fixture->sessionToken = '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd';
+               $this->fixture->_set('sessionToken', '881ffea2159ac72182557b79dc0c723f5a8d20136f9fab56cdd4f8b3a1dbcfcd');
 
                $this->fixture->persistSessionToken();
 
 
                $this->fixture->persistSessionToken();
 
@@ -166,7 +120,7 @@ class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        );
                $this->fixture->injectInstallTool($installTool);
 
                        );
                $this->fixture->injectInstallTool($installTool);
 
-               $this->fixture->createValidationErrorMessage();
+               $this->fixture->_call('createValidationErrorMessage');
        }
 }
 ?>
\ No newline at end of file
        }
 }
 ?>
\ No newline at end of file