Completed
Pull Request — 2.9 (#3691)
by
unknown
62:09
created

DBAL3691Test::testIssue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 21
rs 9.7998
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Doctrine\Tests\DBAL\Functional\Ticket;
4
5
use Doctrine\DBAL\Connection;
6
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
7
use Doctrine\DBAL\Schema\MySqlSchemaManager;
8
use PHPUnit\Framework\TestCase;
9
use ReflectionMethod;
10
11
/**
12
 * @group DBAL-3691
13
 */
14
class DBAL3691Test extends TestCase
15
{
16
    public function testIssue()
17
    {
18
        $conn     = $this->createMock(Connection::class);
19
        $platform = new MariaDb1027Platform();
20
21
        $schemaManager = new MySqlSchemaManager($conn, $platform);
22
23
        $reflectionMethod = new ReflectionMethod($schemaManager, '_getPortableTableColumnDefinition');
24
        $reflectionMethod->setAccessible(true);
25
26
        $column = $reflectionMethod->invoke($schemaManager, [
27
            'field' => 'string_empty_by_default',
28
            'type' => 'varchar',
29
            'length' => 255,
30
            'default' => '',
31
            'notnull' => true,
32
            'extra' => false,
33
            'null' => false,
34
        ]);
35
36
        $this->assertEquals(null, $column->getDefault());
37
    }
38
}
39