2 /***************************************************************
5 * (c) 2011 Patrick Schriner <patrick.schriner@diemedialen.de>
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
26 * Testcase for class t3lib_sqlparser.
28 * @author Patrick Schriner <patrick.schriner@diemedialen.de>
33 class t3lib_sqlparserTest
extends tx_phpunit_testcase
{
35 * @var t3lib_sqlparser
39 public function setUp() {
40 $this->fixture
= new t3lib_sqlparser();
43 public function tearDown() {
54 function compileWhereClauseDoesNotDropClauses() {
59 'field' => 'fe_group',
77 'field' => 'fe_group',
84 'field' => 'fe_group',
96 'type' => 'FIND_IN_SET',
102 'field' => 'fe_group',
110 'type' => 'FIND_IN_SET',
116 'field' => 'fe_group',
121 $output = $this->fixture
->compileWhereClause($clauses);
122 $parts = explode(' OR ', $output);
123 $this->assertSame(count($clauses), count($parts));
124 $this->assertContains('IFNULL', $output);