Permalink
Browse files

Improved sqlValue and changed its test.

  • Loading branch information...
1 parent 60352cc commit 595906efeb07692f21c0e72ce5d7f93f873aaace @gpongelli committed Jun 13, 2012
@@ -787,15 +787,15 @@ public function setUTF()
/**
* This function return a field value as a prepared string to be used in a SQL statement.
*
- * @param array $columns Array of table's column returned by ::getTableColumns.
+ * @param array $columns Array of table's column returned by JDatabasePostgreSQL::getTableColumns.
@stefanneculai

stefanneculai Jun 18, 2012

I think it should be &$columns - there is a coding style error.

Doc comment for var $columns does not match actual variable name &$columns at position 1

@gpongelli

gpongelli via email Jun 20, 2012

Owner
* @param string $field_name The table field's name.
* @param string $field_value The variable value to quote and return.
*
* @return string The quoted string.
*
* @since 11.3
*/
- public function sqlValue($columns, $field_name, $field_value)
+ protected function sqlValue(&$columns, $field_name, $field_value)
{
switch ($columns[$field_name])
{
@@ -814,7 +814,6 @@ public function sqlValue($columns, $field_name, $field_value)
case 'bigserial':
case 'integer':
case 'money':
- case 'numeric':
case 'real':
case 'smallint':
case 'serial':
@@ -1179,7 +1179,7 @@ public function testSqlValue()
foreach (get_object_vars($tst) as $key => $val)
{
- $values[] = self::$driver->sqlValue($tablCol, $key, $val);
+ $values[] = TestReflection::invoke(self::$driver, 'sqlValue', $tablCol, $key, $val);
}
$this->assertThat(

0 comments on commit 595906e

Please sign in to comment.