convertColumnDescription() public method

{@inheritDoc}
public convertColumnDescription ( Cake\Database\Schema\Table $table, $row )
$table Cake\Database\Schema\Table
Beispiel #1
0
 /**
  * Test parsing Postgres column types from field description.
  *
  * @dataProvider convertColumnProvider
  * @return void
  */
 public function testConvertColumn($type, $expected)
 {
     $field = ['name' => 'field', 'type' => $type, 'null' => 'YES', 'default' => 'Default value', 'comment' => 'Comment section', 'char_length' => null, 'collation_name' => 'ja_JP.utf8'];
     $expected += ['null' => true, 'default' => 'Default value', 'comment' => 'Comment section', 'collate' => 'ja_JP.utf8'];
     $driver = $this->getMockBuilder('Cake\\Database\\Driver\\Postgres')->getMock();
     $dialect = new PostgresSchema($driver);
     $table = $this->getMockBuilder('Cake\\Database\\Schema\\Table')->setConstructorArgs(['table'])->getMock();
     $table->expects($this->at(0))->method('addColumn')->with('field', $expected);
     $dialect->convertColumnDescription($table, $field);
 }