[FEATURE] Doctrine: Implement SchemaMigrationService
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Database / Schema / Parser / DataTypes / TextTypesTest.php
1 <?php
2 declare(strict_types=1);
3
4 namespace TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\DataTypes;
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
19 use TYPO3\CMS\Core\Database\Schema\Parser\AST\DataType\LongTextDataType;
20 use TYPO3\CMS\Core\Database\Schema\Parser\AST\DataType\MediumTextDataType;
21 use TYPO3\CMS\Core\Database\Schema\Parser\AST\DataType\TextDataType;
22 use TYPO3\CMS\Core\Database\Schema\Parser\AST\DataType\TinyTextDataType;
23 use TYPO3\CMS\Core\Tests\Unit\Database\Schema\Parser\AbstractDataTypeBaseTestCase;
24
25 /**
26 * Tests for parsing TEXT SQL data types
27 */
28 class TextTypesTest extends AbstractDataTypeBaseTestCase
29 {
30 /**
31 * Data provider for canParseTextDataType()
32 *
33 * @return array
34 */
35 public function canParseTextDataTypeProvider(): array
36 {
37 return [
38 'TINYTEXT' => [
39 'TINYTEXT',
40 TinyTextDataType::class,
41 ],
42 'TEXT' => [
43 'TEXT',
44 TextDataType::class,
45 ],
46 'MEDIUMTEXT' => [
47 'MEDIUMTEXT',
48 MediumTextDataType::class,
49 ],
50 'LONGTEXT' => [
51 'LONGTEXT',
52 LongTextDataType::class,
53 ],
54 ];
55 }
56
57 /**
58 * @test
59 * @dataProvider canParseTextDataTypeProvider
60 * @param string $columnDefinition
61 * @param string $className
62 */
63 public function canParseDataType(string $columnDefinition, string $className)
64 {
65 $subject = $this->createSubject($columnDefinition);
66
67 $this->assertInstanceOf($className, $subject->dataType);
68 }
69 }