$this->setLastException($e);
// Throw an SQL exception
- throw new SqlException(array($this, sprintf('Cannot write data to table '%s', is the table created?', $dataSetInstance->getTableName()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
+ throw new SqlException(array(
+ $this,
+ sprintf('Cannot write data to table '%s', is the table created?', $dataSetInstance->getTableName()),
+ self::DB_CODE_TABLE_UNWRITEABLE
+ ),
+ self::EXCEPTION_SQL_QUERY
+ );
}
}
*
* @param $tableName Name of the table we need the primary key from
* @return $primaryKey Primary key column of the given table
+ * @todo Rename method to getPrimaryKeyFromTableInfo()
*/
public function getPrimaryKeyOfTable ($tableName) {
// Default key is null
// This may throw exceptions
try {
- // Is the class there?
- if (!class_exists($configValue)) {
+ // Is the config entry valid and class is there?
+ if (!is_string($configKey)) {
+ // Is not a string
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('configKey=%s has unexpected type "%s". FAILED', $configKey, gettype($configKey)));
+
+ // Skip further tests
+ $failed++;
+ continue;
+ } elseif (!class_exists($configValue)) {
// Class not found
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" not found. FAILED', $configValue));
// Skip further tests
$failed++;
continue;
- } // END - if
+ }
} catch (InvalidArgumentException $e) {
// Maybe not conform?
self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" failed to load. Message: "%s"', $configValue, $e->getMessage()));
/**
* Re-tests if detectServerAddress() is returning what it should for tests.
- * This will always be 127.0.0.1. This call should not invoke
+ * This will always be 127.0.0.1. This method should not invoke
* ConsoleTools's method as the configuration entry is already cached.
*/
public function testConfigDetectServerAddressCached () {