1
|
|
|
<?php /** @noinspection PhpUnhandledExceptionInspection */ |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* Licensed to CRATE Technology GmbH("Crate") under one or more contributor |
5
|
|
|
* license agreements. See the NOTICE file distributed with this work for |
6
|
|
|
* additional information regarding copyright ownership. Crate licenses |
7
|
|
|
* this file to you under the Apache License, Version 2.0 (the "License"); |
8
|
|
|
* you may not use this file except in compliance with the License. You may |
9
|
|
|
* obtain a copy of the License at |
10
|
|
|
* |
11
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
12
|
|
|
* |
13
|
|
|
* Unless required by applicable law or agreed to in writing, software |
14
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
15
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
16
|
|
|
* License for the specific language governing permissions and limitations |
17
|
|
|
* under the License. |
18
|
|
|
* |
19
|
|
|
* However, if you have executed another commercial license agreement |
20
|
|
|
* with Crate these terms will supersede the license and you may use the |
21
|
|
|
* software solely pursuant to the terms of the relevant commercial agreement. |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
namespace Crate\Test\DBAL\PDOCrate; |
25
|
|
|
|
26
|
|
|
|
27
|
|
|
use Crate\DBAL\Driver\PDOCrate\Driver; |
28
|
|
|
use Crate\DBAL\Platforms\CratePlatform; |
29
|
|
|
use Crate\DBAL\Platforms\CratePlatform1; |
30
|
|
|
use Crate\DBAL\Platforms\CratePlatform4; |
31
|
|
|
use PHPUnit\Framework\TestCase; |
32
|
|
|
|
33
|
|
|
class DriverTest extends TestCase |
34
|
|
|
{ |
35
|
|
|
public function testCreatePlatformForVersionLess_0_57() |
36
|
|
|
{ |
37
|
|
|
$driver = new Driver(); |
38
|
|
|
$this->assertInstanceOf(CratePlatform::class, $driver->createDatabasePlatformForVersion("0.56.6")); |
39
|
|
|
|
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function testCreatePlatformForVersionLess_4() |
43
|
|
|
{ |
44
|
|
|
$driver = new Driver(); |
45
|
|
|
$this->assertInstanceOf(CratePlatform1::class, $driver->createDatabasePlatformForVersion("3.2")); |
46
|
|
|
|
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public function testCreatePlatformForVersionGreaterEquals_4() |
50
|
|
|
{ |
51
|
|
|
$driver = new Driver(); |
52
|
|
|
$this->assertInstanceOf(CratePlatform4::class, $driver->createDatabasePlatformForVersion("4.0.0")); |
53
|
|
|
} |
54
|
|
|
} |