[TASK] Add unit-test for SQL-comparator <>
authorXavier Perseguers <xavier@typo3.org>
Tue, 20 Dec 2011 09:01:26 +0000 (10:01 +0100)
committerXavier Perseguers <xavier@typo3.org>
Tue, 20 Dec 2011 09:01:26 +0000 (10:01 +0100)
A unit test is needed to ensure Core properly supports
the ANSI SQL comparator <>.

Change-Id: I4bdd451fea8341cbc25063fbecad2de67aaf3b20
Relates: #32626
Releases: 4.5, 4.6, 4.7

typo3/sysext/dbal/tests/dbPostgresqlTest.php

index c2b85d0..36a3031 100644 (file)
@@ -228,6 +228,20 @@ class dbPostgresqlTest extends BaseTestCase {
                $expected = 'SELECT * FROM "tt_content" WHERE "bodytext" NOT ILIKE \'test\'';
                $this->assertEquals($expected, $query);
        }
+
+       /**
+        * @test
+        * @see http://forge.typo3.org/issues/32626
+        */
+       public function notEqualAnsiOperatorCanBeParsed() {
+               $query = $this->cleanSql($GLOBALS['TYPO3_DB']->SELECTquery(
+                       '*',
+                       'pages',
+                       'pid<>3'
+               ));
+               $expected = 'SELECT * FROM "pages" WHERE "pid" <> 3';
+               $this->assertEquals($expected, $query);
+       }
 }
 
 ?>
\ No newline at end of file