From c7d41e5bea4a5f96979a08da9cc9f79355edfe70 Mon Sep 17 00:00:00 2001 From: wei <> Date: Sun, 16 Jul 2006 06:19:36 +0000 Subject: Update Time Tracker demo. --- .../protected/pages/Docs/TopicList.tpl | 2 +- .../protected/pages/Docs/WritingUnitTest.page | 43 ++++-- demos/time-tracker/protected/pages/Docs/config.xml | 12 +- demos/time-tracker/protected/pages/Docs/db.png | Bin 26879 -> 26521 bytes .../protected/pages/TimeTracker/Login.page | 38 +++++ .../protected/pages/TimeTracker/Login.php | 53 +++++++ .../protected/pages/TimeTracker/Logout.page | 0 .../protected/pages/TimeTracker/Logout.php | 34 +++++ .../protected/pages/TimeTracker/MainLayout.php | 7 + .../protected/pages/TimeTracker/MainLayout.tpl | 40 +++++ .../protected/pages/TimeTracker/SiteMap.php | 8 + .../protected/pages/TimeTracker/SiteMap.tpl | 43 ++++++ .../protected/pages/TimeTracker/UserCreate.page | 65 ++++++++ .../protected/pages/TimeTracker/UserCreate.php | 78 ++++++++++ .../protected/pages/TimeTracker/UserList.page | 3 + .../protected/pages/TimeTracker/config.xml | 24 +++ demos/time-tracker/protected/pages/Welcome.page | 168 +++++++++++++++++++++ 17 files changed, 598 insertions(+), 20 deletions(-) create mode 100644 demos/time-tracker/protected/pages/TimeTracker/Login.page create mode 100644 demos/time-tracker/protected/pages/TimeTracker/Login.php create mode 100644 demos/time-tracker/protected/pages/TimeTracker/Logout.page create mode 100644 demos/time-tracker/protected/pages/TimeTracker/Logout.php create mode 100644 demos/time-tracker/protected/pages/TimeTracker/MainLayout.php create mode 100644 demos/time-tracker/protected/pages/TimeTracker/MainLayout.tpl create mode 100644 demos/time-tracker/protected/pages/TimeTracker/SiteMap.php create mode 100644 demos/time-tracker/protected/pages/TimeTracker/SiteMap.tpl create mode 100644 demos/time-tracker/protected/pages/TimeTracker/UserCreate.page create mode 100644 demos/time-tracker/protected/pages/TimeTracker/UserCreate.php create mode 100644 demos/time-tracker/protected/pages/TimeTracker/UserList.page create mode 100644 demos/time-tracker/protected/pages/TimeTracker/config.xml create mode 100644 demos/time-tracker/protected/pages/Welcome.page (limited to 'demos/time-tracker/protected/pages') diff --git a/demos/time-tracker/protected/pages/Docs/TopicList.tpl b/demos/time-tracker/protected/pages/Docs/TopicList.tpl index 5fa2adb5..53243578 100644 --- a/demos/time-tracker/protected/pages/Docs/TopicList.tpl +++ b/demos/time-tracker/protected/pages/Docs/TopicList.tpl @@ -14,7 +14,7 @@
Before we begin to write our business logic and code, we shall +proceed with the path of test driven development (TDD), or at least take +some part of that process.
+Unit testing is a useful tool when we want to start to test our individual business logic classes. - The tests/unit directory will be used to hold the unit test cases and tests/functional directory -to hold the function test cases. + The tests/unit directory will be used to hold the unit test + cases and tests/functional directory + to hold the function test cases.
We will start be writing a very simple unit test case.
+We will start be writing a very simple unit test case. Notice +that we are writing the test case first.
Clicking on the ProjectTestCase.php like, you should see +
Clicking on the ProjectTestCase.php link, you should see
Obviously, we need create the class Project, so lets define the class.
+Since we only wrote the test case and nothing else we expected +that the test case will fail at some point. Obviously, we need create +a class Project, so lets define the Project class.
Save the above code as time-tracker/protected/pages/APP_CODE/Project.php. - Where the APP_CODE directory will contain most of your business logic code for the Time Tracker application.
-We also need to add the following line in our test case so as to include the Project class file when running the tests.
- --The statement Prado::using('Application.APP_CODE.Project') basically -loads the Project.php class file. It assumes that a class name Project has filename Project.php. -For futher details regarding Prado::using can be found in Prado Namespaces documentation. -
+We save the above code as time-tracker/protected/pages/APP_CODE/Project.php. + Where the APP_CODE directory will contain most of the business logic code + for the Time Tracker application.
+Now, we also need to add the following line in our test case so as to +include the Project class file when running the tests.
Run the unit test runner again, we see that the test has passed.
-Later on, we shall write more test cases. See the SimpleTest documentation for detailed tutorial on writing test cases.
+Later on, we shall write more test cases. See the +SimpleTest documentation +for detailed tutorial on writing test cases.