| @@ 284-300 (lines=17) @@ | ||
| 281 | /** |
|
| 282 | * @group DBAL-1082 |
|
| 283 | */ |
|
| 284 | public function testListDecimalTypeColumns() |
|
| 285 | { |
|
| 286 | $tableName = 'test_list_decimal_columns'; |
|
| 287 | $table = new Table($tableName); |
|
| 288 | ||
| 289 | $table->addColumn('col', 'decimal'); |
|
| 290 | $table->addColumn('col_unsigned', 'decimal', array('unsigned' => true)); |
|
| 291 | ||
| 292 | $this->_sm->dropAndCreateTable($table); |
|
| 293 | ||
| 294 | $columns = $this->_sm->listTableColumns($tableName); |
|
| 295 | ||
| 296 | $this->assertArrayHasKey('col', $columns); |
|
| 297 | $this->assertArrayHasKey('col_unsigned', $columns); |
|
| 298 | $this->assertFalse($columns['col']->getUnsigned()); |
|
| 299 | $this->assertTrue($columns['col_unsigned']->getUnsigned()); |
|
| 300 | } |
|
| 301 | ||
| 302 | /** |
|
| 303 | * @group DBAL-1082 |
|
| @@ 305-321 (lines=17) @@ | ||
| 302 | /** |
|
| 303 | * @group DBAL-1082 |
|
| 304 | */ |
|
| 305 | public function testListFloatTypeColumns() |
|
| 306 | { |
|
| 307 | $tableName = 'test_list_float_columns'; |
|
| 308 | $table = new Table($tableName); |
|
| 309 | ||
| 310 | $table->addColumn('col', 'float'); |
|
| 311 | $table->addColumn('col_unsigned', 'float', array('unsigned' => true)); |
|
| 312 | ||
| 313 | $this->_sm->dropAndCreateTable($table); |
|
| 314 | ||
| 315 | $columns = $this->_sm->listTableColumns($tableName); |
|
| 316 | ||
| 317 | $this->assertArrayHasKey('col', $columns); |
|
| 318 | $this->assertArrayHasKey('col_unsigned', $columns); |
|
| 319 | $this->assertFalse($columns['col']->getUnsigned()); |
|
| 320 | $this->assertTrue($columns['col_unsigned']->getUnsigned()); |
|
| 321 | } |
|
| 322 | ||
| 323 | /** |
|
| 324 | * Test default null values (especially for mariadb 10.2.7+) |
|
| @@ 269-284 (lines=16) @@ | ||
| 266 | /** |
|
| 267 | * @group DBAL-1078 |
|
| 268 | */ |
|
| 269 | public function testListTableColumnsWithFixedStringColumn() |
|
| 270 | { |
|
| 271 | $tableName = 'test_list_table_fixed_string'; |
|
| 272 | ||
| 273 | $table = new Table($tableName); |
|
| 274 | $table->addColumn('column_char', 'string', array('fixed' => true, 'length' => 2)); |
|
| 275 | ||
| 276 | $this->_sm->createTable($table); |
|
| 277 | ||
| 278 | $columns = $this->_sm->listTableColumns($tableName); |
|
| 279 | ||
| 280 | $this->assertArrayHasKey('column_char', $columns); |
|
| 281 | $this->assertInstanceOf('Doctrine\DBAL\Types\StringType', $columns['column_char']->getType()); |
|
| 282 | $this->assertTrue($columns['column_char']->getFixed()); |
|
| 283 | $this->assertSame(2, $columns['column_char']->getLength()); |
|
| 284 | } |
|
| 285 | ||
| 286 | public function testListTableColumnsDispatchEvent() |
|
| 287 | { |
|