Passed
Push — master ( 5adaea...ab4b97 )
by Alexander
01:37
created

ColumnSchemaBuilderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 30
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A typesProvider() 0 12 1
A getColumnSchemaBuilder() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Sqlite\Tests;
6
7
use Yiisoft\Db\Sqlite\ColumnSchemaBuilder;
8
use Yiisoft\Db\Sqlite\Schema;
9
use Yiisoft\Db\Tests\ColumnSchemaBuilderTest as AbstractColumnSchemaBuilderTest;
10
11
class ColumnSchemaBuilderTest extends AbstractColumnSchemaBuilderTest
12
{
13
    public ?string $driverName = 'sqlite';
14
15
    /**
16
     * @param string $type
17
     * @param int $length
18
     *
19
     * @return ColumnSchemaBuilder
20
     */
21
    public function getColumnSchemaBuilder($type, $length = null)
22
    {
23
        return new ColumnSchemaBuilder($type, $length, $this->getConnection());
24
    }
25
26
    /**
27
     * @return array
28
     */
29
    public function typesProvider(): array
30
    {
31
        return [
32
            ['integer UNSIGNED', Schema::TYPE_INTEGER, null, [
33
                ['unsigned'],
34
            ]],
35
            ['integer(10) UNSIGNED', Schema::TYPE_INTEGER, 10, [
36
                ['unsigned'],
37
            ]],
38
            // comments are ignored
39
            ['integer(10)', Schema::TYPE_INTEGER, 10, [
40
                ['comment', 'test'],
41
            ]],
42
        ];
43
    }
44
}
45