‪TYPO3CMS  9.5
Typo3DbQueryParserTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use Prophecy\Argument;
36 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
37 
38 class ‪Typo3DbQueryParserTest extends UnitTestCase
39 {
43  protected function ‪tearDown()
44  {
45  GeneralUtility::purgeInstances();
46  parent::tearDown();
47  }
48 
53  {
54  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
55  $subject = $this->getAccessibleMock(
56  Typo3DbQueryParser::class,
57  // Shut down some methods not important for this test
58  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints']
59  );
60  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
61  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
62 
63  $queryProphecy = $this->prophesize(QueryInterface::class);
64  $sourceProphecy = $this->prophesize(SourceInterface::class);
65  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
66  $queryProphecy->getOrderings()->willReturn([]);
67  $queryProphecy->getStatement()->willReturn(null);
68 
69  // Test part: getConstraint returns no constraint object, andWhere() should not be called
70  $queryProphecy->getConstraint()->willReturn(null);
71  $queryBuilderProphecy->andWhere()->shouldNotBeCalled();
72 
73  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
74  }
75 
80  {
81  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
82  $subject = $this->getAccessibleMock(
83  Typo3DbQueryParser::class,
84  // Shut down some methods not important for this test
85  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
86  );
87  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
88  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
89 
90  $queryProphecy = $this->prophesize(QueryInterface::class);
91  $sourceProphecy = $this->prophesize(SourceInterface::class);
92  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
93  $queryProphecy->getOrderings()->willReturn([]);
94  $queryProphecy->getStatement()->willReturn(null);
95 
96  // Test part: getConstraint returns not implemented object
97  $constraintProphecy = $this->prophesize(ConstraintInterface::class);
98  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
99 
100  $this->expectException(\RuntimeException::class);
101  $this->expectExceptionCode(1476199898);
102  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
103  }
104 
109  {
110  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
111  $subject = $this->getAccessibleMock(
112  Typo3DbQueryParser::class,
113  // Shut down some methods not important for this test
114  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
115  );
116  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
117  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
118 
119  $queryProphecy = $this->prophesize(QueryInterface::class);
120  $sourceProphecy = $this->prophesize(SourceInterface::class);
121  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
122  $queryProphecy->getOrderings()->willReturn([]);
123  $queryProphecy->getStatement()->willReturn(null);
124 
125  // Test part: getConstraint returns simple constraint, and should push to andWhere()
126  $constraintProphecy = $this->prophesize(ComparisonInterface::class);
127  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
128  $subject->expects($this->once())->method('parseComparison')->willReturn('heinz');
129  $queryBuilderProphecy->andWhere('heinz')->shouldBeCalled();
130 
131  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
132  }
133 
138  {
139  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
140  $subject = $this->getAccessibleMock(
141  Typo3DbQueryParser::class,
142  // Shut down some methods not important for this test
143  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
144  );
145  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
146  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
147 
148  $queryProphecy = $this->prophesize(QueryInterface::class);
149  $sourceProphecy = $this->prophesize(SourceInterface::class);
150  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
151  $queryProphecy->getOrderings()->willReturn([]);
152  $queryProphecy->getStatement()->willReturn(null);
153 
154  $constraintProphecy = $this->prophesize(NotInterface::class);
155  $subConstraintProphecy = $this->prophesize(ComparisonInterface::class);
156  $constraintProphecy->getConstraint()->shouldBeCalled()->willReturn($subConstraintProphecy->reveal());
157  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
158  $subject->expects($this->once())->method('parseComparison')->willReturn('heinz');
159  $queryBuilderProphecy->andWhere(' NOT(heinz)')->shouldBeCalled();
160 
161  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
162  }
163 
168  {
169  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
170  $subject = $this->getAccessibleMock(
171  Typo3DbQueryParser::class,
172  // Shut down some methods not important for this test
173  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
174  );
175  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
176  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
177 
178  $queryProphecy = $this->prophesize(QueryInterface::class);
179  $sourceProphecy = $this->prophesize(SourceInterface::class);
180  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
181  $queryProphecy->getOrderings()->willReturn([]);
182  $queryProphecy->getStatement()->willReturn(null);
183 
184  $constraintProphecy = $this->prophesize(AndInterface::class);
185  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
186  $constraint1Prophecy = $this->prophesize(ComparisonInterface::class);
187  $constraintProphecy->getConstraint1()->willReturn($constraint1Prophecy->reveal());
188  $constraint2Prophecy = $this->prophesize(ComparisonInterface::class);
189  $constraintProphecy->getConstraint2()->willReturn($constraint2Prophecy->reveal());
190  $subject->expects($this->any())->method('parseComparison')->willReturn('heinz');
191  $expressionProphecy = $this->prophesize(ExpressionBuilder::class);
192  $queryBuilderProphecy->expr()->shouldBeCalled()->willReturn($expressionProphecy->reveal());
193  $compositeExpressionProphecy = $this->prophesize(CompositeExpression::class);
194  $compositeExpressionProphecy->__toString()->willReturn('heinz AND heinz');
195  $compositeExpressionRevelation = $compositeExpressionProphecy->reveal();
196  $expressionProphecy->andX('heinz', 'heinz')->shouldBeCalled()->willReturn($compositeExpressionRevelation);
197  $queryBuilderProphecy->andWhere($compositeExpressionRevelation)->shouldBeCalled();
198 
199  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
200  }
201 
206  {
207  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
208  $subject = $this->getAccessibleMock(
209  Typo3DbQueryParser::class,
210  // Shut down some methods not important for this test
211  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
212  );
213  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
214  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
215 
216  $queryProphecy = $this->prophesize(QueryInterface::class);
217  $sourceProphecy = $this->prophesize(SourceInterface::class);
218  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
219  $queryProphecy->getOrderings()->willReturn([]);
220  $queryProphecy->getStatement()->willReturn(null);
221 
222  $constraintProphecy = $this->prophesize(AndInterface::class);
223  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
224  $constraint1Prophecy = $this->prophesize(ComparisonInterface::class);
225  $constraintProphecy->getConstraint1()->willReturn($constraint1Prophecy->reveal());
226  // no result for constraint2
227  $constraintProphecy->getConstraint2()->willReturn(null);
228 
229  // not be called
230  $queryBuilderProphecy->andWhere()->shouldNotBeCalled();
231 
232  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
233  }
234 
239  {
240  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
241  $subject = $this->getAccessibleMock(
242  Typo3DbQueryParser::class,
243  // Shut down some methods not important for this test
244  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
245  );
246  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
247  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
248 
249  $queryProphecy = $this->prophesize(QueryInterface::class);
250  $sourceProphecy = $this->prophesize(SourceInterface::class);
251  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
252  $queryProphecy->getOrderings()->willReturn([]);
253  $queryProphecy->getStatement()->willReturn(null);
254 
255  $constraintProphecy = $this->prophesize(OrInterface::class);
256  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
257  $constraint1Prophecy = $this->prophesize(ComparisonInterface::class);
258  $constraintProphecy->getConstraint1()->willReturn($constraint1Prophecy->reveal());
259  $constraint2Prophecy = $this->prophesize(ComparisonInterface::class);
260  $constraintProphecy->getConstraint2()->willReturn($constraint2Prophecy->reveal());
261  $subject->expects($this->any())->method('parseComparison')->willReturn('heinz');
262  $expressionProphecy = $this->prophesize(ExpressionBuilder::class);
263  $queryBuilderProphecy->expr()->shouldBeCalled()->willReturn($expressionProphecy->reveal());
264  $compositeExpressionProphecy = $this->prophesize(CompositeExpression::class);
265  $compositeExpressionProphecy->__toString()->willReturn('heinz OR heinz');
266  $compositeExpressionRevelation = $compositeExpressionProphecy->reveal();
267  $expressionProphecy->orX('heinz', 'heinz')->shouldBeCalled()->willReturn($compositeExpressionRevelation);
268  $queryBuilderProphecy->andWhere($compositeExpressionRevelation)->shouldBeCalled();
269 
270  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
271  }
272 
277  {
278  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
279  $subject = $this->getAccessibleMock(
280  Typo3DbQueryParser::class,
281  // Shut down some methods not important for this test
282  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
283  );
284  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
285  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
286 
287  $queryProphecy = $this->prophesize(QueryInterface::class);
288  $sourceProphecy = $this->prophesize(SourceInterface::class);
289  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
290  $queryProphecy->getOrderings()->willReturn([]);
291  $queryProphecy->getStatement()->willReturn(null);
292 
293  $constraintProphecy = $this->prophesize(OrInterface::class);
294  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
295  $constraint1Prophecy = $this->prophesize(ComparisonInterface::class);
296  $constraintProphecy->getConstraint1()->willReturn($constraint1Prophecy->reveal());
297  // no result for constraint2
298  $constraintProphecy->getConstraint2()->willReturn(null);
299 
300  // not be called
301  $queryBuilderProphecy->andWhere()->shouldNotBeCalled();
302 
303  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
304  }
305 
310  {
311  $connectionProphet = $this->prophesize(Connection::class);
312  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
313  $querBuilderProphet = $this->prophesize(QueryBuilder::class, $connectionProphet->reveal());
314  $expr = GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal());
315  $querBuilderProphet->expr()->willReturn($expr);
316  return $querBuilderProphet;
317  }
318 
323  {
324  $connectionProphet = $this->prophesize(Connection::class);
325  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
326  $queryBuilderProphet = $this->prophesize(QueryBuilder::class, $connectionProphet->reveal());
327  $expr = GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal());
328  $queryBuilderProphet->expr()->willReturn(
329  $expr
330  );
331  $queryBuilderProphet->getConnection()->willReturn($connectionProphet->reveal());
332  $queryBuilderForSubselectMock = $this->getMockBuilder(QueryBuilder::class)
333  ->setMethods(['expr', 'unquoteSingleIdentifier'])
334  ->setConstructorArgs([$connectionProphet->reveal()])
335  ->getMock();
336  $connectionProphet->createQueryBuilder()->willReturn($queryBuilderForSubselectMock);
337  $queryBuilderForSubselectMock->expects($this->any())->method('expr')->will($this->returnValue($expr));
338  $queryBuilderForSubselectMock->expects($this->any())->method('unquoteSingleIdentifier')->will($this->returnCallback(function ($identifier) {
339  return $identifier;
340  }));
341  return $queryBuilderProphet;
342  }
343 
348  {
349  $table = $this->getUniqueId('tx_coretest_table');
350  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
351  'languageField' => 'sys_language_uid'
352  ];
354  $querySettings = $this->createMock(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Typo3QuerySettings::class);
355  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
356  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
357  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
358  $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
359  $expectedSql = $table . '.sys_language_uid IN (0, -1)';
360  $this->assertSame($expectedSql, $sql);
361  }
362 
367  {
368  $table = $this->getUniqueId('tx_coretest_table');
369  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
370  'languageField' => 'sys_language_uid'
371  ];
373  $querySettings = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Typo3QuerySettings::class)
374  ->setMethods(['dummy'])
375  ->getMock();
376  $querySettings->setLanguageUid('1');
377  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
378  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
379  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
380  $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
381  $result = $table . '.sys_language_uid IN (1, -1)';
382  $this->assertSame($result, $sql);
383  }
384 
389  {
390  $table = $this->getUniqueId('tx_coretest_table');
391  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
392  'languageField' => 'sys_language_uid'
393  ];
394  $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
395  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
396  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
397  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
398  $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
399  $expectedSql = $table . '.sys_language_uid IN (0, -1)';
400  $this->assertSame($expectedSql, $sql);
401  }
402 
407  {
408  $table = $this->getUniqueId('tx_coretest_table');
409  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
410  'languageField' => 'sys_language_uid',
411  'delete' => 'deleted'
412  ];
413  $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
414  $querySettings->setLanguageUid(0);
415  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
416  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
417  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
418  $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
419  $expectedSql = $table . '.sys_language_uid IN (0, -1)';
420  $this->assertSame($expectedSql, $sql);
421  }
422 
427  {
428  $table = $this->getUniqueId('tx_coretest_table');
429  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
430  'languageField' => 'sys_language_uid'
431  ];
432  $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
433  $querySettings->setLanguageUid(2);
434  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
435  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
436  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
437  $sql = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
438  $expectedSql = $table . '.sys_language_uid IN (2, -1)';
439  $this->assertSame($expectedSql, $sql);
440  }
441 
446  {
447  $table = $this->getUniqueId('tx_coretest_table');
448  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
449  'languageField' => 'sys_language_uid',
450  'transOrigPointerField' => 'l10n_parent'
451  ];
452  $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
453  $querySettings->setLanguageUid(2);
454  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
455 
456  $queryBuilderProphet = $this->‪getQueryBuilderProphetWithQueryBuilderForSubselect();
457 
458  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
459 
460  $compositeExpression = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
461  $expectedSql = '(' . $table . '.sys_language_uid IN (2, -1)) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '.l10n_parent FROM ' . $table . ' WHERE (' . $table . '.l10n_parent > 0) AND (' . $table . '.sys_language_uid = 2))))';
462  $this->assertSame($expectedSql, $compositeExpression->__toString());
463  }
464 
469  {
470  $table = $this->getUniqueId('tx_coretest_table');
471  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
472  'languageField' => 'sys_language_uid',
473  'transOrigPointerField' => 'l10n_parent',
474  'delete' => 'deleted'
475  ];
476  $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
477  $querySettings->setLanguageUid(2);
478  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
479  $queryBuilderProphet = $this->‪getQueryBuilderProphetWithQueryBuilderForSubselect();
480  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
481  $compositeExpression= $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
482  $expectedSql = '(' . $table . '.sys_language_uid IN (2, -1))' .
483  ' OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (' .
484  'SELECT ' . $table . '.l10n_parent FROM ' . $table .
485  ' WHERE (' . $table . '.l10n_parent > 0) AND (' .
486  $table . '.sys_language_uid = 2) AND (' .
487  $table . '.deleted = 0))))';
488  $this->assertSame($expectedSql, $compositeExpression->__toString());
489  }
490 
495  {
496  $table = 'tt_content';
497  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
498  'languageField' => 'sys_language_uid',
499  'transOrigPointerField' => 'l10n_parent',
500  'delete' => 'deleted'
501  ];
502  $querySettings = new \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings();
503  $querySettings->setLanguageUid(2);
504  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
505 
506  $queryBuilderProphet = $this->‪getQueryBuilderProphetWithQueryBuilderForSubselect();
507 
508  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
509  $compositeExpression = $mockTypo3DbQueryParser->_callRef('getSysLanguageStatement', $table, $table, $querySettings);
510  $expectedSql = '(' . $table . '.sys_language_uid IN (2, -1))' .
511  ' OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (' .
512  'SELECT ' . $table . '.l10n_parent FROM ' . $table .
513  ' WHERE (' . $table . '.l10n_parent > 0) AND (' .
514  $table . '.sys_language_uid = 2) AND (' .
515  $table . '.deleted = 0))))';
516  $this->assertSame($expectedSql, $compositeExpression->__toString());
517  }
518 
523  {
524  $mockSource = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Qom\Selector::class)
525  ->setMethods(['getNodeTypeName'])
526  ->disableOriginalConstructor()
527  ->getMock();
528  $mockSource->expects($this->any())->method('getNodeTypeName')->will($this->returnValue('foo'));
529  $mockDataMapper = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\DataMapper::class)
530  ->setMethods(['convertPropertyNameToColumnName', 'convertClassNameToTableName'])
531  ->disableOriginalConstructor()
532  ->getMock();
533  $mockDataMapper->expects($this->once())->method('convertClassNameToTableName')->with('foo')->will($this->returnValue('tx_myext_tablename'));
534  $mockDataMapper->expects($this->once())->method('convertPropertyNameToColumnName')->with('fooProperty', 'foo')->will($this->returnValue('converted_fieldname'));
535  $queryBuilderProphet = $this->prophesize(QueryBuilder::class);
536  $queryBuilderProphet->addOrderBy('tx_myext_tablename.converted_fieldname', 'ASC')->shouldBeCalledTimes(1);
537 
538  $orderings = ['fooProperty' => ‪QueryInterface::ORDER_ASCENDING];
539  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
540  $mockTypo3DbQueryParser->_set('dataMapper', $mockDataMapper);
541  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
542  $mockTypo3DbQueryParser->_callRef('parseOrderings', $orderings, $mockSource);
543  }
544 
549  {
550  $this->expectException(UnsupportedOrderException::class);
551  $this->expectExceptionCode(1242816074);
552  $mockSource = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Qom\Selector::class)
553  ->setMethods(['getNodeTypeName'])
554  ->disableOriginalConstructor()
555  ->getMock();
556  $mockSource->expects($this->never())->method('getNodeTypeName');
557  $mockDataMapper = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\DataMapper::class)
558  ->setMethods(['convertPropertyNameToColumnName', 'convertClassNameToTableName'])
559  ->disableOriginalConstructor()
560  ->getMock();
561  $mockDataMapper->expects($this->never())->method('convertClassNameToTableName');
562  $mockDataMapper->expects($this->never())->method('convertPropertyNameToColumnName');
563  $orderings = ['fooProperty' => 'unsupported_order'];
564  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
565  $mockTypo3DbQueryParser->_set('dataMapper', $mockDataMapper);
566 
567  $mockTypo3DbQueryParser->_callRef('parseOrderings', $orderings, $mockSource);
568  }
569 
574  {
575  $mockSource = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Qom\Selector::class)
576  ->setMethods(['getNodeTypeName'])
577  ->disableOriginalConstructor()
578  ->getMock();
579  $mockSource->expects($this->any())->method('getNodeTypeName')->will($this->returnValue('Tx_MyExt_ClassName'));
580  $mockDataMapper = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Mapper\DataMapper::class)
581  ->setMethods(['convertPropertyNameToColumnName', 'convertClassNameToTableName'])
582  ->disableOriginalConstructor()
583  ->getMock();
584  $mockDataMapper->expects($this->any())->method('convertClassNameToTableName')->with('Tx_MyExt_ClassName')->will($this->returnValue('tx_myext_tablename'));
585  $mockDataMapper->expects($this->any())->method('convertPropertyNameToColumnName')->will($this->returnValue('converted_fieldname'));
586  $orderings = [
587  'fooProperty' => ‪QueryInterface::ORDER_ASCENDING,
588  'barProperty' => ‪QueryInterface::ORDER_DESCENDING
589  ];
590  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
591  $mockTypo3DbQueryParser->_set('dataMapper', $mockDataMapper);
592 
593  $queryBuilder = $this->getMockBuilder(QueryBuilder::class)
594  ->disableOriginalConstructor()
595  ->setMethods(['addOrderBy'])
596  ->getMock();
597  $queryBuilder->expects($this->at(0))->method('addOrderBy')->with('tx_myext_tablename.converted_fieldname', 'ASC');
598  $queryBuilder->expects($this->at(1))->method('addOrderBy')->with('tx_myext_tablename.converted_fieldname', 'DESC');
599 
600  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilder);
601  $mockTypo3DbQueryParser->_callRef('parseOrderings', $orderings, $mockSource);
602  }
603 
605  {
606  return [
607  'in be: include all' => ['BE', true, [], true, ''],
608  'in be: ignore enable fields but do not include deleted' => ['BE', true, [], false, 'tx_foo_table.deleted_column=0'],
609  'in be: respect enable fields but include deleted' => ['BE', false, [], true, '(tx_foo_table.disabled_column = 0) AND (tx_foo_table.starttime_column <= 1451779200)'],
610  'in be: respect enable fields and do not include deleted' => ['BE', false, [], false, '(tx_foo_table.disabled_column = 0) AND (tx_foo_table.starttime_column <= 1451779200) AND tx_foo_table.deleted_column=0'],
611  'in fe: include all' => ['FE', true, [], true, ''],
612  'in fe: ignore enable fields but do not include deleted' => ['FE', true, [], false, 'tx_foo_table.deleted_column=0'],
613  'in fe: ignore only starttime and do not include deleted' => ['FE', true, ['starttime'], false, '(tx_foo_table.deleted_column = 0) AND (tx_foo_table.disabled_column = 0)'],
614  'in fe: respect enable fields and do not include deleted' => ['FE', false, [], false, '(tx_foo_table.deleted_column = 0) AND (tx_foo_table.disabled_column = 0) AND (tx_foo_table.starttime_column <= 1451779200)']
615  ];
616  }
617 
622  public function ‪visibilityConstraintStatementIsGeneratedAccordingToTheQuerySettings($mode, $ignoreEnableFields, $enableFieldsToBeIgnored, $deletedValue, $expectedSql)
623  {
624  $tableName = 'tx_foo_table';
625  ‪$GLOBALS['TCA'][$tableName]['ctrl'] = [
626  'enablecolumns' => [
627  'disabled' => 'disabled_column',
628  'starttime' => 'starttime_column'
629  ],
630  'delete' => 'deleted_column'
631  ];
632  // simulate time for backend enable fields
633  ‪$GLOBALS['SIM_ACCESS_TIME'] = 1451779200;
634  // simulate time for frontend (PageRepository) enable fields
635  $dateAspect = new ‪DateTimeAspect(new \DateTimeImmutable('@1451779200'));
636  $context = new ‪Context(['date' => $dateAspect]);
637  GeneralUtility::setSingletonInstance(Context::class, $context);
638 
639  $connectionProphet = $this->prophesize(Connection::class);
640  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
641  $connectionProphet->getExpressionBuilder()->willReturn(
642  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
643  );
644 
645  $queryBuilderProphet = $this->prophesize(QueryBuilder::class);
646  $queryBuilderProphet->expr()->willReturn(
647  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
648  );
649  $queryBuilderProphet->createNamedParameter(Argument::cetera())->willReturnArgument(0);
650 
651  $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
652  $connectionPoolProphet->getConnectionForTable(Argument::any($tableName, 'pages'))->willReturn($connectionProphet->reveal());
653  $connectionPoolProphet->getQueryBuilderForTable(Argument::any($tableName, 'pages'))->willReturn($queryBuilderProphet->reveal());
654  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
655  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
656 
657  $mockQuerySettings = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Typo3QuerySettings::class)
658  ->setMethods(['getIgnoreEnableFields', 'getEnableFieldsToBeIgnored', 'getIncludeDeleted'])
659  ->disableOriginalConstructor()
660  ->getMock();
661  $mockQuerySettings->expects($this->once())->method('getIgnoreEnableFields')->will($this->returnValue($ignoreEnableFields));
662  $mockQuerySettings->expects($this->once())->method('getEnableFieldsToBeIgnored')->will($this->returnValue($enableFieldsToBeIgnored));
663  $mockQuerySettings->expects($this->once())->method('getIncludeDeleted')->will($this->returnValue($deletedValue));
664 
666  $mockEnvironmentService = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Service\EnvironmentService::class)
667  ->setMethods(['isEnvironmentInFrontendMode'])
668  ->getMock();
669  $mockEnvironmentService->expects($this->any())->method('isEnvironmentInFrontendMode')->will($this->returnValue($mode === 'FE'));
670 
671  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
672  $mockTypo3DbQueryParser->_set('environmentService', $mockEnvironmentService);
673  $resultSql = $mockTypo3DbQueryParser->_callRef('getVisibilityConstraintStatement', $mockQuerySettings, $tableName, $tableName);
674  $this->assertSame($expectedSql, $resultSql);
675  unset(‪$GLOBALS['TCA'][$tableName]);
676  }
677 
679  {
680  return [
681  'in be: respectEnableFields=false' => ['BE', false, ''],
682  'in be: respectEnableFields=true' => ['BE', true, '(tx_foo_table.disabled_column = 0) AND (tx_foo_table.starttime_column <= 1451779200) AND tx_foo_table.deleted_column=0'],
683  'in FE: respectEnableFields=false' => ['FE', false, ''],
684  'in FE: respectEnableFields=true' => ['FE', true, '(tx_foo_table.deleted_column = 0) AND (tx_foo_table.disabled_column = 0) AND (tx_foo_table.starttime_column <= 1451779200)']
685  ];
686  }
687 
692  public function ‪respectEnableFieldsSettingGeneratesCorrectStatement($mode, $respectEnableFields, $expectedSql)
693  {
694  $tableName = 'tx_foo_table';
695  ‪$GLOBALS['TCA'][$tableName]['ctrl'] = [
696  'enablecolumns' => [
697  'disabled' => 'disabled_column',
698  'starttime' => 'starttime_column'
699  ],
700  'delete' => 'deleted_column'
701  ];
702  // simulate time for backend enable fields
703  ‪$GLOBALS['SIM_ACCESS_TIME'] = 1451779200;
704  // simulate time for frontend (PageRepository) enable fields
705  $dateAspect = new ‪DateTimeAspect(new \DateTimeImmutable('@1451779200'));
706  $context = new ‪Context(['date' => $dateAspect]);
707  GeneralUtility::setSingletonInstance(Context::class, $context);
708 
709  $connectionProphet = $this->prophesize(Connection::class);
710  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
711  $connectionProphet->getExpressionBuilder(Argument::cetera())->willReturn(
712  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
713  );
714  $queryBuilderProphet = $this->prophesize(QueryBuilder::class);
715  $queryBuilderProphet->expr()->willReturn(
716  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
717  );
718  $queryBuilderProphet->createNamedParameter(Argument::cetera())->willReturnArgument(0);
719 
720  $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
721  $connectionPoolProphet->getQueryBuilderForTable(Argument::any($tableName, 'pages'))->willReturn($queryBuilderProphet->reveal());
722  $connectionPoolProphet->getConnectionForTable(Argument::any($tableName, 'pages'))->willReturn($connectionProphet->reveal());
723  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
724  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
725 
727  $mockQuerySettings = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Typo3QuerySettings::class)
728  ->setMethods(['dummy'])
729  ->disableOriginalConstructor()
730  ->getMock();
731  $mockQuerySettings->setIgnoreEnableFields(!$respectEnableFields);
732  $mockQuerySettings->setIncludeDeleted(!$respectEnableFields);
733 
735  $mockEnvironmentService = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Service\EnvironmentService::class)
736  ->setMethods(['isEnvironmentInFrontendMode'])
737  ->getMock();
738  $mockEnvironmentService->expects($this->any())->method('isEnvironmentInFrontendMode')->will($this->returnValue($mode === 'FE'));
739 
740  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
741  $mockTypo3DbQueryParser->_set('environmentService', $mockEnvironmentService);
742  $actualSql = $mockTypo3DbQueryParser->_callRef('getVisibilityConstraintStatement', $mockQuerySettings, $tableName, $tableName);
743  $this->assertSame($expectedSql, $actualSql);
744  unset(‪$GLOBALS['TCA'][$tableName]);
745  }
746 
751  {
752  $this->expectException(InconsistentQuerySettingsException::class);
753  $this->expectExceptionCode(1460975922);
754  $tableName = 'tx_foo_table';
755  ‪$GLOBALS['TCA'][$tableName]['ctrl'] = [
756  'enablecolumns' => [
757  'disabled' => 'disabled_column'
758  ],
759  'delete' => 'deleted_column'
760  ];
761  $mockQuerySettings = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Persistence\Generic\Typo3QuerySettings::class)
762  ->setMethods(['getIgnoreEnableFields', 'getEnableFieldsToBeIgnored', 'getIncludeDeleted'])
763  ->disableOriginalConstructor()
764  ->getMock();
765  $mockQuerySettings->expects($this->once())->method('getIgnoreEnableFields')->will($this->returnValue(false));
766  $mockQuerySettings->expects($this->once())->method('getEnableFieldsToBeIgnored')->will($this->returnValue([]));
767  $mockQuerySettings->expects($this->once())->method('getIncludeDeleted')->will($this->returnValue(true));
768 
770  $mockEnvironmentService = $this->getMockBuilder(\‪TYPO3\CMS\‪Extbase\Service\EnvironmentService::class)
771  ->setMethods(['isEnvironmentInFrontendMode'])
772  ->getMock();
773  $mockEnvironmentService->expects($this->any())->method('isEnvironmentInFrontendMode')->will($this->returnValue(true));
774 
775  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
776  $mockTypo3DbQueryParser->_set('environmentService', $mockEnvironmentService);
777  $mockTypo3DbQueryParser->_callRef('getVisibilityConstraintStatement', $mockQuerySettings, $tableName, $tableName);
778  unset(‪$GLOBALS['TCA'][$tableName]);
779  }
780 
785  {
786  $table = $this->getUniqueId('tx_coretest_table');
787  return [
788  'set Pid to zero if rootLevel = 1' => [
789  '1',
790  $table,
791  $table . '.pid = 0'
792  ],
793  'set Pid to given Pids if rootLevel = 0' => [
794  '0',
795  $table,
796  $table . '.pid IN (42, 27)'
797  ],
798  'add 0 to given Pids if rootLevel = -1' => [
799  '-1',
800  $table,
801  $table . '.pid IN (42, 27, 0)'
802  ],
803  'set Pid to zero if rootLevel = -1 and no further pids given' => [
804  '-1',
805  $table,
806  $table . '.pid = 0',
807  []
808  ],
809  'set no statement for invalid configuration' => [
810  '2',
811  $table,
812  ''
813  ]
814  ];
815  }
816 
821  public function ‪addPageIdStatementSetsPidToZeroIfTableDeclaresRootlevel($rootLevel, $table, $expectedSql, $storagePageIds = [42, 27])
822  {
823  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
824  'rootLevel' => $rootLevel
825  ];
826  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
827  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
828  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
829  $sql = $mockTypo3DbQueryParser->_callRef('getPageIdStatement', $table, $table, $storagePageIds);
830 
831  $this->assertSame($expectedSql, $sql);
832  }
833 }
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksForNonDefaultLanguage
‪addSysLanguageStatementWorksForNonDefaultLanguage()
Definition: Typo3DbQueryParserTest.php:366
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderThrowsExceptionOnNotImplementedConstraint
‪convertQueryToDoctrineQueryBuilderThrowsExceptionOnNotImplementedConstraint()
Definition: Typo3DbQueryParserTest.php:79
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:33
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extbase\Persistence\QueryInterface
Definition: QueryInterface.php:26
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addPageIdStatementSetsPidToZeroIfTableDeclaresRootlevel
‪addPageIdStatementSetsPidToZeroIfTableDeclaresRootlevel($rootLevel, $table, $expectedSql, $storagePageIds=[42, 27])
Definition: Typo3DbQueryParserTest.php:821
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksForDefaultLanguage
‪addSysLanguageStatementWorksForDefaultLanguage()
Definition: Typo3DbQueryParserTest.php:347
‪TYPO3
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksForForeignLanguageWithSubselectionTakesDeleteStatementIntoAccountIfNecessary
‪addSysLanguageStatementWorksForForeignLanguageWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
Definition: Typo3DbQueryParserTest.php:468
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderNotAddsInvalidOrConstraint
‪convertQueryToDoctrineQueryBuilderNotAddsInvalidOrConstraint()
Definition: Typo3DbQueryParserTest.php:276
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\tearDown
‪tearDown()
Definition: Typo3DbQueryParserTest.php:43
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksForDefaultLanguageWithoutDeleteStatementReturned
‪addSysLanguageStatementWorksForDefaultLanguageWithoutDeleteStatementReturned()
Definition: Typo3DbQueryParserTest.php:406
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsSimpleAndWhere
‪convertQueryToDoctrineQueryBuilderAddsSimpleAndWhere()
Definition: Typo3DbQueryParserTest.php:108
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\ORDER_DESCENDING
‪const ORDER_DESCENDING
Definition: QueryInterface.php:96
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderNotAddsInvalidAndConstraint
‪convertQueryToDoctrineQueryBuilderNotAddsInvalidAndConstraint()
Definition: Typo3DbQueryParserTest.php:205
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\respectEnableFieldsSettingGeneratesCorrectStatement
‪respectEnableFieldsSettingGeneratesCorrectStatement($mode, $respectEnableFields, $expectedSql)
Definition: Typo3DbQueryParserTest.php:692
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface
Definition: SourceInterface.php:21
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsOrConstraint
‪convertQueryToDoctrineQueryBuilderAddsOrConstraint()
Definition: Typo3DbQueryParserTest.php:238
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage
Definition: Typo3DbBackendTest.php:2
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsAndConstraint
‪convertQueryToDoctrineQueryBuilderAddsAndConstraint()
Definition: Typo3DbQueryParserTest.php:167
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface
Definition: OrInterface.php:26
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:49
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\orderStatementGenerationThrowsExceptionOnUnsupportedOrder
‪orderStatementGenerationThrowsExceptionOnUnsupportedOrder()
Definition: Typo3DbQueryParserTest.php:548
‪TYPO3\CMS\Core\Database\Query\QueryBuilder
Definition: QueryBuilder.php:47
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksInBackendContextWithNoGlobalTypoScriptFrontendControllerAvailable
‪addSysLanguageStatementWorksInBackendContextWithNoGlobalTypoScriptFrontendControllerAvailable()
Definition: Typo3DbQueryParserTest.php:388
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\getQueryBuilderProphetWithQueryBuilderForSubselect
‪Prophecy Prophecy ObjectProphecy getQueryBuilderProphetWithQueryBuilderForSubselect()
Definition: Typo3DbQueryParserTest.php:322
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksInBackendContextWithSubselectionTakesDeleteStatementIntoAccountIfNecessary
‪addSysLanguageStatementWorksInBackendContextWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
Definition: Typo3DbQueryParserTest.php:494
‪TYPO3\CMS\Extbase\Persistence\Generic\Exception\InconsistentQuerySettingsException
Definition: InconsistentQuerySettingsException.php:21
‪TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression
Definition: CompositeExpression.php:23
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\ORDER_ASCENDING
‪const ORDER_ASCENDING
Definition: QueryInterface.php:95
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\providerForRespectEnableFields
‪providerForRespectEnableFields()
Definition: Typo3DbQueryParserTest.php:678
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\providerForAddPageIdStatementData
‪providerForAddPageIdStatementData()
Definition: Typo3DbQueryParserTest.php:784
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface
Definition: ComparisonInterface.php:61
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\visibilityConstraintStatementGenerationThrowsExceptionIfTheQuerySettingsAreInconsistent
‪visibilityConstraintStatementGenerationThrowsExceptionIfTheQuerySettingsAreInconsistent()
Definition: Typo3DbQueryParserTest.php:750
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface
Definition: NotInterface.php:23
‪TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnsupportedOrderException
Definition: UnsupportedOrderException.php:21
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:31
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\providerForVisibilityConstraintStatement
‪providerForVisibilityConstraintStatement()
Definition: Typo3DbQueryParserTest.php:604
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksForForeignLanguageWithoutSubselection
‪addSysLanguageStatementWorksForForeignLanguageWithoutSubselection()
Definition: Typo3DbQueryParserTest.php:426
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\visibilityConstraintStatementIsGeneratedAccordingToTheQuerySettings
‪visibilityConstraintStatementIsGeneratedAccordingToTheQuerySettings($mode, $ignoreEnableFields, $enableFieldsToBeIgnored, $deletedValue, $expectedSql)
Definition: Typo3DbQueryParserTest.php:622
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\getQueryBuilderWithExpressionBuilderProphet
‪Prophecy Prophecy ObjectProphecy getQueryBuilderWithExpressionBuilderProphet()
Definition: Typo3DbQueryParserTest.php:309
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface
Definition: ConstraintInterface.php:24
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\orderStatementGenerationWorks
‪orderStatementGenerationWorks()
Definition: Typo3DbQueryParserTest.php:522
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest
Definition: Typo3DbQueryParserTest.php:39
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:44
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\orderStatementGenerationWorksWithMultipleOrderings
‪orderStatementGenerationWorksWithMultipleOrderings()
Definition: Typo3DbQueryParserTest.php:573
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Context\DateTimeAspect
Definition: DateTimeAspect.php:33
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface
Definition: AndInterface.php:24
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsNotConstraint
‪convertQueryToDoctrineQueryBuilderAddsNotConstraint()
Definition: Typo3DbQueryParserTest.php:137
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderDoesNotAddAndWhereWithEmptyConstraint
‪convertQueryToDoctrineQueryBuilderDoesNotAddAndWhereWithEmptyConstraint()
Definition: Typo3DbQueryParserTest.php:52
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addSysLanguageStatementWorksForForeignLanguageWithSubselectionWithoutDeleteStatementReturned
‪addSysLanguageStatementWorksForForeignLanguageWithSubselectionWithoutDeleteStatementReturned()
Definition: Typo3DbQueryParserTest.php:445
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser
Definition: Typo3DbQueryParser.php:48