diff options
Diffstat (limited to 'demos/time-tracker/tests')
-rw-r--r-- | demos/time-tracker/tests/unit/BaseTestCase.php | 4 | ||||
-rw-r--r-- | demos/time-tracker/tests/unit/ProjectDaoTestCase.php | 6 | ||||
-rw-r--r-- | demos/time-tracker/tests/unit/UserDaoTestCase.php | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/demos/time-tracker/tests/unit/BaseTestCase.php b/demos/time-tracker/tests/unit/BaseTestCase.php index 7e4520f8..d72cbc5c 100644 --- a/demos/time-tracker/tests/unit/BaseTestCase.php +++ b/demos/time-tracker/tests/unit/BaseTestCase.php @@ -42,7 +42,7 @@ class BaseTestCase extends UnitTestCase function flushMySQLDatabase()
{
$conn = $this->sqlmap->getDbConnection();
- $file = Prado::getPathOfNamespace('Application.App_Data.mysql-reset','.sql');
+ $file = Prado::getPathOfNamespace('Application.App_Data.MySQL4.mysql-reset','.sql');
if(is_file($file))
$this->runScript($conn, $file);
else
@@ -57,7 +57,7 @@ class BaseTestCase extends UnitTestCase {
$line = trim($line);
if(strlen($line) > 0)
- $connection->execute($line);
+ $connection->createCommand($line)->execute();
}
}
}
diff --git a/demos/time-tracker/tests/unit/ProjectDaoTestCase.php b/demos/time-tracker/tests/unit/ProjectDaoTestCase.php index 3ccb28e2..22a01fca 100644 --- a/demos/time-tracker/tests/unit/ProjectDaoTestCase.php +++ b/demos/time-tracker/tests/unit/ProjectDaoTestCase.php @@ -113,11 +113,11 @@ class ProjectDaoTestCase extends BaseTestCase try
{
$this->projectDao->addUserToProject($project->ID, 'asd');
- $this->pass();
+ $this->fail();
}
- catch(TSqlMapQueryExecutionException $e)
+ catch(TDbException $e)
{
- $this->fail();
+ $this->pass();
}
}
diff --git a/demos/time-tracker/tests/unit/UserDaoTestCase.php b/demos/time-tracker/tests/unit/UserDaoTestCase.php index 404dd9e2..d216dbe6 100644 --- a/demos/time-tracker/tests/unit/UserDaoTestCase.php +++ b/demos/time-tracker/tests/unit/UserDaoTestCase.php @@ -175,11 +175,11 @@ class UserDaoTestCase extends BaseTestCase try
{
$this->userDao->updateUserRoles($user);
- $this->pass();
+ $this->fail();
}
- catch(TDataMapperException $e)
+ catch(TDbException $e)
{
- $this->fail();
+ $this->pass();
}
$check = $this->sqlmap->queryForObject('GetUserByName', 'user1');
|