From 143980b6dab8ad87c44518e5b7befb614fb83b85 Mon Sep 17 00:00:00 2001
From: wei <>
Date: Fri, 14 Jul 2006 06:56:16 +0000
Subject: Add time-tracker sample and docs. (Incomplete)
---
.../protected/pages/Docs/WritingUnitTest.page | 73 ++++++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 demos/time-tracker/protected/pages/Docs/WritingUnitTest.page
(limited to 'demos/time-tracker/protected/pages/Docs/WritingUnitTest.page')
diff --git a/demos/time-tracker/protected/pages/Docs/WritingUnitTest.page b/demos/time-tracker/protected/pages/Docs/WritingUnitTest.page
new file mode 100644
index 00000000..32c7bc79
--- /dev/null
+++ b/demos/time-tracker/protected/pages/Docs/WritingUnitTest.page
@@ -0,0 +1,73 @@
+ 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.
+ We will start be writing a very simple unit test case. Save the code as ProjectTestCase.php in the document_root/time-tracker/tests/unit/
+directory. Point your browser to your development server's unit test case runner, e.g.
+ http://web-server-address/time-tracker/tests/unit.php. You should see the following
+
+Writing a Unit Test
+Write a unit test case
+Run your first unit test case from your browser
+
Clicking on the ProjectTestCase.php like, you should see + +
+ + +Obviously, we need create the class Project, so lets define the 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. +
+ +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.
+ + \ No newline at end of file -- cgit v1.2.3