diff --git a/tests/t3lib/t3lib_beuserauthTest.php b/tests/t3lib/t3lib_beuserauthTest.php new file mode 100644 index 0000000000000000000000000000000000000000..957c03a12909fa0be76020a0642a076ef83059cd --- /dev/null +++ b/tests/t3lib/t3lib_beuserauthTest.php @@ -0,0 +1,69 @@ +<?php +/*************************************************************** +* Copyright notice +* +* (c) 2010 Oliver Klee (typo3-coding@oliverklee.de) +* All rights reserved +* +* This script is part of the TYPO3 project. The TYPO3 project is +* free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* The GNU General Public License can be found at +* http://www.gnu.org/copyleft/gpl.html. +* +* This script is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* This copyright notice MUST APPEAR in all copies of the script! +***************************************************************/ + +/** + * Testcase for the t3lib_beUserAuth class in the TYPO3 Core extension. + * + * @package TYPO3 + * @subpackage t3lib + * + * @author Oliver Klee <typo3-coding@oliverklee.de> + */ +class t3lib_beUserAuthTest extends tx_phpunit_testcase { + /** + * @var t3lib_beUserAuth + */ + private $fixture = NULL; + + public function setUp() { + $this->fixture = new t3lib_beUserAuth(); + } + + public function tearDown() { + unset($this->fixture); + + t3lib_formProtection_Factory::purgeInstances(); + } + + + ///////////////////////////////////////// + // Tests concerning the form protection + ///////////////////////////////////////// + + /** + * @test + */ + public function logoffCleansFormProtection() { + $formProtection = $this->getMock( + 't3lib_formprotection_BackendFormProtection', array('clean') + ); + $formProtection->expects($this->atLeastOnce())->method('clean'); + t3lib_formProtection_Factory::set( + 't3lib_formprotection_BackendFormProtection', $formProtection + ); + + $this->fixture->logoff(); + } +} +?>