Follow-up to test #12153: Added unit tests for simulated conditions via TypoScript...
authorOliver Hader <oliver.hader@typo3.org>
Thu, 8 Oct 2009 15:46:06 +0000 (15:46 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 8 Oct 2009 15:46:06 +0000 (15:46 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6111 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
tests/t3lib/t3lib_matchcondition_testcase.php

index db3147c..b22dedf 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-10-08  Oliver Hader  <oliver@typo3.org>
 
        * Added test #12153: Add more unit tests for t3lib_matchCondition
+       * Follow-up to test #12153: Added unit tests for simulated conditions via TypoScript object browser
 
 2009-10-07  Francois Suter  <francois@typo3.org>
 
index a685f48..fd16c65 100644 (file)
@@ -84,6 +84,34 @@ class t3lib_matchCondition_testcase extends tx_phpunit_testcase {
        }
 
        /**
+        * 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