示例#1
0
 public function getIndex()
 {
     try {
         $index = $this->table->getIndexByName($this->name);
     } catch (SchemaException $e) {
         $index = $this->table->getIndexByName($this->fKeyName);
     }
     return $index;
 }
示例#2
0
 /**
  * @covers ::getColumnByName
  *
  * @expectedException \Kicaj\Schema\SchemaException
  * @expectedExceptionMessage Table table1 does not have column not_existing.
  */
 public function test_getColumnByName_error()
 {
     // When
     $table = new Table($this->getFixtureRawData('table1.sql'), $this->getMock(DatabaseItf::class));
     // Then
     $table->getColumnByName('not_existing');
 }