Added unit tests for bug #13412: BETWEEN operator is not supported
authorXavier Perseguers <typo3@perseguers.ch>
Wed, 3 Feb 2010 14:41:52 +0000 (14:41 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Wed, 3 Feb 2010 14:41:52 +0000 (14:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@29640 735d13b6-9817-0410-8766-e36946ffe9aa

typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/tests/sqlparser_general_testcase.php

index 82ec060..3f6ff07 100644 (file)
@@ -1,3 +1,7 @@
+2010-02-03  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Added unit tests for bug #13412: BETWEEN operator is not supported
+
 2010-01-24  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Fixed bug #13090: version warning with CSS styled content
index 257614d..fff79c9 100644 (file)
@@ -190,6 +190,22 @@ class sqlparser_general_testcase extends BaseTestCase {
                $this->assertEquals($expected, $actual);
        }
 
+       /**
+        * @test
+        * @see http://bugs.typo3.org/view.php?id=13412
+        */
+       public function canParseAndCompileBetweenOperator() {
+               $parseString = '((scheduled BETWEEN 1265068628 AND 1265068828 ) OR scheduled <= 1265068728) AND NOT exec_time AND NOT process_id AND page_id=1 AND parameters_hash = \'854e9a2a77\'';
+               $where = $this->fixture->parseWhereClause($parseString);
+
+               $this->assertTrue(is_array($where), $where);
+               $this->assertTrue(empty($parseString), 'parseString is not empty');
+
+               $whereClause = $this->cleanSql($this->fixture->compileWhereClause($where));
+               $expected = '((scheduled BETWEEN 1265068628 AND 1265068828) OR scheduled <= 1265068728) AND NOT exec_time AND NOT process_id AND page_id = 1 AND parameters_hash = \'854e9a2a77\'';
+               $this->assertEquals($expected, $whereClause);
+       }
+
        ///////////////////////////////////////
        // Tests concerning JOINs
        ///////////////////////////////////////