Fixed bug #17664: Remove deprecated class t3lib_matchcondition
authorlolli <lolli@709f56b5-9817-0410-a4d7-c38de5d9e867>
Mon, 28 Feb 2011 19:33:43 +0000 (19:33 +0000)
committerlolli <lolli@709f56b5-9817-0410-a4d7-c38de5d9e867>
Mon, 28 Feb 2011 19:33:43 +0000 (19:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10663 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_matchcondition.php [deleted file]
t3lib/class.t3lib_tsparser.php
t3lib/class.t3lib_tstemplate.php
t3lib/core_autoload.php
t3lib/matchcondition/class.t3lib_matchcondition_frontend.php
tests/t3lib/matchcondition/t3lib_matchcondition_frontendTest.php
tests/t3lib/t3lib_matchconditionTest.php [deleted file]

index 8526cc5..345cfd2 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2011-02-28  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #17664: Remove deprecated class t3lib_matchcondition
        * Fixed bug #17663: Remove deprecated reduceColors() from t3lib_stdGraphic
        * Follow-up to #17670: Add typo3/template.php getDynTabMenuJScode() again and remove deprecated return value only
 
diff --git a/t3lib/class.t3lib_matchcondition.php b/t3lib/class.t3lib_matchcondition.php
deleted file mode 100644 (file)
index 225aa13..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-<?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
- *  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.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  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!
- ***************************************************************/
-/**
- * Contains class for Matching TypoScript conditions
- *
- * $Id$
- * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- *   80: class t3lib_matchCondition
- *   87:        function __construct()
- *  105:        function t3lib_matchCondition()
- *  115:        function match($condition_line)
- *  160:        function evalConditionStr($string)
- *  381:        function testNumber($test,$value)
- *  405:        function matchWild($haystack,$needle)
- *  429:        function whichDevice($useragent)
- *  498:        function browserInfo($useragent)
- *  611:        function browserInfo_version($tmp)
- *  624:        function getGlobal($var, $source=NULL)
- *  658:        function getGP_ENV_TSFE($var)
- *
- * TOTAL FUNCTIONS: 11
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
-
-
-/**
- * Matching TypoScript conditions
- *
- * Used with the TypoScript parser.
- * Matches browserinfo, IPnumbers for use with templates
- *
- * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
- * @package TYPO3
- * @subpackage t3lib
- * @see t3lib_TStemplate::matching(), t3lib_TStemplate::generateConfig()
- */
-class t3lib_matchCondition extends t3lib_matchCondition_frontend {
-       var $matchAlternative = array(); // If this array has elements, the matching returns true if a whole "matchline" is found in the array!
-       var $matchAll = 0; // If set all is matched!
-
-       var $altRootLine = array();
-       var $hookObjectsArr = array();
-
-       /**
-        * Constructor for this class
-        *
-        * @return      void
-        * @deprecated  since TYPO3 4.3, will be removed in TYPO3 4.6 - The functionality was moved to t3lib_matchCondition_frontend
-        */
-       function __construct() {
-               t3lib_div::logDeprecatedFunction();
-
-               parent::__construct();
-       }
-
-       /**
-        * Matching TS condition
-        *
-        * @param       string          Line to match
-        * @return      boolean         True if matched
-        */
-       function match($condition_line) {
-               if ($this->matchAll) {
-                       parent::setSimulateMatchResult(TRUE);
-               }
-               if (count($this->matchAlternative)) {
-                       parent::setSimulateMatchConditions($this->matchAlternative);
-               }
-
-               return parent::match($condition_line);
-       }
-
-
-       /**
-        * Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
-        *
-        * @param       string          The condition to match against its criterias.
-        * @return      boolean         Returns true or false based on the evaluation.
-        * @see t3lib_tsparser::parse()
-        */
-       function evalConditionStr($string) {
-               return parent::evaluateCondition($string);
-       }
-
-       /**
-        * Evaluates a $leftValue based on an operator: "<", ">", "<=", ">=", "!=" or "="
-        *
-        * @param       string          $test: The value to compare with on the form [operator][number]. Eg. "< 123"
-        * @param       integer         $leftValue: The value on the left side
-        * @return      boolean         If $value is "50" and $test is "< 123" then it will return true.
-        */
-       function testNumber($test, $leftValue) {
-               return parent::compareNumber($test, $leftValue);
-       }
-
-       /**
-        * Matching two strings against each other, supporting a "*" wildcard or (if wrapped in "/") PCRE regular expressions
-        *
-        * @param       string          The string in which to find $needle.
-        * @param       string          The string to find in $haystack
-        * @return      boolean         Returns true if $needle matches or is found in (according to wildcards) in $haystack. Eg. if $haystack is "Netscape 6.5" and $needle is "Net*" or "Net*ape" then it returns true.
-        */
-       function matchWild($haystack, $needle) {
-               return parent::searchStringWildcard($haystack, $needle);
-       }
-
-       /**
-        * Returns a code for a browsing device based on the input useragent string
-        *
-        * @param       string          User agent string from browser, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
-        * @return      string          A code. See link.
-        * @access private
-        */
-       function whichDevice($useragent) {
-               return parent::getDeviceType($useragent);
-       }
-
-       /**
-        * Generates an array with abstracted browser information
-        * This method is used in the function match() in this class
-        *
-        * @param       string          The useragent string, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
-        * @return      array           Contains keys "browser", "version", "system"
-        * @access private
-        * @see match()
-        */
-       function browserInfo($useragent) {
-               return parent::getBrowserInfo($useragent);
-       }
-
-       /**
-        * Returns the version of a browser; Basically getting doubleval() of the input string, stripping of any non-numeric values in the beginning of the string first.
-        *
-        * @param       string          A string with version number, eg. "/7.32 blablabla"
-        * @return      double          Returns double value, eg. "7.32"
-        * @deprecated  since TYPO3 4.3, will be removed in TYPO3 4.6 - use t3lib_utility_Client::getVersion() instead
-        */
-       function browserInfo_version($tmp) {
-               t3lib_div::logDeprecatedFunction();
-               return t3lib_utility_Client::getVersion($tmp);
-       }
-
-       /**
-        * Return global variable where the input string $var defines array keys separated by "|"
-        * Example: $var = "HTTP_SERVER_VARS | something" will return the value $GLOBALS['HTTP_SERVER_VARS']['something'] value
-        *
-        * @param       string          Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the GET parameter "id" back.
-        * @param       array           Alternative array than $GLOBAL to get variables from.
-        * @return      mixed           Whatever value. If none, then blank string.
-        * @access private
-        */
-       function getGlobal($var, $source = NULL) {
-               return parent::getGlobal($var, $source);
-       }
-
-       /**
-        * Returns GP / ENV / TSFE vars
-        *
-        * @param       string          Identifier
-        * @return      mixed           The value of the variable pointed to.
-        * @access private
-        * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=311&cHash=487cbd5cdf
-        */
-       function getGP_ENV_TSFE($var) {
-               return parent::getVariable($var);
-       }
-}
-
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_matchcondition.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_matchcondition.php']);
-}
-
-?>
\ No newline at end of file
index 27c83df..fd6b96b 100644 (file)
@@ -65,7 +65,7 @@
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage t3lib
- * @see t3lib_tstemplate, t3lib_matchcondition, t3lib_BEfunc::getPagesTSconfig(), t3lib_userAuthGroup::fetchGroupData(), t3lib_TStemplate::generateConfig()
+ * @see t3lib_tstemplate, t3lib_BEfunc::getPagesTSconfig(), t3lib_userAuthGroup::fetchGroupData(), t3lib_TStemplate::generateConfig()
  */
 class t3lib_TSparser {
        var $strict = 1; // If set, then key names cannot contain characters other than [:alnum:]_\.-
@@ -118,7 +118,7 @@ class t3lib_TSparser {
         * Start parsing the input TypoScript text piece. The result is stored in $this->setup
         *
         * @param       string          The TypoScript text
-        * @param       object          If is object (instance of t3lib_matchcondition), then this is used to match conditions found in the TypoScript code. If matchObj not specified, then no conditions will work! (Except [GLOBAL])
+        * @param       object          If is object, then this is used to match conditions found in the TypoScript code. If matchObj not specified, then no conditions will work! (Except [GLOBAL])
         * @return      void
         */
        function parse($string, $matchObj = '') {
index 361cf89..c992318 100644 (file)
@@ -87,7 +87,7 @@
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage t3lib
- * @see        t3lib_tsparser.php, t3lib_matchcondition.php
+ * @see        t3lib_tsparser, t3lib_matchcondition_abstract
  */
 class t3lib_TStemplate {
 
index bf7b346..2ee0478 100644 (file)
@@ -40,7 +40,6 @@ $t3libClasses = array(
        't3lib_loaddbgroup' => PATH_t3lib . 'class.t3lib_loaddbgroup.php',
        't3lib_loadmodules' => PATH_t3lib . 'class.t3lib_loadmodules.php',
        't3lib_lock' => PATH_t3lib . 'class.t3lib_lock.php',
-       't3lib_matchcondition' => PATH_t3lib . 'class.t3lib_matchcondition.php',
        't3lib_message_abstractmessage' => PATH_t3lib . 'message/class.t3lib_message_abstractmessage.php',
        't3lib_message_errorpagemessage' => PATH_t3lib . 'message/class.t3lib_message_errorpagemessage.php',
        't3lib_modsettings' => PATH_t3lib . 'class.t3lib_modsettings.php',
index 410503c..26a06aa 100644 (file)
  * @subpackage t3lib
  */
 class t3lib_matchCondition_frontend extends t3lib_matchCondition_abstract {
-       /**
-        * @var array
-        */
-       protected $deprecatedHooks = array();
-
-       /**
-        * Constructor for this class
-        *
-        * @return      void
-        */
-       public function __construct() {
-               $this->initializeDeprecatedHooks();
-       }
-
-       /**
-        * Initializes deprectated hooks that existed in t3lib_matchCondition until TYPO3 4.3.
-        *
-        * @return      void
-        */
-       protected function initializeDeprecatedHooks() {
-                       // Hook: $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass']:
-               $matchConditionHooks =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass'];
-               if (is_array($matchConditionHooks)) {
-                       t3lib_div::deprecationLog(
-                               'The hook $TYPO3_CONF_VARS[SC_OPTIONS][t3lib/class.t3lib_matchcondition.php][matchConditionClass] ' .
-                               'is deprecated since TYPO3 4.3. Use the new hooks getBrowserInfo and getDeviceType in ' .
-                               't3lib_utility_Client instead.'
-                       );
-
-                       foreach ($matchConditionHooks as $hookClass) {
-                               $this->deprecatedHooks[] = t3lib_div::getUserObj($hookClass, '');
-                       }
-               }
-       }
 
        /**
         * Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"
@@ -127,56 +93,6 @@ class t3lib_matchCondition_frontend extends t3lib_matchCondition_abstract {
        }
 
        /**
-        * Generates an array with abstracted browser information
-        *
-        * @param       string          $userAgent: The useragent string, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
-        * @return      array           Contains keys "browser", "version", "system"
-        */
-       protected function getBrowserInfo($userAgent) {
-                       // Exceute deprecated hooks:
-                       // @deprecated since TYPO3 4.3
-               foreach ($this->deprecatedHooks as $hookObj) {
-                       if (method_exists($hookObj, 'browserInfo')) {
-                               $result = $hookObj->browserInfo($userAgent);
-                               if (strlen($result)) {
-                                       return $result;
-                               }
-                       }
-               }
-
-               return parent::getBrowserInfo($userAgent);
-       }
-
-       /**
-        * Gets a code for a browsing device based on the input useragent string.
-        *
-        * @param       string          $userAgent: The useragent string, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
-        * @return      string          Code for the specific device type
-        */
-       protected function getDeviceType($userAgent) {
-                       // Exceute deprecated hooks:
-                       // @deprecated since TYPO3 4.3
-               foreach ($this->deprecatedHooks as $hookObj) {
-                       if (method_exists($hookObj, 'whichDevice')) {
-                               $result = $hookObj->whichDevice($userAgent);
-                               if (strlen($result)) {
-                                       return $result;
-                               }
-                       }
-               }
-
-                       // deprecated, see above
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['devices_class'])) {
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['devices_class'] as $_classRef) {
-                               $_procObj = t3lib_div::getUserObj($_classRef);
-                               return $_procObj->whichDevice_ext($userAgent);
-                       }
-               }
-
-               return parent::getDeviceType($userAgent);
-       }
-
-       /**
         * Returns GP / ENV / TSFE vars
         *
         * @param       string          Identifier
index 0ba4f00..88a940e 100644 (file)
@@ -228,46 +228,6 @@ class t3lib_matchCondition_frontendTest extends tx_phpunit_testcase {
        }
 
        /**
-        * Tests whether the browserInfo hook is called.
-        *
-        * @return      void
-        * @test
-        */
-       public function deprecatedBrowserInfoHookIsCalled() {
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'] = FALSE;
-
-               $classRef = uniqid('tx_browserInfoHook');
-               $browserInfoHookMock = $this->getMock($classRef, array('browserInfo'));
-               $browserInfoHookMock->expects($this->atLeastOnce())->method('browserInfo');
-
-               $GLOBALS['T3_VAR']['getUserObj'][$classRef] = $browserInfoHookMock;
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass'][$classRef] = $classRef;
-
-               $this->matchCondition->__construct();
-               $this->matchCondition->match('[browser = msie] && [version = 7] && [system = winNT]');
-       }
-
-       /**
-        * Tests whether the whichDevice hook is called.
-        *
-        * @return      void
-        * @test
-        */
-       public function deprecatedWhichDeviceHookIsCalled() {
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'] = FALSE;
-
-               $classRef = uniqid('tx_whichDeviceHook');
-               $whichDeviceHookMock = $this->getMock($classRef, array('whichDevice'));
-               $whichDeviceHookMock->expects($this->atLeastOnce())->method('whichDevice');
-
-               $GLOBALS['T3_VAR']['getUserObj'][$classRef] = $whichDeviceHookMock;
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass'][$classRef] = $classRef;
-
-               $this->matchCondition->__construct();
-               $this->matchCondition->match('[device = robot]');
-       }
-
-       /**
         * Tests whether the language comparison matches.
         * @test
         */
@@ -367,6 +327,15 @@ class t3lib_matchCondition_frontendTest extends tx_phpunit_testcase {
        }
 
        /**
+        * Tests whether user is not logged in
+        * @test
+        */
+       public function loginUserConditionMatchIfUserIsNotLoggedIn() {
+               $GLOBALS['TSFE']->loginUser = FALSE;
+               $this->assertTrue($this->matchCondition->match('[loginUser = ]'));
+       }
+
+       /**
         * Tests whether numerical comparison matches.
         * @test
         */
diff --git a/tests/t3lib/t3lib_matchconditionTest.php b/tests/t3lib/t3lib_matchconditionTest.php
deleted file mode 100644 (file)
index 9b30d4b..0000000
+++ /dev/null
@@ -1,631 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2009-2011 Oliver Hader <oliver@typo3.org>
-*  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 class t3lib_matchCondition.
- *
- * @author     Oliver Hader <oliver@typo3.org>
- * @package TYPO3
- * @subpackage t3lib
- */
-class t3lib_matchConditionTest extends tx_phpunit_testcase {
-       /**
-        * @var array
-        */
-       private $backupGlobalVariables;
-
-       /**
-        * @var array
-        */
-       private $rootline;
-
-       /**
-        * @var t3lib_matchCondition
-        */
-       private $matchCondition;
-
-       public function setUp() {
-               $this->backupGlobalVariables = array(
-                       '_ENV' => $_ENV,
-                       '_GET' => $_GET,
-                       '_POST' => $_POST,
-                       '_SERVER' => $_SERVER,
-                       'TYPO3_CONF_VARS' => $GLOBALS['TYPO3_CONF_VARS'],
-                       'T3_VAR' => $GLOBALS['T3_VAR'],
-               );
-
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog'] = FALSE;
-
-               $this->testGlobalNamespace = uniqid('TEST');
-               $GLOBALS[$this->testGlobalNamespace] = array();
-
-               $this->setUpTSFE();
-               $this->matchCondition = t3lib_div::makeInstance('t3lib_matchCondition');
-       }
-
-       public function tearDown() {
-               foreach ($this->backupGlobalVariables as $key => $data) {
-                       $GLOBALS[$key] = $data;
-               }
-
-               unset($this->matchCondition);
-               unset($this->backupGlobalVariables);
-               unset($GLOBALS[$this->testGlobalNamespace]);
-       }
-
-       private function setUpTSFE() {
-               $this->rootline = array(
-                       2 => array('uid' => 121, 'pid' => 111),
-                       1 => array('uid' => 111, 'pid' => 101,),
-                       0 => array('uid' => 101, 'pid' => 0,),
-               );
-
-               $GLOBALS['TSFE'] = $this->getMock('tslib_fe', array(), array(), '', FALSE);
-               $GLOBALS['TSFE']->tmpl = $this->getMock('t3lib_TStemplate');
-       }
-
-       /**
-        * Tests whether a faulty expression fails.
-        * @test
-        */
-       public function simulateDisabledMatchAllConditionsFailsOnFaultyExpression() {
-               $this->matchCondition->matchAll = false;
-               $this->assertFalse($this->matchCondition->match('[nullCondition = This expression would return false in general]'));
-       }
-
-       /**
-        * Tests whether simulating positive matches for all conditions succeeds.
-        * @test
-        */
-       public function simulateEnabledMatchAllConditionsSucceeds() {
-               $this->matchCondition->matchAll = true;
-               $this->assertTrue($this->matchCondition->match('[nullCondition = This expression would return false in general]'));
-       }
-
-       /**
-        * Tests whether simulating positive matches for specific conditions succeeds.
-        * @test
-        */
-       public function simulateEnabledMatchSpecificConditionsSucceeds() {
-               $testCondition = '[' . uniqid('test') . ' = Any condition to simulate a positive match]';
-               $this->matchCondition->matchAlternative = array($testCondition);
-               $this->assertTrue($this->matchCondition->match($testCondition));
-       }
-
-       /**
-        * Tests whether a condition matches Internet Explorer 7 on Windows.
-        *
-        * @return      void
-        * @test
-        */
-       public function conditionMatchesInternetExplorer7Windows() {
-               $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)';
-               $result = $this->matchCondition->match('[browser = msie] && [version = 7] && [system = winNT]');
-               $this->assertTrue($result);
-       }
-
-       /**
-        * Tests whether a condition does not match Internet Explorer 7 on Windows.
-        *
-        * @return      void
-        * @test
-        */
-       public function conditionDoesNotMatchInternetExplorer7Windows() {
-               $_SERVER['HTTP_USER_AGENT'] = 'Opera/9.25 (Windows NT 6.0; U; en)';
-               $result = $this->matchCondition->match('[browser = msie] && [version = 7] && [system = winNT]');
-               $this->assertFalse($result);
-       }
-
-       /**
-        * Tests whether the browserInfo hook is called.
-        *
-        * @return      void
-        * @test
-        */
-       public function deprecatedBrowserInfoHookIsCalled() {
-               $classRef = uniqid('tx_browserInfoHook');
-               $browserInfoHookMock = $this->getMock($classRef, array('browserInfo'));
-               $browserInfoHookMock->expects($this->atLeastOnce())->method('browserInfo');
-
-               $GLOBALS['T3_VAR']['getUserObj'][$classRef] = $browserInfoHookMock;
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass'][$classRef] = $classRef;
-
-               $this->matchCondition->__construct();
-               $this->matchCondition->match('[browser = msie] && [version = 7] && [system = winNT]');
-       }
-
-       /**
-        * Tests whether a device type condition matches a crawler.
-        * @test
-        */
-       public function deviceConditionMatchesRobot() {
-               $_SERVER['HTTP_USER_AGENT'] = 'Googlebot/2.1 (+http://www.google.com/bot.html)';
-               $result = $this->matchCondition->match('[device = robot]');
-               $this->assertTrue($result);
-       }
-
-       /**
-        * Tests whether a device type condition does not match a crawler.
-        * @test
-        */
-       public function deviceConditionDoesNotMatchRobot() {
-               $_SERVER['HTTP_USER_AGENT'] = md5('Some strange user agent');
-               $result = $this->matchCondition->match('[device = robot]');
-               $this->assertFalse($result);
-       }
-
-       /**
-        * Tests whether the whichDevice hook is called.
-        *
-        * @return      void
-        * @test
-        */
-       public function deprecatedWhichDeviceHookIsCalled() {
-               $classRef = uniqid('tx_whichDeviceHook');
-               $whichDeviceHookMock = $this->getMock($classRef, array('whichDevice'));
-               $whichDeviceHookMock->expects($this->atLeastOnce())->method('whichDevice');
-
-               $GLOBALS['T3_VAR']['getUserObj'][$classRef] = $whichDeviceHookMock;
-               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_matchcondition.php']['matchConditionClass'][$classRef] = $classRef;
-
-               $this->matchCondition->__construct();
-               $this->matchCondition->match('[device = robot]');
-       }
-
-       /**
-        * Tests whether the language comparison matches.
-        * @test
-        */
-       public function languageConditionMatchesSingleLanguageExpression() {
-               $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
-               $this->assertTrue($this->matchCondition->match('[language = *de*]'));
-               $this->assertTrue($this->matchCondition->match('[language = *de-de*]'));
-       }
-
-       /**
-        * Tests whether the language comparison matches.
-        * @test
-        */
-       public function languageConditionMatchesMultipleLanguagesExpression() {
-               $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
-               $this->assertTrue($this->matchCondition->match('[language = *en*,*de*]'));
-               $this->assertTrue($this->matchCondition->match('[language = *en-us*,*de-de*]'));
-       }
-
-       /**
-        * Tests whether the language comparison matches.
-        * @test
-        */
-       public function languageConditionMatchesCompleteLanguagesExpression() {
-               $this->markTestSkipped('This comparison seems to be incomplete in t3lib_matchCondition.');
-
-               $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
-               $this->assertTrue($this->matchCondition->match('[language = de-de,de;q=0.8]'));
-       }
-
-       /**
-        * Tests whether usergroup comparison matches.
-        * @test
-        */
-       public function usergroupConditionMatchesSingleGroupId() {
-               $GLOBALS['TSFE']->gr_list = '13,14,15';
-               $this->assertTrue($this->matchCondition->match('[usergroup = 13]'));
-       }
-
-       /**
-        * Tests whether usergroup comparison matches.
-        * @test
-        */
-       public function usergroupConditionMatchesMultipleUserGroupId() {
-               $GLOBALS['TSFE']->gr_list = '13,14,15';
-               $this->assertTrue($this->matchCondition->match('[usergroup = 999,15,14,13]'));
-       }
-
-       /**
-        * Tests whether usergroup comparison matches.
-        * @test
-        */
-       public function usergroupConditionDoesNotMatchDefaulUserGroupIds() {
-               $GLOBALS['TSFE']->gr_list = '0,-1';
-               $this->assertFalse($this->matchCondition->match('[usergroup = 0,-1]'));
-       }
-
-       /**
-        * Tests whether user comparison matches.
-        * @test
-        */
-       public function loginUserConditionMatchesAnyLoggedInUser() {
-               $GLOBALS['TSFE']->loginUser = TRUE;
-               $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
-               $this->assertTrue($this->matchCondition->match('[loginUser = *]'));
-       }
-
-       /**
-        * Tests whether user comparison matches.
-        * @test
-        */
-       public function loginUserConditionMatchesSingleLoggedInUser() {
-               $GLOBALS['TSFE']->loginUser = TRUE;
-               $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
-               $this->assertTrue($this->matchCondition->match('[loginUser = 13]'));
-       }
-
-       /**
-        * Tests whether user comparison matches.
-        * @test
-        */
-       public function loginUserConditionMatchesMultipleLoggedInUsers() {
-               $GLOBALS['TSFE']->loginUser = TRUE;
-               $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
-               $this->assertTrue($this->matchCondition->match('[loginUser = 999,13]'));
-       }
-
-       /**
-        * Tests whether user comparison matches.
-        * @test
-        */
-       public function loginUserConditionDoesNotMatchIfNotUserIsLoggedId() {
-               $GLOBALS['TSFE']->loginUser = FALSE;
-               $GLOBALS['TSFE']->fe_user->user['uid'] = 13;
-               $this->assertFalse($this->matchCondition->match('[loginUser = *]'));
-               $this->assertFalse($this->matchCondition->match('[loginUser = 13]'));
-       }
-
-       /**
-        * Tests whether user is not logged in
-        * @test
-        */
-       public function loginUserConditionMatchIfUserIsNotLoggedIn() {
-               $GLOBALS['TSFE']->loginUser = FALSE;
-               $this->assertTrue($this->matchCondition->match('[loginUser = ]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionMatchesOnEqualExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 = 10]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 = 10.1]'));
-
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 == 10]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 == 10.1]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionMatchesOnNotEqualExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 != 20]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 != 10.2]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionMatchesOnLowerThanExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 < 20]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 < 10.2]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionMatchesOnLowerThanOrEqualExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 <= 10]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 <= 20]'));
-
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 <= 10.1]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 <= 10.2]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionMatchesOnGreaterThanExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 > 10]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.2 > 10.1]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionMatchesOnGreaterThanOrEqualExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10 >= 10]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:20 >= 10]'));
-
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.1 >= 10.1]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = LIT:10.2 >= 10.1]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionMatchesOnEmptyExpressionWithNoValueSet() {
-               $testKey = uniqid('test');
-               $this->assertTrue($this->matchCondition->match('[globalVar = GP:' . $testKey . '=]'));
-               $this->assertTrue($this->matchCondition->match('[globalVar = GP:' . $testKey . ' = ]'));
-       }
-
-       /**
-        * Tests whether numerical comparison matches.
-        * @test
-        */
-       public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {
-               $testKey = uniqid('test');
-
-               $_GET = array();
-               $_POST = array($testKey => 0);
-
-               $this->assertFalse($this->matchCondition->match('[globalVar = GP:' . $testKey . '=]'));
-               $this->assertFalse($this->matchCondition->match('[globalVar = GP:' . $testKey . ' = ]'));
-       }
-
-       /**
-        * Tests whether string comparison matches.
-        * @test
-        */
-       public function globalStringConditionMatchesOnEqualExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3.Test.Condition]'));
-               $this->assertFalse($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3]'));
-       }
-
-       /**
-        * Tests whether string comparison matches.
-        * @test
-        */
-       public function globalStringConditionMatchesWildcardExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3?Test?Condition]'));
-               $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3.T*t.Condition]'));
-               $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = TYPO3?T*t?Condition]'));
-       }
-
-       /**
-        * Tests whether string comparison matches.
-        * @test
-        */
-       public function globalStringConditionMatchesRegularExpression() {
-               $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = /^[A-Za-z3.]+$/]'));
-               $this->assertTrue($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = /^TYPO3\..+Condition$/]'));
-               $this->assertFalse($this->matchCondition->match('[globalString = LIT:TYPO3.Test.Condition = /^FALSE/]'));
-       }
-
-       /**
-        * Tests whether string comparison matches.
-        * @test
-        */
-       public function globalStringConditionMatchesEmptyRegularExpression() {
-               $testKey = uniqid('test');
-               $_SERVER[$testKey] = '';
-               $this->assertTrue($this->matchCondition->match('[globalString = _SERVER|' . $testKey . ' = /^$/]'));
-       }
-
-       /**
-        * Tests whether treeLevel comparison matches.
-        * @test
-        */
-       public function treeLevelConditionMatchesSingleValue() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $this->assertTrue($this->matchCondition->match('[treeLevel = 2]'));
-       }
-
-       /**
-        * Tests whether treeLevel comparison matches.
-        * @test
-        */
-       public function treeLevelConditionMatchesMultipleValues() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $this->assertTrue($this->matchCondition->match('[treeLevel = 999,998,2]'));
-       }
-
-       /**
-        * Tests whether treeLevel comparison matches.
-        * @test
-        */
-       public function treeLevelConditionDoesNotMatchFaultyValue() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $this->assertFalse($this->matchCondition->match('[treeLevel = 999]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in the previous rootline entries.
-        * @test
-        */
-       public function PIDupinRootlineConditionMatchesSinglePageIdInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertTrue($this->matchCondition->match('[PIDupinRootline = 111]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in the previous rootline entries.
-        * @test
-        */
-       public function PIDupinRootlineConditionMatchesMultiplePageIdsInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertTrue($this->matchCondition->match('[PIDupinRootline = 999,111,101]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in the previous rootline entries.
-        * @test
-        */
-       public function PIDupinRootlineConditionDoesNotMatchPageIdNotInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertFalse($this->matchCondition->match('[PIDupinRootline = 999]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in the previous rootline entries.
-        * @test
-        */
-       public function PIDupinRootlineConditionDoesNotMatchLastPageIdInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertFalse($this->matchCondition->match('[PIDupinRootline = 121]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in all rootline entries.
-        * @test
-        */
-       public function PIDinRootlineConditionMatchesSinglePageIdInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertTrue($this->matchCondition->match('[PIDinRootline = 111]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in all rootline entries.
-        * @test
-        */
-       public function PIDinRootlineConditionMatchesMultiplePageIdsInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertTrue($this->matchCondition->match('[PIDinRootline = 999,111,101]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in all rootline entries.
-        * @test
-        */
-       public function PIDinRootlineConditionMatchesLastPageIdInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertTrue($this->matchCondition->match('[PIDinRootline = 121]'));
-       }
-
-       /**
-        * Tests whether a page Id is found in all rootline entries.
-        * @test
-        */
-       public function PIDinRootlineConditionDoesNotMatchPageIdNotInRootline() {
-               $GLOBALS['TSFE']->tmpl->rootLine = $this->rootline;
-               $GLOBALS['TSFE']->id = 121;
-               $this->assertFalse($this->matchCondition->match('[PIDinRootline = 999]'));
-       }
-
-       /**
-        * Tests whether the compatibility version can be evaluated.
-        * (e.g. 4.9 is compatible to 4.0 but not to 5.0)
-        * @test
-        */
-       public function compatVersionConditionMatchesOlderRelease() {
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] = '4.9';
-               $this->assertTrue($this->matchCondition->match('[compatVersion = 4.0]'));
-       }
-
-       /**
-        * Tests whether the compatibility version can be evaluated.
-        * (e.g. 4.9 is compatible to 4.0 but not to 5.0)
-        * @test
-        */
-       public function compatVersionConditionMatchesSameRelease() {
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] = '4.9';
-               $this->assertTrue($this->matchCondition->match('[compatVersion = 4.9]'));
-       }
-
-       /**
-        * Tests whether the compatibility version can be evaluated.
-        * (e.g. 4.9 is compatible to 4.0 but not to 5.0)
-        * @test
-        */
-       public function compatVersionConditionDoesNotMatchNewerRelease() {
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'] = '4.9';
-               $this->assertFalse($this->matchCondition->match('[compatVersion = 5.0]'));
-       }
-
-       /**
-        * Tests whether the gneric fetching of variables works with the namespace 'GP'.
-        * @test
-        */
-       public function genericGetVariablesSucceedsWithNamespaceGP() {
-               $_GET = array('testGet' => 'getTest');
-               $_POST = array('testPost' => 'postTest');
-
-               $this->assertTrue($this->matchCondition->match('[globalString = GP:testGet = getTest]'));
-               $this->assertTrue($this->matchCondition->match('[globalString = GP:testPost = postTest]'));
-       }
-
-       /**
-        * Tests whether the gneric fetching of variables works with the namespace 'TSFE'.
-        * @test
-        */
-       public function genericGetVariablesSucceedsWithNamespaceTSFE() {
-               $GLOBALS['TSFE']->id = 1234567;
-               $GLOBALS['TSFE']->testSimpleObject = new stdClass();
-               $GLOBALS['TSFE']->testSimpleObject->testSimpleVariable = 'testValue';
-
-               $this->assertTrue($this->matchCondition->match('[globalString = TSFE:id = 1234567]'));
-               $this->assertTrue($this->matchCondition->match('[globalString = TSFE:testSimpleObject|testSimpleVariable = testValue]'));
-       }
-
-       /**
-        * Tests whether the gneric fetching of variables works with the namespace 'ENV'.
-        * @test
-        */
-       public function genericGetVariablesSucceedsWithNamespaceENV() {
-               $testKey = uniqid('test');
-               putenv($testKey .'=testValue');
-
-               $this->assertTrue($this->matchCondition->match('[globalString = ENV:' . $testKey . ' = testValue]'));
-       }
-
-       /**
-        * Tests whether the gneric fetching of variables works with the namespace 'IENV'.
-        * @test
-        */
-       public function genericGetVariablesSucceedsWithNamespaceIENV() {
-               $_SERVER['HTTP_HOST'] = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY') . ':1234567';
-               $this->assertTrue($this->matchCondition->match('[globalString = IENV:TYPO3_PORT = 1234567]'));
-       }
-
-       /**
-        * Tests whether the gneric fetching of variables works with any global namespace.
-        * @test
-        */
-       public function genericGetVariablesSucceedsWithAnyGlobalNamespace() {
-               $GLOBALS[$this->testGlobalNamespace] = array(
-                       'first' => 'testFirst',
-                       'second' => array('third' => 'testThird'),
-               );
-
-               $this->assertTrue($this->matchCondition->match(
-                       '[globalString = ' . $this->testGlobalNamespace . '|first = testFirst]'
-               ));
-               $this->assertTrue($this->matchCondition->match(
-                       '[globalString = ' . $this->testGlobalNamespace . '|second|third = testThird]'
-               ));
-       }
-}
-?>
\ No newline at end of file