Permalink
Browse files

[Tests] Added missing unit tests

  • Loading branch information...
1 parent a197124 commit e4cbdd632cb0e04fc9c952ce52bffd8744bc17f4 @willdurand willdurand committed Nov 10, 2011
View
@@ -14,8 +14,7 @@
<testsuites>
<testsuite name="Propel2 Test Suite">
- <directory>./tests/Propel/Tests/Generator/</directory>
- <directory>./tests/Propel/Tests/Runtime/</directory>
+ <directory>./tests/Propel/Tests/</directory>
</testsuite>
</testsuites>
@@ -82,23 +82,19 @@ class BasePeer
*/
const TYPE_NUM = 'num';
- static public function getFieldnames ($classname, $type = self::TYPE_PHPNAME) {
-
- // TODO we should take care of including the peer class here
-
- $peerclass = 'Base' . $classname . 'Peer'; // TODO is this always true?
- $callable = array($peerclass, 'getFieldnames');
+ static public function getFieldnames($classname, $type = self::TYPE_PHPNAME)
+ {
+ $peerclass = $classname . 'Peer';
+ $callable = array($peerclass, 'getFieldnames');
return call_user_func($callable, $type);
}
- static public function translateFieldname($classname, $fieldname, $fromType, $toType) {
-
- // TODO we should take care of including the peer class here
-
- $peerclass = 'Base' . $classname . 'Peer'; // TODO is this always true?
- $callable = array($peerclass, 'translateFieldname');
- $args = array($fieldname, $fromType, $toType);
+ static public function translateFieldname($classname, $fieldname, $fromType, $toType)
+ {
+ $peerclass = $classname . 'Peer';
+ $callable = array($peerclass, 'translateFieldname');
+ $args = array($fieldname, $fromType, $toType);
return call_user_func_array($callable, $args);
}
@@ -187,15 +183,15 @@ public static function doDelete(Criteria $criteria, ConnectionInterface $con)
*/
public static function doDeleteAll($tableName, ConnectionInterface $con, $databaseName = null)
{
-
+
try {
$db = Propel::getDB($databaseName);
if ($db->useQuoteIdentifier()) {
$tableName = $db->quoteIdentifierTable($tableName);
}
$sql = "DELETE FROM " . $tableName;
$stmt = $con->prepare($sql);
-
+
$stmt->execute();
return $stmt->rowCount();
Oops, something went wrong.

0 comments on commit e4cbdd6

Please sign in to comment.