Exemplo n.º 1
0
 /**
  * Test parsing MySQL column types form field description.
  *
  * @dataProvider convertColumnProvider
  * @return void
  */
 public function testConvertColumn($type, $expected)
 {
     $field = ['Field' => 'field', 'Type' => $type, 'Null' => 'YES', 'Default' => 'Default value', 'Collation' => 'Collate information', 'Comment' => 'Comment section'];
     $expected += ['null' => true, 'default' => 'Default value', 'collate' => 'Collate information', 'comment' => 'Comment section'];
     $driver = $this->getMock('Cake\\Database\\Driver\\Mysql');
     $dialect = new MysqlSchema($driver);
     $table = $this->getMock('Cake\\Database\\Schema\\Table', [], ['table']);
     $table->expects($this->at(0))->method('addColumn')->with('field', $expected);
     $dialect->convertFieldDescription($table, $field);
 }