示例#1
0
 public function testGetFkName()
 {
     $expectedTableName = 'tablename';
     $modelEntity = $this->prepareTableName($expectedTableName, false);
     $columnName = 'columnName';
     $this->_connection->expects($this->once())->method('getForeignKeyName')->with($expectedTableName, $columnName, $expectedTableName, $columnName)->will($this->returnValue('fkName'));
     $this->assertEquals('fkName', $this->_resorce->getFkName($modelEntity, $columnName, $modelEntity, $columnName));
 }
示例#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));
 }
示例#3
0
 /**
  * Retrieve 32bit UNIQUE HASH for a Table foreign key
  *
  * @param string $priTableName  the target table name
  * @param string $priColumnName the target table column name
  * @param string $refTableName  the reference table name
  * @param string $refColumnName the reference table column name
  * @return string
  */
 public function getFkName($priTableName, $priColumnName, $refTableName, $refColumnName)
 {
     return $this->_resourceModel->getFkName($priTableName, $priColumnName, $refTableName, $refColumnName);
 }