‪TYPO3CMS  11.5
MockPlatform.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 Doctrine\DBAL\Exception as DBALException;
21 use Doctrine\DBAL\Platforms\AbstractPlatform;
22 
23 class ‪MockPlatform extends AbstractPlatform
24 {
32  public function ‪getBlobTypeDeclarationSQL(array $field)
33  {
34  throw DBALException::notSupported(__METHOD__);
35  }
36 
40  public function ‪getBooleanTypeDeclarationSQL(array $columnDef): ?string
41  {
42  return null;
43  }
44 
48  public function ‪getIntegerTypeDeclarationSQL(array $columnDef): ?string
49  {
50  return null;
51  }
52 
56  public function ‪getBigIntTypeDeclarationSQL(array $columnDef): ?string
57  {
58  return null;
59  }
60 
64  public function ‪getSmallIntTypeDeclarationSQL(array $columnDef): ?string
65  {
66  return null;
67  }
68 
72  public function ‪_getCommonIntegerTypeDeclarationSQL(array $columnDef): ?string
73  {
74  return null;
75  }
76 
84  public function ‪getVarcharTypeDeclarationSQL(array $field): string
85  {
86  return 'DUMMYVARCHAR()';
87  }
88 
96  public function ‪getClobTypeDeclarationSQL(array $field): string
97  {
98  return 'DUMMYCLOB';
99  }
100 
111  public function ‪getJsonTypeDeclarationSQL(array $field): string
112  {
113  return 'DUMMYJSON';
114  }
115 
123  public function ‪getBinaryTypeDeclarationSQL(array $field): string
124  {
125  return 'DUMMYBINARY';
126  }
127 
133  public function ‪getName(): ?string
134  {
135  return 'mock';
136  }
137 
141  protected function ‪initializeDoctrineTypeMappings(): void {}
142 
151  protected function ‪getVarcharTypeDeclarationSQLSnippet($length, $fixed): ?string
152  {
153  return '';
154  }
155 
163  protected function ‪getReservedKeywordsClass(): string
164  {
165  return MockKeywordList::class;
166  }
167 
168  public function ‪getCurrentDatabaseExpression(): string
169  {
170  return "''";
171  }
172 }
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks
Definition: InstantiatableAbstractRestrictionContainer.php:18
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getIntegerTypeDeclarationSQL
‪getIntegerTypeDeclarationSQL(array $columnDef)
Definition: MockPlatform.php:48
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getCurrentDatabaseExpression
‪getCurrentDatabaseExpression()
Definition: MockPlatform.php:168
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getVarcharTypeDeclarationSQL
‪string getVarcharTypeDeclarationSQL(array $field)
Definition: MockPlatform.php:84
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getName
‪string getName()
Definition: MockPlatform.php:133
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getSmallIntTypeDeclarationSQL
‪getSmallIntTypeDeclarationSQL(array $columnDef)
Definition: MockPlatform.php:64
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getBlobTypeDeclarationSQL
‪string void getBlobTypeDeclarationSQL(array $field)
Definition: MockPlatform.php:32
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getReservedKeywordsClass
‪string getReservedKeywordsClass()
Definition: MockPlatform.php:163
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getJsonTypeDeclarationSQL
‪string getJsonTypeDeclarationSQL(array $field)
Definition: MockPlatform.php:111
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\_getCommonIntegerTypeDeclarationSQL
‪_getCommonIntegerTypeDeclarationSQL(array $columnDef)
Definition: MockPlatform.php:72
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform
Definition: MockPlatform.php:24
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getBinaryTypeDeclarationSQL
‪string getBinaryTypeDeclarationSQL(array $field)
Definition: MockPlatform.php:123
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getClobTypeDeclarationSQL
‪string getClobTypeDeclarationSQL(array $field)
Definition: MockPlatform.php:96
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getBigIntTypeDeclarationSQL
‪getBigIntTypeDeclarationSQL(array $columnDef)
Definition: MockPlatform.php:56
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\initializeDoctrineTypeMappings
‪initializeDoctrineTypeMappings()
Definition: MockPlatform.php:141
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getBooleanTypeDeclarationSQL
‪getBooleanTypeDeclarationSQL(array $columnDef)
Definition: MockPlatform.php:40
‪TYPO3\CMS\Core\Tests\Unit\Database\Mocks\MockPlatform\getVarcharTypeDeclarationSQLSnippet
‪string getVarcharTypeDeclarationSQLSnippet($length, $fixed)
Definition: MockPlatform.php:151