‪TYPO3CMS  9.5
AbstractRestrictionTestCase.php
Go to the documentation of this file.
1 <?php
2 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 
18 use Prophecy\Argument;
23 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
24 
25 class ‪AbstractRestrictionTestCase extends UnitTestCase
26 {
30  protected ‪$expressionBuilder;
31 
35  protected function ‪setUp()
36  {
38  $connection = $this->prophesize(Connection::class);
39  $connection->quoteIdentifier(Argument::cetera())->will(function (‪$args) {
40  return '"' . implode('"."', explode('.', ‪$args[0])) . '"';
41  });
42  $connection->quote(Argument::cetera())->will(function (‪$args) {
43  return '\'' . ‪$args[0] . '\'';
44  });
45  $connection->getDatabasePlatform()->willReturn(new ‪MockPlatform());
46 
47  $this->expressionBuilder = GeneralUtility::makeInstance(ExpressionBuilder::class, $connection->reveal());
48  }
49 }
‪TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder
Definition: ExpressionBuilder.php:33
‪$args
‪$args
Definition: checkIntegrityCsvFixtures.php:230
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction
Definition: AbstractRestrictionContainerTest.php:3
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\AbstractRestrictionTestCase
Definition: AbstractRestrictionTestCase.php:26
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform
Definition: MockPlatform.php:21
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:31
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\AbstractRestrictionTestCase\$expressionBuilder
‪$expressionBuilder
Definition: AbstractRestrictionTestCase.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\AbstractRestrictionTestCase\setUp
‪setUp()
Definition: AbstractRestrictionTestCase.php:34