You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user_guide_src/source/testing/overview.rst
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -69,14 +69,22 @@ By default, test files are placed under the **tests** directory in the project r
69
69
The Test Class
70
70
==============
71
71
72
-
In order to take advantage of the additional tools provided, your tests must extend ``CIUnitTestCase``. All tests
73
-
are expected to be located in the **tests/app** directory by default.
72
+
In order to take advantage of the additional tools provided, your tests must extend
73
+
``CIUnitTestCase``.
74
74
75
-
To test a new library, **Foo**, you would create a new file at **tests/app/Libraries/FooTest.php**:
75
+
There are no rules for how test files must be placed. However, we recommend that
76
+
you establish placement rules in advance so that you can quickly understand where
77
+
the test files are located.
78
+
79
+
In this document, we will place the test files corresponding to the classes in
80
+
the **app** directory in the **tests/app** directory. To test a new library,
81
+
**app/Libraries/Foo.php**, you would create a new file at
82
+
**tests/app/Libraries/FooTest.php**:
76
83
77
84
.. literalinclude:: overview/001.php
78
85
79
-
To test one of your models, you might end up with something like this in **tests/app/Models/OneOfMyModelsTest.php**:
86
+
To test one of your models, **app/Models/UserMode.php**, you might end up with
87
+
something like this in **tests/app/Models/UserModelTest.php**:
80
88
81
89
.. literalinclude:: overview/002.php
82
90
@@ -103,7 +111,7 @@ to help with staging and clean up::
103
111
The static methods ``setUpBeforeClass()`` and ``tearDownAfterClass()`` run before and after the entire test case, whereas the protected methods ``setUp()`` and ``tearDown()`` run
104
112
between each test.
105
113
106
-
If you implement any of these special functions make sure you run their
114
+
If you implement any of these special functions, make sure you run their
107
115
parent as well so extended test cases do not interfere with staging:
0 commit comments