‪TYPO3CMS  9.5
DocumentTypeExclusionRestrictionTest.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 
19 
21 {
23  {
24  return [
25  'build with one parameter' => [
26  [1],
27  '"pages"."doktype" NOT IN (1)',
28  ],
29  'build with multiple parameter' => [
30  [1, 4, 100],
31  '"pages"."doktype" NOT IN (1, 4, 100)',
32  ],
33  'build with int parameter' => [
34  1,
35  '"pages"."doktype" NOT IN (1)',
36  ],
37  ];
38  }
39 
45  public function ‪buildRestrictionsAddsDoktypeWhereClause($excludedDocumentTypes, string $expected): void
46  {
47  $subject = new ‪DocumentTypeExclusionRestriction($excludedDocumentTypes);
48  $expression = $subject->buildExpression(['pages' => 'pages'], $this->expressionBuilder);
49  self::assertSame($expected, (string)$expression);
50  }
51 }
‪TYPO3\CMS\Core\Database\Query\Restriction\DocumentTypeExclusionRestriction
Definition: DocumentTypeExclusionRestriction.php:25
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction
Definition: AbstractRestrictionContainerTest.php:3
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\DocumentTypeExclusionRestrictionTest
Definition: DocumentTypeExclusionRestrictionTest.php:21
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\AbstractRestrictionTestCase
Definition: AbstractRestrictionTestCase.php:26
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\DocumentTypeExclusionRestrictionTest\buildRestrictionsAddsDoktypeWhereClause
‪buildRestrictionsAddsDoktypeWhereClause($excludedDocumentTypes, string $expected)
Definition: DocumentTypeExclusionRestrictionTest.php:45
‪TYPO3\CMS\Core\Tests\Unit\Database\Query\Restriction\DocumentTypeExclusionRestrictionTest\buildRestrictionsAddsDoktypeWhereClauseDataProvider
‪buildRestrictionsAddsDoktypeWhereClauseDataProvider()
Definition: DocumentTypeExclusionRestrictionTest.php:22