Failed Conditions
Pull Request — master (#2825)
by Sébastien
06:58
created

testColumnDefaultsUsingSql()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 39
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 39
rs 8.8571
cc 1
eloc 18
nc 1
nop 0
1
<?php
2
3
namespace Doctrine\Tests\DBAL\Functional\Schema;
4
5
use Doctrine\DBAL\Platforms\MySqlPlatform;
6
use Doctrine\DBAL\Schema\Comparator;
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\DBAL\Schema\Table;
9
use Doctrine\DBAL\Types\Type;
10
11
class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
12
{
13
    protected function setUp()
14
    {
15
        parent::setUp();
16
17
        if (!Type::hasType('point')) {
18
            Type::addType('point', 'Doctrine\Tests\Types\MySqlPointType');
19
        }
20
    }
21
22
    public function testSwitchPrimaryKeyColumns()
23
    {
24
        $tableOld = new Table("switch_primary_key_columns");
25
        $tableOld->addColumn('foo_id', 'integer');
26
        $tableOld->addColumn('bar_id', 'integer');
27
28
        $this->_sm->createTable($tableOld);
29
        $tableFetched = $this->_sm->listTableDetails("switch_primary_key_columns");
30
        $tableNew = clone $tableFetched;
31
        $tableNew->setPrimaryKey(array('bar_id', 'foo_id'));
32
33
        $comparator = new Comparator;
34
        $this->_sm->alterTable($comparator->diffTable($tableFetched, $tableNew));
0 ignored issues
show
Security Bug introduced by
It seems like $comparator->diffTable($tableFetched, $tableNew) targeting Doctrine\DBAL\Schema\Comparator::diffTable() can also be of type false; however, Doctrine\DBAL\Schema\Abs...maManager::alterTable() does only seem to accept object<Doctrine\DBAL\Schema\TableDiff>, did you maybe forget to handle an error condition?
Loading history...
35
36
        $table      = $this->_sm->listTableDetails('switch_primary_key_columns');
37
        $primaryKey = $table->getPrimaryKeyColumns();
38
39
        self::assertCount(2, $primaryKey);
40
        self::assertContains('bar_id', $primaryKey);
41
        self::assertContains('foo_id', $primaryKey);
42
    }
43
44
    public function testDiffTableBug()
45
    {
46
        $schema = new Schema();
47
        $table = $schema->createTable('diffbug_routing_translations');
48
        $table->addColumn('id', 'integer');
49
        $table->addColumn('route', 'string');
50
        $table->addColumn('locale', 'string');
51
        $table->addColumn('attribute', 'string');
52
        $table->addColumn('localized_value', 'string');
53
        $table->addColumn('original_value', 'string');
54
        $table->setPrimaryKey(array('id'));
55
        $table->addUniqueIndex(array('route', 'locale', 'attribute'));
56
        $table->addIndex(array('localized_value')); // this is much more selective than the unique index
57
58
        $this->_sm->createTable($table);
59
        $tableFetched = $this->_sm->listTableDetails("diffbug_routing_translations");
60
61
        $comparator = new Comparator;
62
        $diff = $comparator->diffTable($tableFetched, $table);
63
64
        self::assertFalse($diff, "no changes expected.");
0 ignored issues
show
Bug introduced by
It seems like $diff defined by $comparator->diffTable($tableFetched, $table) on line 62 can also be of type object<Doctrine\DBAL\Schema\TableDiff>; however, PHPUnit\Framework\Assert::assertFalse() does only seem to accept boolean, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
65
    }
66
67 View Code Duplication
    public function testFulltextIndex()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
68
    {
69
        $table = new Table('fulltext_index');
70
        $table->addColumn('text', 'text');
71
        $table->addIndex(array('text'), 'f_index');
72
        $table->addOption('engine', 'MyISAM');
73
74
        $index = $table->getIndex('f_index');
75
        $index->addFlag('fulltext');
76
77
        $this->_sm->dropAndCreateTable($table);
78
79
        $indexes = $this->_sm->listTableIndexes('fulltext_index');
80
        self::assertArrayHasKey('f_index', $indexes);
81
        self::assertTrue($indexes['f_index']->hasFlag('fulltext'));
82
    }
83
84 View Code Duplication
    public function testSpatialIndex()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
85
    {
86
        $table = new Table('spatial_index');
87
        $table->addColumn('point', 'point');
88
        $table->addIndex(array('point'), 's_index');
89
        $table->addOption('engine', 'MyISAM');
90
91
        $index = $table->getIndex('s_index');
92
        $index->addFlag('spatial');
93
94
        $this->_sm->dropAndCreateTable($table);
95
96
        $indexes = $this->_sm->listTableIndexes('spatial_index');
97
        self::assertArrayHasKey('s_index', $indexes);
98
        self::assertTrue($indexes['s_index']->hasFlag('spatial'));
99
    }
100
101
    /**
102
     * @group DBAL-400
103
     */
104
    public function testAlterTableAddPrimaryKey()
105
    {
106
        $table = new Table('alter_table_add_pk');
107
        $table->addColumn('id', 'integer');
108
        $table->addColumn('foo', 'integer');
109
        $table->addIndex(array('id'), 'idx_id');
110
111
        $this->_sm->createTable($table);
112
113
        $comparator = new Comparator();
114
        $diffTable  = clone $table;
115
116
        $diffTable->dropIndex('idx_id');
117
        $diffTable->setPrimaryKey(array('id'));
118
119
        $this->_sm->alterTable($comparator->diffTable($table, $diffTable));
0 ignored issues
show
Security Bug introduced by
It seems like $comparator->diffTable($table, $diffTable) targeting Doctrine\DBAL\Schema\Comparator::diffTable() can also be of type false; however, Doctrine\DBAL\Schema\Abs...maManager::alterTable() does only seem to accept object<Doctrine\DBAL\Schema\TableDiff>, did you maybe forget to handle an error condition?
Loading history...
120
121
        $table = $this->_sm->listTableDetails("alter_table_add_pk");
122
123
        self::assertFalse($table->hasIndex('idx_id'));
124
        self::assertTrue($table->hasPrimaryKey());
125
    }
126
127
    /**
128
     * @group DBAL-464
129
     */
130
    public function testDropPrimaryKeyWithAutoincrementColumn()
131
    {
132
        $table = new Table("drop_primary_key");
133
        $table->addColumn('id', 'integer', array('primary' => true, 'autoincrement' => true));
134
        $table->addColumn('foo', 'integer', array('primary' => true));
135
        $table->setPrimaryKey(array('id', 'foo'));
136
137
        $this->_sm->dropAndCreateTable($table);
138
139
        $diffTable = clone $table;
140
141
        $diffTable->dropPrimaryKey();
142
143
        $comparator = new Comparator();
144
145
        $this->_sm->alterTable($comparator->diffTable($table, $diffTable));
0 ignored issues
show
Security Bug introduced by
It seems like $comparator->diffTable($table, $diffTable) targeting Doctrine\DBAL\Schema\Comparator::diffTable() can also be of type false; however, Doctrine\DBAL\Schema\Abs...maManager::alterTable() does only seem to accept object<Doctrine\DBAL\Schema\TableDiff>, did you maybe forget to handle an error condition?
Loading history...
146
147
        $table = $this->_sm->listTableDetails("drop_primary_key");
148
149
        self::assertFalse($table->hasPrimaryKey());
150
        self::assertFalse($table->getColumn('id')->getAutoincrement());
151
    }
152
153
    /**
154
     * @group DBAL-789
155
     */
156
    public function testDoesNotPropagateDefaultValuesForUnsupportedColumnTypes()
157
    {
158
        $table = new Table("text_blob_default_value");
159
        $table->addColumn('def_text', 'text', array('default' => 'def'));
160
        $table->addColumn('def_text_null', 'text', array('notnull' => false, 'default' => 'def'));
161
        $table->addColumn('def_blob', 'blob', array('default' => 'def'));
162
        $table->addColumn('def_blob_null', 'blob', array('notnull' => false, 'default' => 'def'));
163
164
        $this->_sm->dropAndCreateTable($table);
165
166
        $onlineTable = $this->_sm->listTableDetails("text_blob_default_value");
167
168
        self::assertNull($onlineTable->getColumn('def_text')->getDefault());
169
        self::assertNull($onlineTable->getColumn('def_text_null')->getDefault());
170
        self::assertFalse($onlineTable->getColumn('def_text_null')->getNotnull());
171
        self::assertNull($onlineTable->getColumn('def_blob')->getDefault());
172
        self::assertNull($onlineTable->getColumn('def_blob_null')->getDefault());
173
        self::assertFalse($onlineTable->getColumn('def_blob_null')->getNotnull());
174
175
        $comparator = new Comparator();
176
177
        $this->_sm->alterTable($comparator->diffTable($table, $onlineTable));
0 ignored issues
show
Security Bug introduced by
It seems like $comparator->diffTable($table, $onlineTable) targeting Doctrine\DBAL\Schema\Comparator::diffTable() can also be of type false; however, Doctrine\DBAL\Schema\Abs...maManager::alterTable() does only seem to accept object<Doctrine\DBAL\Schema\TableDiff>, did you maybe forget to handle an error condition?
Loading history...
178
179
        $onlineTable = $this->_sm->listTableDetails("text_blob_default_value");
180
181
        self::assertNull($onlineTable->getColumn('def_text')->getDefault());
182
        self::assertNull($onlineTable->getColumn('def_text_null')->getDefault());
183
        self::assertFalse($onlineTable->getColumn('def_text_null')->getNotnull());
184
        self::assertNull($onlineTable->getColumn('def_blob')->getDefault());
185
        self::assertNull($onlineTable->getColumn('def_blob_null')->getDefault());
186
        self::assertFalse($onlineTable->getColumn('def_blob_null')->getNotnull());
187
    }
188
189 View Code Duplication
    public function testColumnCollation()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
190
    {
191
        $table = new Table('test_collation');
192
        $table->addOption('collate', $collation = 'latin1_swedish_ci');
193
        $table->addOption('charset', 'latin1');
194
        $table->addColumn('id', 'integer');
195
        $table->addColumn('text', 'text');
196
        $table->addColumn('foo', 'text')->setPlatformOption('collation', 'latin1_swedish_ci');
197
        $table->addColumn('bar', 'text')->setPlatformOption('collation', 'utf8_general_ci');
198
        $this->_sm->dropAndCreateTable($table);
199
200
        $columns = $this->_sm->listTableColumns('test_collation');
201
202
        self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
203
        self::assertEquals('latin1_swedish_ci', $columns['text']->getPlatformOption('collation'));
204
        self::assertEquals('latin1_swedish_ci', $columns['foo']->getPlatformOption('collation'));
205
        self::assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
206
    }
207
208
    /**
209
     * @group DBAL-843
210
     */
211
    public function testListLobTypeColumns()
212
    {
213
        $tableName = 'lob_type_columns';
214
        $table = new Table($tableName);
215
216
        $table->addColumn('col_tinytext', 'text', array('length' => MySqlPlatform::LENGTH_LIMIT_TINYTEXT));
217
        $table->addColumn('col_text', 'text', array('length' => MySqlPlatform::LENGTH_LIMIT_TEXT));
218
        $table->addColumn('col_mediumtext', 'text', array('length' => MySqlPlatform::LENGTH_LIMIT_MEDIUMTEXT));
219
        $table->addColumn('col_longtext', 'text');
220
221
        $table->addColumn('col_tinyblob', 'text', array('length' => MySqlPlatform::LENGTH_LIMIT_TINYBLOB));
222
        $table->addColumn('col_blob', 'blob', array('length' => MySqlPlatform::LENGTH_LIMIT_BLOB));
223
        $table->addColumn('col_mediumblob', 'blob', array('length' => MySqlPlatform::LENGTH_LIMIT_MEDIUMBLOB));
224
        $table->addColumn('col_longblob', 'blob');
225
226
        $this->_sm->dropAndCreateTable($table);
227
228
        $platform = $this->_sm->getDatabasePlatform();
229
        $offlineColumns = $table->getColumns();
230
        $onlineColumns = $this->_sm->listTableColumns($tableName);
231
232
        self::assertSame(
233
            $platform->getClobTypeDeclarationSQL($offlineColumns['col_tinytext']->toArray()),
234
            $platform->getClobTypeDeclarationSQL($onlineColumns['col_tinytext']->toArray())
235
        );
236
        self::assertSame(
237
            $platform->getClobTypeDeclarationSQL($offlineColumns['col_text']->toArray()),
238
            $platform->getClobTypeDeclarationSQL($onlineColumns['col_text']->toArray())
239
        );
240
        self::assertSame(
241
            $platform->getClobTypeDeclarationSQL($offlineColumns['col_mediumtext']->toArray()),
242
            $platform->getClobTypeDeclarationSQL($onlineColumns['col_mediumtext']->toArray())
243
        );
244
        self::assertSame(
245
            $platform->getClobTypeDeclarationSQL($offlineColumns['col_longtext']->toArray()),
246
            $platform->getClobTypeDeclarationSQL($onlineColumns['col_longtext']->toArray())
247
        );
248
249
        self::assertSame(
250
            $platform->getBlobTypeDeclarationSQL($offlineColumns['col_tinyblob']->toArray()),
251
            $platform->getBlobTypeDeclarationSQL($onlineColumns['col_tinyblob']->toArray())
252
        );
253
        self::assertSame(
254
            $platform->getBlobTypeDeclarationSQL($offlineColumns['col_blob']->toArray()),
255
            $platform->getBlobTypeDeclarationSQL($onlineColumns['col_blob']->toArray())
256
        );
257
        self::assertSame(
258
            $platform->getBlobTypeDeclarationSQL($offlineColumns['col_mediumblob']->toArray()),
259
            $platform->getBlobTypeDeclarationSQL($onlineColumns['col_mediumblob']->toArray())
260
        );
261
        self::assertSame(
262
            $platform->getBlobTypeDeclarationSQL($offlineColumns['col_longblob']->toArray()),
263
            $platform->getBlobTypeDeclarationSQL($onlineColumns['col_longblob']->toArray())
264
        );
265
    }
266
267
    /**
268
     * @group DBAL-423
269
     */
270
    public function testDiffListGuidTableColumn()
271
    {
272
        $offlineTable = new Table('list_guid_table_column');
273
        $offlineTable->addColumn('col_guid', 'guid');
274
275
        $this->_sm->dropAndCreateTable($offlineTable);
276
277
        $onlineTable = $this->_sm->listTableDetails('list_guid_table_column');
278
279
        $comparator = new Comparator();
280
281
        self::assertFalse(
282
            $comparator->diffTable($offlineTable, $onlineTable),
0 ignored issues
show
Bug introduced by
It seems like $comparator->diffTable($...ineTable, $onlineTable) targeting Doctrine\DBAL\Schema\Comparator::diffTable() can also be of type object<Doctrine\DBAL\Schema\TableDiff>; however, PHPUnit\Framework\Assert::assertFalse() does only seem to accept boolean, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
283
            "No differences should be detected with the offline vs online schema."
284
        );
285
    }
286
287
    /**
288
     * @group DBAL-1082
289
     */
290 View Code Duplication
    public function testListDecimalTypeColumns()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
291
    {
292
        $tableName = 'test_list_decimal_columns';
293
        $table = new Table($tableName);
294
295
        $table->addColumn('col', 'decimal');
296
        $table->addColumn('col_unsigned', 'decimal', array('unsigned' => true));
297
298
        $this->_sm->dropAndCreateTable($table);
299
300
        $columns = $this->_sm->listTableColumns($tableName);
301
302
        self::assertArrayHasKey('col', $columns);
303
        self::assertArrayHasKey('col_unsigned', $columns);
304
        self::assertFalse($columns['col']->getUnsigned());
305
        self::assertTrue($columns['col_unsigned']->getUnsigned());
306
    }
307
308
    /**
309
     * @group DBAL-1082
310
     */
311 View Code Duplication
    public function testListFloatTypeColumns()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
312
    {
313
        $tableName = 'test_list_float_columns';
314
        $table = new Table($tableName);
315
316
        $table->addColumn('col', 'float');
317
        $table->addColumn('col_unsigned', 'float', array('unsigned' => true));
318
319
        $this->_sm->dropAndCreateTable($table);
320
321
        $columns = $this->_sm->listTableColumns($tableName);
322
323
        self::assertArrayHasKey('col', $columns);
324
        self::assertArrayHasKey('col_unsigned', $columns);
325
        self::assertFalse($columns['col']->getUnsigned());
326
        self::assertTrue($columns['col_unsigned']->getUnsigned());
327
    }
328
329
    public function testColumnDefaultsUsingDoctrineTable(): void
330
    {
331
332
        $table = new Table("test_column_defaults_with_table");
333
        $table->addColumn('col0', 'integer', ['notnull' => false]);
334
        $table->addColumn('col1', 'integer', ['notnull' => false, 'default' => null]);
335
        $table->addColumn('col2', 'string', ['notnull' => false, 'default' => null]);
336
        $table->addColumn('col3', 'string', ['notnull' => false, 'default' => 'NULL']);
337
        $table->addColumn('col4', 'string', ['notnull' => false, 'default' => 'Hello world']);
338
        $table->addColumn('col5', 'datetime', ['notnull' => false, 'default' => null]);
339
        $table->addColumn('col6', 'decimal', ['scale' => 3, 'precision' => 6, 'notnull' => false, 'default' => -2.3]);
340
        $table->addColumn('col7', 'date', ['notnull' => false, 'default' => '2012-12-12']);
341
        $table->addColumn('col8', 'string', ['notnull' => true, 'default' => '']);
342
        $table->addColumn('col9', 'integer', ['notnull' => false, 'default' => 0]);
343
        $table->addColumn('col10', 'string', ['notnull' => false, 'default' => 'He"ll"o world']);
344
345
        $this->_sm->dropAndCreateTable($table);
346
347
        $onlineTable = $this->_sm->listTableDetails("test_column_defaults_with_table");
348
        self::assertNull($onlineTable->getColumn('col0')->getDefault());
349
        self::assertNull($onlineTable->getColumn('col1')->getDefault());
350
        self::assertNull($onlineTable->getColumn('col2')->getDefault());
351
        self::assertEquals('NULL', $onlineTable->getColumn('col3')->getDefault());
352
        self::assertEquals('Hello world', $onlineTable->getColumn('col4')->getDefault());
353
        self::assertNull($onlineTable->getColumn('col5')->getDefault());
354
        self::assertEquals(-2.3, $onlineTable->getColumn('col6')->getDefault());
355
        self::assertEquals('2012-12-12', $onlineTable->getColumn('col7')->getDefault());
356
        self::assertTrue($onlineTable->getColumn('col8')->getNotnull());
357
        self::assertEquals('', $onlineTable->getColumn('col8')->getDefault());
358
        self::assertEquals(0, $onlineTable->getColumn('col9')->getDefault());
359
        self::assertEquals('He"ll"o world', $onlineTable->getColumn('col10')->getDefault());
360
361
        $comparator = new Comparator();
362
363
        $diff = $comparator->diffTable($table, $onlineTable);
364
        $this->assertFalse($diff, "Tables should be identical with column defaults.");
0 ignored issues
show
Bug introduced by
It seems like $diff defined by $comparator->diffTable($table, $onlineTable) on line 363 can also be of type object<Doctrine\DBAL\Schema\TableDiff>; however, PHPUnit\Framework\Assert::assertFalse() does only seem to accept boolean, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
365
    }
366
367
    public function testColumnDefaultsUsingSql(): void
368
    {
369
370
        $this->_conn->query('DROP TABLE IF EXISTS `test_column_defaults_with_create`');
371
        $sql = sprintf("
372
            CREATE TABLE `test_column_defaults_with_create` (
373
                `col0` INT(11) NULL,
374
                `col1` INT(10) UNSIGNED NULL DEFAULT NULL,
375
                `col2` VARCHAR(10) CHARACTER SET UTF8MB4 COLLATE UTF8MB4_GENERAL_CI NULL DEFAULT NULL,
376
                `col3` VARCHAR(10) CHARACTER SET UTF8MB4 COLLATE UTF8MB4_GENERAL_CI NULL DEFAULT 'NULL',
377
                `col4` VARCHAR(20) NULL DEFAULT 'Hello world',
378
                `col5` DATETIME NULL DEFAULT NULL,
379
                `col6` DECIMAL(6, 3) NULL DEFAULT -2.3,
380
                `col7` DATE NULL DEFAULT '2012-12-12',
381
                `col8` VARCHAR(20) NOT NULL DEFAULT '',
382
                `col9` INT(11) NULL DEFAULT 0,
383
                `col10` VARCHAR(20) NULL DEFAULT '%s'                                                
384
                ) ENGINE=INNODB;
385
        ", 'He"ll"o world');
386
387
        $this->_conn->query($sql);
388
        $t = $this->_sm->listTableDetails("test_column_defaults_with_create");
389
        self::assertNull($t->getColumn('col0')->getDefault());
390
        self::assertNull($t->getColumn('col1')->getDefault());
391
        self::assertNull($t->getColumn('col2')->getDefault());
392
        self::assertEquals('NULL', $t->getColumn('col3')->getDefault());
393
        self::assertEquals('Hello world', $t->getColumn('col4')->getDefault());
394
        self::assertNull($t->getColumn('col5')->getDefault());
395
        self::assertEquals(-2.3, $t->getColumn('col6')->getDefault());
396
        self::assertEquals('2012-12-12', $t->getColumn('col7')->getDefault());
397
        self::assertTrue($t->getColumn('col8')->getNotnull());
398
        self::assertEquals('', $t->getColumn('col8')->getDefault());
399
        self::assertEquals(0, $t->getColumn('col9')->getDefault());
400
        self::assertEquals('He"ll"o world', $t->getColumn('col10')->getDefault());
401
402
        // @todo mariadb returns 'current_timestamp()'
403
        //   `col10` DATETIME NULL DEFAULT CURRENT_TIMESTAMP
404
        //    $this->assertEquals('current_timestamp', strtolower($t->getColumn('col10')->getDefault()));
0 ignored issues
show
Unused Code Comprehensibility introduced by
74% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
405
    }
406
407
}
408