‪TYPO3CMS  10.4
PlatformInformationTest.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\Platforms\AbstractPlatform;
21 use Doctrine\DBAL\Platforms\MySqlPlatform;
22 use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
23 use Doctrine\DBAL\Platforms\SqlitePlatform;
24 use Doctrine\DBAL\Platforms\SQLServerPlatform;
26 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
27 
31 class ‪PlatformInformationTest extends UnitTestCase
32 {
38  public function ‪platformDataProvider(): array
39  {
40  return [
41  'mysql' => [$this->prophesize(MySqlPlatform::class)->reveal()],
42  'postgresql' => [$this->prophesize(PostgreSqlPlatform::class)->reveal()],
43  'sqlserver' => [$this->prophesize(SQLServerPlatform::class)->reveal()],
44  'sqlite' => [$this->prophesize(SqlitePlatform::class)->reveal()],
45  ];
46  }
47 
53  public function ‪maxBindParameters(AbstractPlatform $platform)
54  {
55  self::assertGreaterThanOrEqual(1, ‪PlatformInformation::getMaxBindParameters($platform));
56  }
57 
62  {
63  $this->expectException(\RuntimeException::class);
64  $this->expectExceptionCode(1500958070);
65  $platform = $this->prophesize(AbstractPlatform::class)->reveal();
66  self::assertGreaterThanOrEqual(1, ‪PlatformInformation::getMaxBindParameters($platform));
67  }
68 
74  public function ‪maxIdentifierLength(AbstractPlatform $platform)
75  {
76  self::assertGreaterThanOrEqual(1, ‪PlatformInformation::getMaxIdentifierLength($platform));
77  }
78 
83  {
84  $this->expectException(\RuntimeException::class);
85  $this->expectExceptionCode(1500958070);
86  $platform = $this->prophesize(AbstractPlatform::class)->reveal();
87  self::assertGreaterThanOrEqual(1, ‪PlatformInformation::getMaxIdentifierLength($platform));
88  }
89 }
‪TYPO3\CMS\Core\Tests\Unit\Database\Platform\PlatformInformationTest\maxBindParametersWithUnknownPlatform
‪maxBindParametersWithUnknownPlatform()
Definition: PlatformInformationTest.php:61
‪TYPO3\CMS\Core\Tests\Unit\Database\Platform\PlatformInformationTest\maxIdentifierLength
‪maxIdentifierLength(AbstractPlatform $platform)
Definition: PlatformInformationTest.php:74
‪TYPO3\CMS\Core\Tests\Unit\Database\Platform
Definition: PlatformInformationTest.php:18
‪TYPO3\CMS\Core\Tests\Unit\Database\Platform\PlatformInformationTest\platformDataProvider
‪array platformDataProvider()
Definition: PlatformInformationTest.php:38
‪TYPO3\CMS\Core\Database\Platform\PlatformInformation\getMaxBindParameters
‪static int getMaxBindParameters(AbstractPlatform $platform)
Definition: PlatformInformation.php:125
‪TYPO3\CMS\Core\Tests\Unit\Database\Platform\PlatformInformationTest
Definition: PlatformInformationTest.php:32
‪TYPO3\CMS\Core\Tests\Unit\Database\Platform\PlatformInformationTest\maxIdentifierLengthWithUnknownPlatform
‪maxIdentifierLengthWithUnknownPlatform()
Definition: PlatformInformationTest.php:82
‪TYPO3\CMS\Core\Tests\Unit\Database\Platform\PlatformInformationTest\maxBindParameters
‪maxBindParameters(AbstractPlatform $platform)
Definition: PlatformInformationTest.php:53
‪TYPO3\CMS\Core\Database\Platform\PlatformInformation
Definition: PlatformInformation.php:33
‪TYPO3\CMS\Core\Database\Platform\PlatformInformation\getMaxIdentifierLength
‪static int getMaxIdentifierLength(AbstractPlatform $platform)
Definition: PlatformInformation.php:111