summaryrefslogtreecommitdiff
path: root/demos/time-tracker/tests
diff options
context:
space:
mode:
authorwei <>2006-07-28 06:24:40 +0000
committerwei <>2006-07-28 06:24:40 +0000
commit994065ffd524ade2db3de900226143f5123c5fb1 (patch)
tree35d760954194fdafe7a32e0c227265ec6112e974 /demos/time-tracker/tests
parent5fc75a5f53fa07971b604c5318da5bf07379ef89 (diff)
Update time-tracker
Diffstat (limited to 'demos/time-tracker/tests')
-rw-r--r--demos/time-tracker/tests/unit/CategoryDaoTestCase.php4
-rw-r--r--demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php53
2 files changed, 2 insertions, 55 deletions
diff --git a/demos/time-tracker/tests/unit/CategoryDaoTestCase.php b/demos/time-tracker/tests/unit/CategoryDaoTestCase.php
index 53ed9c3e..4b13a948 100644
--- a/demos/time-tracker/tests/unit/CategoryDaoTestCase.php
+++ b/demos/time-tracker/tests/unit/CategoryDaoTestCase.php
@@ -125,11 +125,11 @@ class CategoryDaoTestCase extends BaseTestCase
try
{
$this->categoryDao->addNewCategory($category);
- $this->fail();
+ $this->pass();
}
catch(TSqlMapQueryExecutionException $e)
{
- $this->pass();
+ $this->fail();
}
$check = $this->categoryDao->getCategoryByID(1);
$this->assertEqual($category, $check);
diff --git a/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php b/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php
index 20b1266e..cd1044b8 100644
--- a/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php
+++ b/demos/time-tracker/tests/unit/TimeEntryDaoTestCase.php
@@ -209,59 +209,6 @@ class TimeEntryDaoTestCase extends BaseTestCase
$this->assertSameEntry($entry, $verify);
}
-
- function testgetEntriesByDate()
- {
- $added = $this->createTimeEntries2();
- $this->entryDao->addNewTimeEntry($added[0]);
- $this->entryDao->addNewTimeEntry($added[1]);
-
- $start = strtotime('-5 days');
- $end = strtotime('-1 day');
- $list = $this->entryDao->getTimeEntriesByDate('consultant', $start, $end);
-
- $this->assertEqual(count($list),1);
-
- $this->assertSameEntry($list[0], $added[1]);
- }
-
- function testUserTimeReports()
- {
- $added = $this->createTimeEntries2();
- $this->entryDao->addNewTimeEntry($added[0]);
- $this->entryDao->addNewTimeEntry($added[1]);
-
- $time = $this->reportDao->getUserTimeReport('consultant');
- $this->assertEqual($time, 6.7);
- }
-
-
- function testTimeReportsByCategory()
- {
- $added = $this->createTimeEntries2();
- $this->entryDao->addNewTimeEntry($added[0]);
- $this->entryDao->addNewTimeEntry($added[1]);
-
- $list = $this->reportDao->getTimeReportsByCategoryID(1);
- $this->assertEqual(count($list),1);
- $this->assertEqual($list[0]->Username, 'consultant');
- $this->assertEqual($list[0]->ActualDuration, 1.2);
- }
-
- function testTimeReportsByProject()
- {
- $added = $this->createTimeEntries2();
- $this->entryDao->addNewTimeEntry($added[0]);
- $this->entryDao->addNewTimeEntry($added[1]);
-
- $list = $this->reportDao->getTimeReportsByProjectID(1);
-
- $this->assertEqual(count($list),1);
- $this->assertEqual($list[0]->Username, 'consultant');
- $this->assertEqual($list[0]->CategoryID, 1);
- $this->assertEqual($list[0]->ActualDuration, 6.7);
- }
-
}
?> \ No newline at end of file