‪TYPO3CMS  10.4
Typo3DbQueryParserTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use Prophecy\Argument;
42 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
43 
44 class ‪Typo3DbQueryParserTest extends UnitTestCase
45 {
49  protected function ‪tearDown(): void
50  {
51  GeneralUtility::purgeInstances();
52  parent::tearDown();
53  }
54 
59  {
60  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
61  $subject = $this->getAccessibleMock(
62  Typo3DbQueryParser::class,
63  // Shut down some methods not important for this test
64  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints']
65  );
66  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
67  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
68 
69  $queryProphecy = $this->prophesize(QueryInterface::class);
70  $sourceProphecy = $this->prophesize(SourceInterface::class);
71  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
72  $queryProphecy->getOrderings()->willReturn([]);
73  $queryProphecy->getStatement()->willReturn(null);
74 
75  // Test part: getConstraint returns no constraint object, andWhere() should not be called
76  $queryProphecy->getConstraint()->willReturn(null);
77  $queryBuilderProphecy->andWhere()->shouldNotBeCalled();
78 
79  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
80  }
81 
86  {
87  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
88  $subject = $this->getAccessibleMock(
89  Typo3DbQueryParser::class,
90  // Shut down some methods not important for this test
91  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
92  );
93  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
94  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
95 
96  $queryProphecy = $this->prophesize(QueryInterface::class);
97  $sourceProphecy = $this->prophesize(SourceInterface::class);
98  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
99  $queryProphecy->getOrderings()->willReturn([]);
100  $queryProphecy->getStatement()->willReturn(null);
101 
102  // Test part: getConstraint returns not implemented object
103  $constraintProphecy = $this->prophesize(ConstraintInterface::class);
104  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
105 
106  $this->expectException(\RuntimeException::class);
107  $this->expectExceptionCode(1476199898);
108  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
109  }
110 
115  {
116  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
117  $subject = $this->getAccessibleMock(
118  Typo3DbQueryParser::class,
119  // Shut down some methods not important for this test
120  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
121  );
122  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
123  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
124 
125  $queryProphecy = $this->prophesize(QueryInterface::class);
126  $sourceProphecy = $this->prophesize(SourceInterface::class);
127  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
128  $queryProphecy->getOrderings()->willReturn([]);
129  $queryProphecy->getStatement()->willReturn(null);
130 
131  // Test part: getConstraint returns simple constraint, and should push to andWhere()
132  $constraintProphecy = $this->prophesize(ComparisonInterface::class);
133  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
134  $subject->expects(self::once())->method('parseComparison')->willReturn('heinz');
135  $queryBuilderProphecy->andWhere('heinz')->shouldBeCalled();
136 
137  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
138  }
139 
144  {
145  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
146  $subject = $this->getAccessibleMock(
147  Typo3DbQueryParser::class,
148  // Shut down some methods not important for this test
149  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
150  );
151  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
152  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
153 
154  $queryProphecy = $this->prophesize(QueryInterface::class);
155  $sourceProphecy = $this->prophesize(SourceInterface::class);
156  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
157  $queryProphecy->getOrderings()->willReturn([]);
158  $queryProphecy->getStatement()->willReturn(null);
159 
160  $constraintProphecy = $this->prophesize(NotInterface::class);
161  $subConstraintProphecy = $this->prophesize(ComparisonInterface::class);
162  $constraintProphecy->getConstraint()->shouldBeCalled()->willReturn($subConstraintProphecy->reveal());
163  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
164  $subject->expects(self::once())->method('parseComparison')->willReturn('heinz');
165  $queryBuilderProphecy->andWhere(' NOT(heinz)')->shouldBeCalled();
166 
167  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
168  }
169 
174  {
175  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
176  $subject = $this->getAccessibleMock(
177  Typo3DbQueryParser::class,
178  // Shut down some methods not important for this test
179  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
180  );
181  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
182  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
183 
184  $queryProphecy = $this->prophesize(QueryInterface::class);
185  $sourceProphecy = $this->prophesize(SourceInterface::class);
186  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
187  $queryProphecy->getOrderings()->willReturn([]);
188  $queryProphecy->getStatement()->willReturn(null);
189 
190  $constraintProphecy = $this->prophesize(AndInterface::class);
191  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
192  $constraint1Prophecy = $this->prophesize(ComparisonInterface::class);
193  $constraintProphecy->getConstraint1()->willReturn($constraint1Prophecy->reveal());
194  $constraint2Prophecy = $this->prophesize(ComparisonInterface::class);
195  $constraintProphecy->getConstraint2()->willReturn($constraint2Prophecy->reveal());
196  $subject->expects(self::any())->method('parseComparison')->willReturn('heinz');
197  $expressionProphecy = $this->prophesize(ExpressionBuilder::class);
198  $queryBuilderProphecy->expr()->shouldBeCalled()->willReturn($expressionProphecy->reveal());
199  $compositeExpressionProphecy = $this->prophesize(CompositeExpression::class);
200  $compositeExpressionProphecy->__toString()->willReturn('heinz AND heinz');
201  $compositeExpressionRevelation = $compositeExpressionProphecy->reveal();
202  $expressionProphecy->andX('heinz', 'heinz')->shouldBeCalled()->willReturn($compositeExpressionRevelation);
203  $queryBuilderProphecy->andWhere($compositeExpressionRevelation)->shouldBeCalled();
204 
205  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
206  }
207 
212  {
213  // Prepare subject, turn off initialize qb method and inject qb prophecy revelation
214  $subject = $this->getAccessibleMock(
215  Typo3DbQueryParser::class,
216  // Shut down some methods not important for this test
217  ['initializeQueryBuilder', 'parseOrderings', 'addTypo3Constraints', 'parseComparison']
218  );
219  $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
220  $subject->_set('queryBuilder', $queryBuilderProphecy->reveal());
221 
222  $queryProphecy = $this->prophesize(QueryInterface::class);
223  $sourceProphecy = $this->prophesize(SourceInterface::class);
224  $queryProphecy->getSource()->willReturn($sourceProphecy->reveal());
225  $queryProphecy->getOrderings()->willReturn([]);
226  $queryProphecy->getStatement()->willReturn(null);
227 
228  $constraintProphecy = $this->prophesize(OrInterface::class);
229  $queryProphecy->getConstraint()->willReturn($constraintProphecy->reveal());
230  $constraint1Prophecy = $this->prophesize(ComparisonInterface::class);
231  $constraintProphecy->getConstraint1()->willReturn($constraint1Prophecy->reveal());
232  $constraint2Prophecy = $this->prophesize(ComparisonInterface::class);
233  $constraintProphecy->getConstraint2()->willReturn($constraint2Prophecy->reveal());
234  $subject->expects(self::any())->method('parseComparison')->willReturn('heinz');
235  $expressionProphecy = $this->prophesize(ExpressionBuilder::class);
236  $queryBuilderProphecy->expr()->shouldBeCalled()->willReturn($expressionProphecy->reveal());
237  $compositeExpressionProphecy = $this->prophesize(CompositeExpression::class);
238  $compositeExpressionProphecy->__toString()->willReturn('heinz OR heinz');
239  $compositeExpressionRevelation = $compositeExpressionProphecy->reveal();
240  $expressionProphecy->orX('heinz', 'heinz')->shouldBeCalled()->willReturn($compositeExpressionRevelation);
241  $queryBuilderProphecy->andWhere($compositeExpressionRevelation)->shouldBeCalled();
242 
243  $subject->convertQueryToDoctrineQueryBuilder($queryProphecy->reveal());
244  }
245 
250  {
251  $connectionProphet = $this->prophesize(Connection::class);
252  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
253  $queryBuilderProphet = $this->prophesize(QueryBuilder::class, $connectionProphet->reveal());
254  $expr = GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal());
255  $queryBuilderProphet->expr()->willReturn($expr);
256  return $queryBuilderProphet;
257  }
258 
263  {
264  $connectionProphet = $this->prophesize(Connection::class);
265  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
266  $queryBuilderProphet = $this->prophesize(QueryBuilder::class, $connectionProphet->reveal());
267  $expr = GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal());
268  $queryBuilderProphet->expr()->willReturn(
269  $expr
270  );
271  $queryBuilderProphet->getConnection()->willReturn($connectionProphet->reveal());
272  $queryBuilderForSubselectMock = $this->getMockBuilder(QueryBuilder::class)
273  ->setMethods(['expr', 'unquoteSingleIdentifier'])
274  ->setConstructorArgs([$connectionProphet->reveal()])
275  ->getMock();
276  $connectionProphet->createQueryBuilder()->willReturn($queryBuilderForSubselectMock);
277  $queryBuilderForSubselectMock->expects(self::any())->method('expr')->willReturn($expr);
278  $queryBuilderForSubselectMock->expects(self::any())->method('unquoteSingleIdentifier')->willReturnCallback(function ($identifier) {
279  return $identifier;
280  });
281  return $queryBuilderProphet;
282  }
283 
288  {
289  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
290  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
291  'languageField' => 'sys_language_uid'
292  ];
294  $querySettings = $this->createMock(Typo3QuerySettings::class);
295  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
296  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
297  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
298  $sql = $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
299  $expectedSql = $table . '.sys_language_uid IN (0, -1)';
300  self::assertSame($expectedSql, $sql);
301  }
302 
307  {
308  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
309  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
310  'languageField' => 'sys_language_uid'
311  ];
313  $querySettings = $this->getMockBuilder(Typo3QuerySettings::class)
314  ->setMethods(['dummy'])
315  ->getMock();
316  $querySettings->setLanguageUid('1');
317  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
318  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
319  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
320  $sql = $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
321  $result = $table . '.sys_language_uid IN (1, -1)';
322  self::assertSame($result, $sql);
323  }
324 
329  {
330  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
331  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
332  'languageField' => 'sys_language_uid'
333  ];
334  $querySettings = new ‪Typo3QuerySettings();
335  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
336  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
337  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
338  $sql = $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
339  $expectedSql = $table . '.sys_language_uid IN (0, -1)';
340  self::assertSame($expectedSql, $sql);
341  }
342 
347  {
348  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
349  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
350  'languageField' => 'sys_language_uid',
351  'delete' => 'deleted'
352  ];
353  $querySettings = new ‪Typo3QuerySettings();
354  $querySettings->setLanguageUid(0);
355  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
356  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
357  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
358  $sql = $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
359  $expectedSql = $table . '.sys_language_uid IN (0, -1)';
360  self::assertSame($expectedSql, $sql);
361  }
362 
367  {
368  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
369  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
370  'languageField' => 'sys_language_uid'
371  ];
372  $querySettings = new ‪Typo3QuerySettings();
373  $querySettings->setLanguageUid(2);
374  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
375  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
376  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
377  $sql = $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
378  $expectedSql = $table . '.sys_language_uid IN (2, -1)';
379  self::assertSame($expectedSql, $sql);
380  }
381 
386  {
387  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
388  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
389  'languageField' => 'sys_language_uid',
390  'transOrigPointerField' => 'l10n_parent'
391  ];
392  $querySettings = new ‪Typo3QuerySettings();
393  $querySettings->setLanguageUid(2);
394  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
395 
396  $queryBuilderProphet = $this->‪getQueryBuilderProphetWithQueryBuilderForSubselect();
397 
398  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
399 
400  $compositeExpression = $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
401  $expectedSql = '(' . $table . '.sys_language_uid = -1) OR ((' . $table . '.sys_language_uid = 2) AND (' . $table . '.l10n_parent IN (SELECT ' . $table . '_dl.uid FROM ' . $table . ' ' . $table . '_dl WHERE (' . $table . '_dl.l10n_parent = 0) AND (' . $table . '_dl.sys_language_uid = 0)))) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '_to.l10n_parent FROM ' . $table . ' ' . $table . '_dl, ' . $table . ' ' . $table . '_to WHERE (' . $table . '_to.l10n_parent > 0) AND (' . $table . '_to.sys_language_uid = 2))))';
402  self::assertSame($expectedSql, $compositeExpression->__toString());
403  }
404 
409  {
410  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
411  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
412  'languageField' => 'sys_language_uid',
413  'transOrigPointerField' => 'l10n_parent',
414  'delete' => 'deleted'
415  ];
416  $querySettings = new ‪Typo3QuerySettings();
417  $querySettings->setLanguageUid(2);
418  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
419  $queryBuilderProphet = $this->‪getQueryBuilderProphetWithQueryBuilderForSubselect();
420  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
421  $compositeExpression= $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
422  $expectedSql = '(' . $table . '.sys_language_uid = -1) OR ((' . $table . '.sys_language_uid = 2) AND (' . $table . '.l10n_parent IN (SELECT ' . $table . '_dl.uid FROM ' . $table . ' ' . $table . '_dl WHERE (' . $table . '_dl.l10n_parent = 0) AND (' . $table . '_dl.sys_language_uid = 0) AND (' . $table . '_dl.deleted = 0)))) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '_to.l10n_parent FROM ' . $table . ' ' . $table . '_dl, ' . $table . ' ' . $table . '_to WHERE (' . $table . '_to.l10n_parent > 0) AND (' . $table . '_to.sys_language_uid = 2) AND ((' . $table . '_dl.deleted = 0) AND (' . $table . '_to.deleted = 0)))))';
423  self::assertSame($expectedSql, $compositeExpression->__toString());
424  }
425 
430  {
431  $table = 'tt_content';
432  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
433  'languageField' => 'sys_language_uid',
434  'transOrigPointerField' => 'l10n_parent',
435  'delete' => 'deleted'
436  ];
437  $querySettings = new ‪Typo3QuerySettings();
438  $querySettings->setLanguageUid(2);
439  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
440 
441  $queryBuilderProphet = $this->‪getQueryBuilderProphetWithQueryBuilderForSubselect();
442 
443  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
444  $compositeExpression = $mockTypo3DbQueryParser->_call('getLanguageStatement', $table, $table, $querySettings);
445  $expectedSql = '(' . $table . '.sys_language_uid = -1) OR ((' . $table . '.sys_language_uid = 2) AND (' . $table . '.l10n_parent IN (SELECT ' . $table . '_dl.uid FROM ' . $table . ' ' . $table . '_dl WHERE (' . $table . '_dl.l10n_parent = 0) AND (' . $table . '_dl.sys_language_uid = 0) AND (' . $table . '_dl.deleted = 0)))) OR ((' . $table . '.sys_language_uid = 0) AND (' . $table . '.uid NOT IN (SELECT ' . $table . '_to.l10n_parent FROM ' . $table . ' ' . $table . '_dl, ' . $table . ' ' . $table . '_to WHERE (' . $table . '_to.l10n_parent > 0) AND (' . $table . '_to.sys_language_uid = 2) AND ((' . $table . '_dl.deleted = 0) AND (' . $table . '_to.deleted = 0)))))';
446  self::assertSame($expectedSql, $compositeExpression->__toString());
447  }
448 
453  {
454  $mockSource = $this->getMockBuilder(Selector::class)
455  ->setMethods(['getNodeTypeName'])
456  ->disableOriginalConstructor()
457  ->getMock();
458  $mockSource->expects(self::any())->method('getNodeTypeName')->willReturn('foo');
459  $mockDataMapper = $this->getMockBuilder(DataMapper::class)
460  ->setMethods(['convertPropertyNameToColumnName', 'convertClassNameToTableName'])
461  ->disableOriginalConstructor()
462  ->getMock();
463  $mockDataMapper->expects(self::once())->method('convertClassNameToTableName')->with('foo')->willReturn('tx_myext_tablename');
464  $mockDataMapper->expects(self::once())->method('convertPropertyNameToColumnName')->with('fooProperty', 'foo')->willReturn('converted_fieldname');
465  $queryBuilderProphet = $this->prophesize(QueryBuilder::class);
466  $queryBuilderProphet->addOrderBy('tx_myext_tablename.converted_fieldname', 'ASC')->shouldBeCalledTimes(1);
467 
468  $orderings = ['fooProperty' => ‪QueryInterface::ORDER_ASCENDING];
469  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
470  $mockTypo3DbQueryParser->_set('dataMapper', $mockDataMapper);
471  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
472  $mockTypo3DbQueryParser->_call('parseOrderings', $orderings, $mockSource);
473  }
474 
479  {
480  $this->expectException(UnsupportedOrderException::class);
481  $this->expectExceptionCode(1242816074);
482  $mockSource = $this->getMockBuilder(Selector::class)
483  ->setMethods(['getNodeTypeName'])
484  ->disableOriginalConstructor()
485  ->getMock();
486  $mockSource->expects(self::never())->method('getNodeTypeName');
487  $mockDataMapper = $this->getMockBuilder(DataMapper::class)
488  ->setMethods(['convertPropertyNameToColumnName', 'convertClassNameToTableName'])
489  ->disableOriginalConstructor()
490  ->getMock();
491  $mockDataMapper->expects(self::never())->method('convertClassNameToTableName');
492  $mockDataMapper->expects(self::never())->method('convertPropertyNameToColumnName');
493  $orderings = ['fooProperty' => 'unsupported_order'];
494  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
495  $mockTypo3DbQueryParser->_set('dataMapper', $mockDataMapper);
496 
497  $mockTypo3DbQueryParser->_call('parseOrderings', $orderings, $mockSource);
498  }
499 
504  {
505  $mockSource = $this->getMockBuilder(Selector::class)
506  ->setMethods(['getNodeTypeName'])
507  ->disableOriginalConstructor()
508  ->getMock();
509  $mockSource->expects(self::any())->method('getNodeTypeName')->willReturn('Tx_MyExt_ClassName');
510  $mockDataMapper = $this->getMockBuilder(DataMapper::class)
511  ->setMethods(['convertPropertyNameToColumnName', 'convertClassNameToTableName'])
512  ->disableOriginalConstructor()
513  ->getMock();
514  $mockDataMapper->expects(self::any())->method('convertClassNameToTableName')->with('Tx_MyExt_ClassName')->willReturn('tx_myext_tablename');
515  $mockDataMapper->expects(self::any())->method('convertPropertyNameToColumnName')->willReturn('converted_fieldname');
516  $orderings = [
517  'fooProperty' => ‪QueryInterface::ORDER_ASCENDING,
518  'barProperty' => ‪QueryInterface::ORDER_DESCENDING
519  ];
520  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
521  $mockTypo3DbQueryParser->_set('dataMapper', $mockDataMapper);
522 
523  $queryBuilder = $this->getMockBuilder(QueryBuilder::class)
524  ->disableOriginalConstructor()
525  ->setMethods(['addOrderBy'])
526  ->getMock();
527  $queryBuilder->expects(self::exactly(2))->method('addOrderBy')
528  ->withConsecutive(
529  ['tx_myext_tablename.converted_fieldname', 'ASC'],
530  ['tx_myext_tablename.converted_fieldname', 'DESC']
531  );
532 
533  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilder);
534  $mockTypo3DbQueryParser->_call('parseOrderings', $orderings, $mockSource);
535  }
536 
538  {
539  return [
540  'in be: include all' => ['BE', true, [], true, ''],
541  'in be: ignore enable fields but do not include deleted' => ['BE', true, [], false, 'tx_foo_table.deleted_column=0'],
542  'in be: respect enable fields but include deleted' => ['BE', false, [], true, '(tx_foo_table.disabled_column = 0) AND (tx_foo_table.starttime_column <= 1451779200)'],
543  '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'],
544  'in fe: include all' => ['FE', true, [], true, ''],
545  'in fe: ignore enable fields but do not include deleted' => ['FE', true, [], false, 'tx_foo_table.deleted_column=0'],
546  '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)'],
547  '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)']
548  ];
549  }
550 
555  public function ‪visibilityConstraintStatementIsGeneratedAccordingToTheQuerySettings($mode, $ignoreEnableFields, $enableFieldsToBeIgnored, $deletedValue, $expectedSql)
556  {
557  $tableName = 'tx_foo_table';
558  ‪$GLOBALS['TCA'][$tableName]['ctrl'] = [
559  'enablecolumns' => [
560  'disabled' => 'disabled_column',
561  'starttime' => 'starttime_column'
562  ],
563  'delete' => 'deleted_column'
564  ];
565  // simulate time for backend enable fields
566  ‪$GLOBALS['SIM_ACCESS_TIME'] = 1451779200;
567  // simulate time for frontend (PageRepository) enable fields
568  $dateAspect = new ‪DateTimeAspect(new \DateTimeImmutable('@1451779200'));
569  $context = new ‪Context(['date' => $dateAspect]);
570  GeneralUtility::setSingletonInstance(Context::class, $context);
571 
572  $connectionProphet = $this->prophesize(Connection::class);
573  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
574  $connectionProphet->getExpressionBuilder()->willReturn(
575  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
576  );
577 
578  $queryBuilderProphet = $this->prophesize(QueryBuilder::class);
579  $queryBuilderProphet->expr()->willReturn(
580  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
581  );
582  $queryBuilderProphet->createNamedParameter(Argument::cetera())->willReturnArgument(0);
583 
584  $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
585  $connectionPoolProphet->getConnectionForTable(Argument::any($tableName, 'pages'))->willReturn($connectionProphet->reveal());
586  $connectionPoolProphet->getQueryBuilderForTable(Argument::any($tableName, 'pages'))->willReturn($queryBuilderProphet->reveal());
587  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
588  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
589 
590  $mockQuerySettings = $this->getMockBuilder(Typo3QuerySettings::class)
591  ->setMethods(['getIgnoreEnableFields', 'getEnableFieldsToBeIgnored', 'getIncludeDeleted'])
592  ->disableOriginalConstructor()
593  ->getMock();
594  $mockQuerySettings->expects(self::once())->method('getIgnoreEnableFields')->willReturn($ignoreEnableFields);
595  $mockQuerySettings->expects(self::once())->method('getEnableFieldsToBeIgnored')->willReturn($enableFieldsToBeIgnored);
596  $mockQuerySettings->expects(self::once())->method('getIncludeDeleted')->willReturn($deletedValue);
597 
599  $mockEnvironmentService = $this->getMockBuilder(EnvironmentService::class)
600  ->setMethods(['isEnvironmentInFrontendMode'])
601  ->getMock();
602  $mockEnvironmentService->expects(self::any())->method('isEnvironmentInFrontendMode')->willReturn($mode === 'FE');
603 
604  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
605  $mockTypo3DbQueryParser->_set('environmentService', $mockEnvironmentService);
606  $resultSql = $mockTypo3DbQueryParser->_call('getVisibilityConstraintStatement', $mockQuerySettings, $tableName, $tableName);
607  self::assertSame($expectedSql, $resultSql);
608  unset(‪$GLOBALS['TCA'][$tableName]);
609  }
610 
612  {
613  return [
614  'in be: respectEnableFields=false' => ['BE', false, ''],
615  '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'],
616  'in FE: respectEnableFields=false' => ['FE', false, ''],
617  '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)']
618  ];
619  }
620 
625  public function ‪respectEnableFieldsSettingGeneratesCorrectStatement($mode, $respectEnableFields, $expectedSql)
626  {
627  $tableName = 'tx_foo_table';
628  ‪$GLOBALS['TCA'][$tableName]['ctrl'] = [
629  'enablecolumns' => [
630  'disabled' => 'disabled_column',
631  'starttime' => 'starttime_column'
632  ],
633  'delete' => 'deleted_column'
634  ];
635  // simulate time for backend enable fields
636  ‪$GLOBALS['SIM_ACCESS_TIME'] = 1451779200;
637  // simulate time for frontend (PageRepository) enable fields
638  $dateAspect = new ‪DateTimeAspect(new \DateTimeImmutable('@1451779200'));
639  $context = new ‪Context(['date' => $dateAspect]);
640  GeneralUtility::setSingletonInstance(Context::class, $context);
641 
642  $connectionProphet = $this->prophesize(Connection::class);
643  $connectionProphet->quoteIdentifier(Argument::cetera())->willReturnArgument(0);
644  $connectionProphet->getExpressionBuilder(Argument::cetera())->willReturn(
645  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
646  );
647  $queryBuilderProphet = $this->prophesize(QueryBuilder::class);
648  $queryBuilderProphet->expr()->willReturn(
649  GeneralUtility::makeInstance(ExpressionBuilder::class, $connectionProphet->reveal())
650  );
651  $queryBuilderProphet->createNamedParameter(Argument::cetera())->willReturnArgument(0);
652 
653  $connectionPoolProphet = $this->prophesize(ConnectionPool::class);
654  $connectionPoolProphet->getQueryBuilderForTable(Argument::any($tableName, 'pages'))->willReturn($queryBuilderProphet->reveal());
655  $connectionPoolProphet->getConnectionForTable(Argument::any($tableName, 'pages'))->willReturn($connectionProphet->reveal());
656  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
657  GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphet->reveal());
658 
660  $mockQuerySettings = $this->getMockBuilder(Typo3QuerySettings::class)
661  ->setMethods(['dummy'])
662  ->disableOriginalConstructor()
663  ->getMock();
664  $mockQuerySettings->setIgnoreEnableFields(!$respectEnableFields);
665  $mockQuerySettings->setIncludeDeleted(!$respectEnableFields);
666 
667  $environmentService = new ‪EnvironmentService();
668  $environmentService->setFrontendMode($mode === 'FE');
669  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
670  $mockTypo3DbQueryParser->injectEnvironmentService($environmentService);
671  $actualSql = $mockTypo3DbQueryParser->_call('getVisibilityConstraintStatement', $mockQuerySettings, $tableName, $tableName);
672  self::assertSame($expectedSql, $actualSql);
673  unset(‪$GLOBALS['TCA'][$tableName]);
674  }
675 
680  {
681  $this->expectException(InconsistentQuerySettingsException::class);
682  $this->expectExceptionCode(1460975922);
683  $tableName = 'tx_foo_table';
684  ‪$GLOBALS['TCA'][$tableName]['ctrl'] = [
685  'enablecolumns' => [
686  'disabled' => 'disabled_column'
687  ],
688  'delete' => 'deleted_column'
689  ];
690  $mockQuerySettings = $this->getMockBuilder(Typo3QuerySettings::class)
691  ->setMethods(['getIgnoreEnableFields', 'getEnableFieldsToBeIgnored', 'getIncludeDeleted'])
692  ->disableOriginalConstructor()
693  ->getMock();
694  $mockQuerySettings->expects(self::once())->method('getIgnoreEnableFields')->willReturn(false);
695  $mockQuerySettings->expects(self::once())->method('getEnableFieldsToBeIgnored')->willReturn([]);
696  $mockQuerySettings->expects(self::once())->method('getIncludeDeleted')->willReturn(true);
697 
698  $environmentService = new ‪EnvironmentService();
699  $environmentService->setFrontendMode(true);
700  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
701  $mockTypo3DbQueryParser->injectEnvironmentService($environmentService);
702 
703  $mockTypo3DbQueryParser->_call('getVisibilityConstraintStatement', $mockQuerySettings, $tableName, $tableName);
704  unset(‪$GLOBALS['TCA'][$tableName]);
705  }
706 
711  {
712  $table = ‪StringUtility::getUniqueId('tx_coretest_table');
713  return [
714  'set Pid to zero if rootLevel = 1' => [
715  '1',
716  $table,
717  $table . '.pid = 0'
718  ],
719  'set Pid to given Pids if rootLevel = 0' => [
720  '0',
721  $table,
722  $table . '.pid IN (42, 27)'
723  ],
724  'add 0 to given Pids if rootLevel = -1' => [
725  '-1',
726  $table,
727  $table . '.pid IN (42, 27, 0)'
728  ],
729  'set Pid to zero if rootLevel = -1 and no further pids given' => [
730  '-1',
731  $table,
732  $table . '.pid = 0',
733  []
734  ],
735  'set no statement for invalid configuration' => [
736  '2',
737  $table,
738  ''
739  ]
740  ];
741  }
742 
747  public function ‪addPageIdStatementSetsPidToZeroIfTableDeclaresRootlevel($rootLevel, $table, $expectedSql, $storagePageIds = [42, 27])
748  {
749  ‪$GLOBALS['TCA'][$table]['ctrl'] = [
750  'rootLevel' => $rootLevel
751  ];
752  $mockTypo3DbQueryParser = $this->getAccessibleMock(Typo3DbQueryParser::class, ['dummy'], [], '', false);
753  $queryBuilderProphet = $this->‪getQueryBuilderWithExpressionBuilderProphet();
754  $mockTypo3DbQueryParser->_set('queryBuilder', $queryBuilderProphet->reveal());
755  $sql = $mockTypo3DbQueryParser->_call('getPageIdStatement', $table, $table, $storagePageIds);
756 
757  self::assertSame($expectedSql, $sql);
758  }
759 }
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderThrowsExceptionOnNotImplementedConstraint
‪convertQueryToDoctrineQueryBuilderThrowsExceptionOnNotImplementedConstraint()
Definition: Typo3DbQueryParserTest.php:85
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:35
‪TYPO3\CMS\Extbase\Persistence\QueryInterface
Definition: QueryInterface.php:29
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addPageIdStatementSetsPidToZeroIfTableDeclaresRootlevel
‪addPageIdStatementSetsPidToZeroIfTableDeclaresRootlevel($rootLevel, $table, $expectedSql, $storagePageIds=[42, 27])
Definition: Typo3DbQueryParserTest.php:747
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksForDefaultLanguageWithoutDeleteStatementReturned
‪addGetLanguageStatementWorksForDefaultLanguageWithoutDeleteStatementReturned()
Definition: Typo3DbQueryParserTest.php:346
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksForForeignLanguageWithSubselectionWithoutDeleteStatementReturned
‪addGetLanguageStatementWorksForForeignLanguageWithSubselectionWithoutDeleteStatementReturned()
Definition: Typo3DbQueryParserTest.php:385
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\tearDown
‪tearDown()
Definition: Typo3DbQueryParserTest.php:49
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsSimpleAndWhere
‪convertQueryToDoctrineQueryBuilderAddsSimpleAndWhere()
Definition: Typo3DbQueryParserTest.php:114
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\ORDER_DESCENDING
‪const ORDER_DESCENDING
Definition: QueryInterface.php:99
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\respectEnableFieldsSettingGeneratesCorrectStatement
‪respectEnableFieldsSettingGeneratesCorrectStatement($mode, $respectEnableFields, $expectedSql)
Definition: Typo3DbQueryParserTest.php:625
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\Selector
Definition: Selector.php:31
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\SourceInterface
Definition: SourceInterface.php:22
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsOrConstraint
‪convertQueryToDoctrineQueryBuilderAddsOrConstraint()
Definition: Typo3DbQueryParserTest.php:211
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage
Definition: Typo3DbBackendTest.php:16
‪TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
Definition: DataMapper.php:52
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsAndConstraint
‪convertQueryToDoctrineQueryBuilderAddsAndConstraint()
Definition: Typo3DbQueryParserTest.php:173
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\OrInterface
Definition: OrInterface.php:27
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\orderStatementGenerationThrowsExceptionOnUnsupportedOrder
‪orderStatementGenerationThrowsExceptionOnUnsupportedOrder()
Definition: Typo3DbQueryParserTest.php:478
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksForNonDefaultLanguage
‪addGetLanguageStatementWorksForNonDefaultLanguage()
Definition: Typo3DbQueryParserTest.php:306
‪TYPO3\CMS\Core\Database\Query\QueryBuilder
Definition: QueryBuilder.php:52
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\getQueryBuilderProphetWithQueryBuilderForSubselect
‪Prophecy Prophecy ObjectProphecy getQueryBuilderProphetWithQueryBuilderForSubselect()
Definition: Typo3DbQueryParserTest.php:262
‪TYPO3\CMS\Extbase\Persistence\Generic\Exception\InconsistentQuerySettingsException
Definition: InconsistentQuerySettingsException.php:26
‪TYPO3\CMS\Core\Database\Query\Expression\CompositeExpression
Definition: CompositeExpression.php:25
‪TYPO3\CMS\Extbase\Persistence\QueryInterface\ORDER_ASCENDING
‪const ORDER_ASCENDING
Definition: QueryInterface.php:98
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\providerForRespectEnableFields
‪providerForRespectEnableFields()
Definition: Typo3DbQueryParserTest.php:611
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\providerForAddPageIdStatementData
‪providerForAddPageIdStatementData()
Definition: Typo3DbQueryParserTest.php:710
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\ComparisonInterface
Definition: ComparisonInterface.php:62
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\visibilityConstraintStatementGenerationThrowsExceptionIfTheQuerySettingsAreInconsistent
‪visibilityConstraintStatementGenerationThrowsExceptionIfTheQuerySettingsAreInconsistent()
Definition: Typo3DbQueryParserTest.php:679
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\NotInterface
Definition: NotInterface.php:24
‪TYPO3\CMS\Extbase\Persistence\Generic\Exception\UnsupportedOrderException
Definition: UnsupportedOrderException.php:26
‪TYPO3\CMS\Extbase\Service\EnvironmentService
Definition: EnvironmentService.php:27
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\providerForVisibilityConstraintStatement
‪providerForVisibilityConstraintStatement()
Definition: Typo3DbQueryParserTest.php:537
‪TYPO3\CMS\Core\Utility\StringUtility\getUniqueId
‪static string getUniqueId($prefix='')
Definition: StringUtility.php:92
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksForForeignLanguageWithoutSubselection
‪addGetLanguageStatementWorksForForeignLanguageWithoutSubselection()
Definition: Typo3DbQueryParserTest.php:366
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksInBackendContextWithNoGlobalTypoScriptFrontendControllerAvailable
‪addGetLanguageStatementWorksInBackendContextWithNoGlobalTypoScriptFrontendControllerAvailable()
Definition: Typo3DbQueryParserTest.php:328
‪$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:555
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\getQueryBuilderWithExpressionBuilderProphet
‪Prophecy Prophecy ObjectProphecy getQueryBuilderWithExpressionBuilderProphet()
Definition: Typo3DbQueryParserTest.php:249
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface
Definition: ConstraintInterface.php:25
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksInBackendContextWithSubselectionTakesDeleteStatementIntoAccountIfNecessary
‪addGetLanguageStatementWorksInBackendContextWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
Definition: Typo3DbQueryParserTest.php:429
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\orderStatementGenerationWorks
‪orderStatementGenerationWorks()
Definition: Typo3DbQueryParserTest.php:452
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest
Definition: Typo3DbQueryParserTest.php:45
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\orderStatementGenerationWorksWithMultipleOrderings
‪orderStatementGenerationWorksWithMultipleOrderings()
Definition: Typo3DbQueryParserTest.php:503
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Utility\StringUtility
Definition: StringUtility.php:22
‪TYPO3\CMS\Core\Context\DateTimeAspect
Definition: DateTimeAspect.php:35
‪TYPO3\CMS\Extbase\Persistence\Generic\Qom\AndInterface
Definition: AndInterface.php:25
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
Definition: Typo3QuerySettings.php:29
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksForDefaultLanguage
‪addGetLanguageStatementWorksForDefaultLanguage()
Definition: Typo3DbQueryParserTest.php:287
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderAddsNotConstraint
‪convertQueryToDoctrineQueryBuilderAddsNotConstraint()
Definition: Typo3DbQueryParserTest.php:143
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\convertQueryToDoctrineQueryBuilderDoesNotAddAndWhereWithEmptyConstraint
‪convertQueryToDoctrineQueryBuilderDoesNotAddAndWhereWithEmptyConstraint()
Definition: Typo3DbQueryParserTest.php:58
‪TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic\Storage\Typo3DbQueryParserTest\addGetLanguageStatementWorksForForeignLanguageWithSubselectionTakesDeleteStatementIntoAccountIfNecessary
‪addGetLanguageStatementWorksForForeignLanguageWithSubselectionTakesDeleteStatementIntoAccountIfNecessary()
Definition: Typo3DbQueryParserTest.php:408
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser
Definition: Typo3DbQueryParser.php:62