[TASK] Follow-up: Typo3DbQueryParser must handle LowerCase 64/28764/3
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Tue, 25 Mar 2014 13:38:27 +0000 (14:38 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 25 Mar 2014 14:22:25 +0000 (15:22 +0100)
Add a test for preparse query hash.

Resolves: #57263
Releases: 6.2
Change-Id: Ia524b65f5ef559822c62df1f53c0e78c4750f01e
Reviewed-on: https://review.typo3.org/28764
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/extbase/Tests/Functional/Persistence/QueryParserTest.php

index 2ef7a06..26698a6 100644 (file)
@@ -86,7 +86,7 @@ class QueryParserTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
        /**
         * @test
         */
-       public function preparseQueryHasDiffersForIsNullOperator() {
+       public function preparseQueryHashDiffersForIsNullOperator() {
                $queryWithIsNull = $this->blogRepository->createQuery();
 
                $queryWithIsNull->matching(
@@ -105,4 +105,28 @@ class QueryParserTest extends \TYPO3\CMS\Core\Tests\FunctionalTestCase {
 
                $this->assertNotSame($hashWithIsNull, $hashWithoutIsNull);
        }
+
+
+       /**
+        * @test
+        */
+       public function preparseQueryHashDiffersForEqualsCaseSensitiveArgument() {
+               $queryCaseSensitiveFalse = $this->blogRepository->createQuery();
+
+               $queryCaseSensitiveFalse->matching(
+                       $queryCaseSensitiveFalse->equals('title', 'PoSt1', FALSE)
+               );
+
+               list($hashWithCaseSensitiveFalse) = $this->queryParser->preparseQuery($queryCaseSensitiveFalse);
+
+               $queryCaseSensitiveTrue = $this->blogRepository->createQuery();
+
+               $queryCaseSensitiveTrue->matching(
+                       $queryCaseSensitiveTrue->equals('title', 'PoSt1', TRUE)
+               );
+
+               list($hashWithCaseSensitiveTrue) = $this->queryParser->preparseQuery($queryCaseSensitiveTrue);
+
+               $this->assertNotSame($hashWithCaseSensitiveFalse, $hashWithCaseSensitiveTrue);
+       }
 }