TYPO3 CMS  TYPO3_8-7
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 
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 }
static static getMaxIdentifierLength(AbstractPlatform $platform)
static getMaxBindParameters(AbstractPlatform $platform)