‪TYPO3CMS  11.5
Typo3DbQueryParserTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
27 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
28 
29 final class ‪Typo3DbQueryParserTest extends FunctionalTestCase
30 {
32  'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example',
33  ];
34 
39  {
40  ‪$GLOBALS['TYPO3_REQUEST'] = (new ‪ServerRequest())
41  ->withAttribute('applicationType', ‪SystemEnvironmentBuilder::REQUESTTYPE_BE);
42  $registryEntryRepository = $this->get(RegistryEntryRepository::class);
43  $querySettings = new ‪Typo3QuerySettings(new ‪Context(), $this->get(ConfigurationManagerInterface::class));
44 
45  $query = $registryEntryRepository->createQuery();
46  $query->setQuerySettings($querySettings);
47 
48  $typo3DbQueryParser = $this->get(Typo3DbQueryParser::class);
49  $queryBuilder = $typo3DbQueryParser->convertQueryToDoctrineQueryBuilder($query);
50 
51  $compositeExpression = $queryBuilder->getQueryPart('where');
52  self::assertStringNotContainsString('hidden', (string)$compositeExpression);
53  self::assertStringNotContainsString('deleted', (string)$compositeExpression);
54  }
55 }
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder
Definition: SystemEnvironmentBuilder.php:41
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:28
‪TYPO3\CMS\Core\Core\SystemEnvironmentBuilder\REQUESTTYPE_BE
‪const REQUESTTYPE_BE
Definition: SystemEnvironmentBuilder.php:45
‪ExtbaseTeam\BlogExample\Domain\Repository\RegistryEntryRepository
Definition: RegistryEntryRepository.php:25
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Storage\Typo3DbQueryParserTest\$testExtensionsToLoad
‪$testExtensionsToLoad
Definition: Typo3DbQueryParserTest.php:31
‪TYPO3\CMS\Core\Context\Context
Definition: Context.php:53
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Storage
Definition: Typo3DbQueryParserTest.php:18
‪TYPO3\CMS\Core\Http\ServerRequest
Definition: ServerRequest.php:37
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Storage\Typo3DbQueryParserTest
Definition: Typo3DbQueryParserTest.php:30
‪TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings
Definition: Typo3QuerySettings.php:29
‪TYPO3\CMS\Extbase\Tests\Functional\Persistence\Generic\Storage\Typo3DbQueryParserTest\tcaWithoutCtrlCreatesAValidSQLStatement
‪tcaWithoutCtrlCreatesAValidSQLStatement()
Definition: Typo3DbQueryParserTest.php:38
‪TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser
Definition: Typo3DbQueryParser.php:61