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