‪TYPO3CMS  10.4
AbstractRestrictionTestCase.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 
20 use Prophecy\Argument;
25 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
26 
27 class ‪AbstractRestrictionTestCase extends UnitTestCase
28 {
32  protected ‪$expressionBuilder;
33 
37  protected function ‪setUp(): void
38  {
39  parent::setUp();
41  $connection = $this->prophesize(Connection::class);
42  $connection->quoteIdentifier(Argument::cetera())->will(function (‪$args) {
43  return '"' . implode('"."', explode('.', ‪$args[0])) . '"';
44  });
45  $connection->quote(Argument::cetera())->will(function (‪$args) {
46  return '\'' . ‪$args[0] . '\'';
47  });
48  $connection->getDatabasePlatform()->willReturn(new ‪MockPlatform());
49 
50  $this->expressionBuilder = GeneralUtility::makeInstance(ExpressionBuilder::class, $connection->reveal());
51  }
52 }
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:35
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction
Definition: AbstractRestrictionContainerTest.php:18
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\AbstractRestrictionTestCase
Definition: AbstractRestrictionTestCase.php:28
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform
Definition: MockPlatform.php:22
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\AbstractRestrictionTestCase\$expressionBuilder
‪TYPO3 CMS Core Database Query Expression ExpressionBuilder $expressionBuilder
Definition: AbstractRestrictionTestCase.php:31
‪$args
‪$args
Definition: validateRstFiles.php:214
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\AbstractRestrictionTestCase\setUp
‪setUp()
Definition: AbstractRestrictionTestCase.php:36