diff options
author | wei <> | 2006-07-16 06:19:36 +0000 |
---|---|---|
committer | wei <> | 2006-07-16 06:19:36 +0000 |
commit | c7d41e5bea4a5f96979a08da9cc9f79355edfe70 (patch) | |
tree | 8f21cba052c1eae7c7204ac272dd8c5e9d6fe110 /demos/time-tracker/tests/unit/CreateNewProjectTestCase.php | |
parent | af68030fcf0c266300feb2c100149ecadef7d364 (diff) |
Update Time Tracker demo.
Diffstat (limited to 'demos/time-tracker/tests/unit/CreateNewProjectTestCase.php')
-rw-r--r-- | demos/time-tracker/tests/unit/CreateNewProjectTestCase.php | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/demos/time-tracker/tests/unit/CreateNewProjectTestCase.php b/demos/time-tracker/tests/unit/CreateNewProjectTestCase.php deleted file mode 100644 index 0aa67405..00000000 --- a/demos/time-tracker/tests/unit/CreateNewProjectTestCase.php +++ /dev/null @@ -1,90 +0,0 @@ -<?php
-
-require_once(dirname(__FILE__).'/ProjectDaoTestCase.php');
-
-class CreateNewProjectTestCase extends ProjectDaoTestCase
-{
- function testProjectDaoCanCreateNewProject()
- {
- $project = $this->createNewTestProject();
-
- if(($conn = $this->connection) instanceof MockTSqlMapper)
- {
- $this->setupMockConnectionFor($project);
- $conn->expectMinimumCallCount('queryForObject', 3);
- $conn->expectAtLeastOnce('insert');
- }
-
- $this->assertProjectCreated($project);
- }
-
- function testProjectExistsException()
- {
- $project = $this->createNewTestProject();
-
- if(($conn = $this->connection) instanceof MockTSqlMapper)
- {
- //make the project exist
- $conn->setReturnValue('queryForObject',
- $project, array('GetProjectByName', 'Project 1'));
- $this->setupMockConnectionFor($project);
- }
-
- try
- {
- $this->assertProjectCreated($project);
- $this->fail();
- }
- catch(TimeTrackerException $e)
- {
- $this->pass();
- }
- }
- function testProjectCustomerNotExistsException()
- {
- $project = $this->createNewTestProject();
-
- if(($conn = $this->connection) instanceof MockTSqlMapper)
- {
- //customer does not exist
- $conn->setReturnValue('queryForObject',
- null, array('GetUserByName', 'Customer A'));
- $this->setupMockConnectionFor($project);
- }
-
- try
- {
- $this->assertProjectCreated($project);
- $this->fail();
- }
- catch(TimeTrackerException $e)
- {
- $this->pass();
- }
- }
-
- function testProjectManagerNotExistsException()
- {
- $project = $this->createNewTestProject();
-
- if(($conn = $this->connection) instanceof MockTSqlMapper)
- {
- //manager does not exist
- $conn->setReturnValue('queryForObject',
- null, array('GetUserByName', 'Manager A'));
- $this->setupMockConnectionFor($project);
- }
-
- try
- {
- $this->assertProjectCreated($project);
- $this->fail();
- }
- catch(TimeTrackerException $e)
- {
- $this->pass();
- }
- }
-}
-
-?>
\ No newline at end of file |