Code Duplication    Length = 12-16 lines in 4 locations

tests/TdbmFluidTableTest.php 3 locations

@@ 63-74 (lines=12) @@
60
        $this->assertCount(1, $schema->getTable('posts')->getIndexes());
61
    }
62
63
    public function testPrimaryKey()
64
    {
65
        $schema = new Schema();
66
        $fluid = new TdbmFluidSchema($schema);
67
68
        $posts = $fluid->table('posts');
69
70
        $posts->column('id')->integer()->then()->primaryKey(['id'], 'pkname');
71
72
        $this->assertTrue($schema->getTable('posts')->hasPrimaryKey());
73
        $this->assertTrue($schema->getTable('posts')->hasIndex('pkname'));
74
    }
75
76
    public function testId()
77
    {
@@ 89-101 (lines=13) @@
86
        $this->assertTrue($schema->getTable('posts')->hasColumn('id'));
87
    }
88
89
    public function testUuid()
90
    {
91
        $schema = new Schema();
92
        $fluid = new TdbmFluidSchema($schema);
93
94
        $posts = $fluid->table('posts');
95
96
        $posts->uuid();
97
98
        $this->assertTrue($schema->getTable('posts')->hasPrimaryKey());
99
        $this->assertTrue($schema->getTable('posts')->hasColumn('uuid'));
100
        $this->assertSame("\n@UUID(\"v4\")", $schema->getTable('posts')->getColumn('uuid')->getComment());
101
    }
102
103
    public function testUuidBadType()
104
    {
@@ 151-166 (lines=16) @@
148
        $this->assertSame("\n@AddInterfaceOnDao(name = \"Foo\\Bar\")", $schema->getTable('posts')->getOptions()['comment']);
149
    }
150
151
    public function testTimestamps()
152
    {
153
        if (defined('Doctrine\\DBAL\\Types\\Type::DATE_IMMUTABLE')) {
154
            $schema = new Schema();
155
            $fluid = new TdbmFluidSchema($schema);
156
157
            $posts = $fluid->table('posts');
158
159
            $posts->timestamps();
160
161
            $this->assertTrue($schema->getTable('posts')->hasColumn('created_at'));
162
            $this->assertTrue($schema->getTable('posts')->hasColumn('updated_at'));
163
        } else {
164
            $this->markTestSkipped("Only available from Doctrine DBAL 2.6");
165
        }
166
    }
167
168
    public function testInherits()
169
    {

tests/TdbmFluidColumnOptionsTest.php 1 location

@@ 68-79 (lines=12) @@
65
        $this->assertCount(1, $schema->getTable('posts')->getIndexes());
66
    }
67
68
    public function testPrimaryKey()
69
    {
70
        $schema = new Schema();
71
        $fluid = new TdbmFluidSchema($schema);
72
73
        $posts = $fluid->table('posts');
74
75
        $posts->column('id')->integer()->primaryKey('pkname');
76
77
        $this->assertTrue($schema->getTable('posts')->hasPrimaryKey());
78
        $this->assertTrue($schema->getTable('posts')->hasIndex('pkname'));
79
    }
80
}
81