예제 #1
0
 public function testGetTriggerName()
 {
     $tableName = 'subject_table';
     $time = 'before';
     $event = 'insert';
     $triggerName = 'trg_subject_table_before_insert';
     $this->_connectionFactory->expects($this->once())->method('create')->will($this->returnValue($this->connection));
     $this->connection->expects($this->once())->method('getTriggerName')->with($tableName, $time, $event)->willReturn($triggerName);
     $this->assertSame($triggerName, $this->resource->getTriggerName($tableName, $time, $event));
 }
예제 #2
0
 public function testGetFkName()
 {
     $table = 'table';
     $calculatedTableName = self::TABLE_PREFIX . 'table';
     $refTable = 'ref_table';
     $calculatedRefTableName = self::TABLE_PREFIX . 'ref_table';
     $columnName = 'columnName';
     $refColumnName = 'refColumnName';
     $this->connection->expects($this->once())->method('getForeignKeyName')->with($calculatedTableName, $columnName, $calculatedRefTableName, $refColumnName)->will($this->returnValue('fkName'));
     $this->_connectionFactory->expects($this->once())->method('create')->will($this->returnValue($this->connection));
     $this->assertEquals('fkName', $this->resource->getFkName($table, $columnName, $refTable, $refColumnName));
 }