Passed
Push — amo/scrutinizer-new-engine ( 927449 )
by Andreas
10:16
created

DriverTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 20
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreatePlatformForVersionLess_4() 0 4 1
A testCreatePlatformForVersionLess_0_57() 0 4 1
A testCreatePlatformForVersionGreaterEquals_4() 0 4 1
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
}