‪TYPO3CMS  9.5
EnumerationTypeAttributesTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
18 
20 
26 {
27 
34  {
35  return [
36  'CHARACTER SET' => [
37  "ENUM('value1', 'value2') CHARACTER SET latin1",
38  ['charset' => 'latin1', 'collation' => null],
39  ],
40  'COLLATE' => [
41  "SET('value1', 'value2') COLLATE latin1_german1_ci",
42  ['charset' => null, 'collation' => 'latin1_german1_ci'],
43  ],
44  'CHARACTER SET + COLLATE' => [
45  "SET('value1', 'value2') CHARACTER SET latin1 COLLATE latin1_german1_ci",
46  ['charset' => 'latin1', 'collation' => 'latin1_german1_ci'],
47  ],
48  ];
49  }
50 
57  public function ‪canParseDataType(string $columnDefinition, array $options)
58  {
59  $subject = $this->‪createSubject($columnDefinition);
60 
61  $this->assertSame($options, $subject->dataType->getOptions());
62  }
63 }
‪TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\DataTypeAttributes\EnumerationTypeAttributesTest\canParseDataType
‪canParseDataType(string $columnDefinition, array $options)
Definition: EnumerationTypeAttributesTest.php:57
‪TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\AbstractDataTypeBaseTestCase\createSubject
‪TYPO3 CMS Core Database Schema Parser AST CreateColumnDefinitionItem createSubject(string $statement)
Definition: AbstractDataTypeBaseTestCase.php:51
‪TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\DataTypeAttributes
Definition: CharacterTypeAttributesTest.php:4
‪TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\DataTypeAttributes\EnumerationTypeAttributesTest\canParseEnumerationDataTypeAttributesProvider
‪array canParseEnumerationDataTypeAttributesProvider()
Definition: EnumerationTypeAttributesTest.php:33
‪TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\AbstractDataTypeBaseTestCase
Definition: AbstractDataTypeBaseTestCase.php:28
‪TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\DataTypeAttributes\EnumerationTypeAttributesTest
Definition: EnumerationTypeAttributesTest.php:26