/** * Tests the Base[Object]TableMap::translateFieldName() method */ public function testTranslateFieldName() { $types = array(TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME, TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM); $expecteds = array(TableMap::TYPE_PHPNAME => 'AuthorId', TableMap::TYPE_STUDLYPHPNAME => 'authorId', TableMap::TYPE_COLNAME => 'book.AUTHOR_ID', TableMap::TYPE_FIELDNAME => 'author_id', TableMap::TYPE_NUM => 5); foreach ($types as $fromType) { foreach ($types as $toType) { $name = $expecteds[$fromType]; $expected = $expecteds[$toType]; $result = BookTableMap::translateFieldName($name, $fromType, $toType); $this->assertEquals($expected, $result); } } }