Esempio n. 1
0
 /**
  * Normalizes the column name, removing table prefix and uppercasing.
  * article.first_name becomes FIRST_NAME
  *
  * @deprecated Use ColumnMap::normalizeColumName() instead
  * @param      string $name
  * @return     string Normalized column name.
  */
 protected function normalizeColName($name)
 {
   return ColumnMap::normalizeName($name);
 }
Esempio n. 2
0
 public function testNormalizeName()
 {
     $this->assertEquals('', ColumnMap::normalizeName(''), 'normalizeColumnName() returns an empty string when passed an empty string');
     $this->assertEquals('BAR', ColumnMap::normalizeName('bar'), 'normalizeColumnName() uppercases the input');
     $this->assertEquals('BAR_BAZ', ColumnMap::normalizeName('bar_baz'), 'normalizeColumnName() does not mind underscores');
     $this->assertEquals('BAR', ColumnMap::normalizeName('FOO.BAR'), 'normalizeColumnName() removes table prefix');
     $this->assertEquals('BAR', ColumnMap::normalizeName('BAR'), 'normalizeColumnName() leaves normalized column names unchanged');
     $this->assertEquals('BAR_BAZ', ColumnMap::normalizeName('foo.bar_baz'), 'normalizeColumnName() can do all the above at the same time');
 }