root/trunk/trax/test/ActiveRecordHelperTest.php

Revision 198, 10.4 KB (checked in by haas, 6 years ago)

DateHelper? docs and tests

  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1<?php
2/**
3 *  File for the ActiveRecordHelperTest class
4 *
5 * (PHP 5)
6 *
7 * @package PHPonTraxTest
8 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
9 * @copyright (c) Walter O. Haas 2006
10 * @version $Id$
11 * @author Walt Haas <haas@xmission.com>
12 */
13
14echo "testing ActiveRecordHelper\n";
15require_once 'testenv.php';
16
17//  We need to load a mock DB class to test ActiveRecordHelper
18//  Change the include path to put the mockDB/ directory first, so
19//  that when ActiveRecord loads it will pick up the mock class.
20@ini_set('include_path','./mockDB:'.ini_get('include_path'));
21require_once "active_record.php";
22
23// Call ActiveRecordErrorTest::main() if this source file is executed directly.
24if (!defined("PHPUnit2_MAIN_METHOD")) {
25    define("PHPUnit2_MAIN_METHOD", "ActiveRecordHelperTest::main");
26}
27
28require_once "PHPUnit2/Framework/TestCase.php";
29require_once "PHPUnit2/Framework/TestSuite.php";
30
31// You may remove the following line when all tests have been implemented.
32require_once "PHPUnit2/Framework/IncompleteTestError.php";
33
34//  root Trax files in the test directory
35define("TRAX_ROOT", dirname(__FILE__) . "/");
36define("TRAX_VIEWS_EXTENTION",  "phtml");
37$GLOBALS['TRAX_INCLUDES'] =
38    array( "config"      => "config",
39           "controllers" => "controllers",
40           "helpers"     => "helpers",
41           "layouts"     => "layouts",
42           "views"       => "views");
43
44require_once "action_view/helpers.php";
45require_once "action_view/helpers/active_record_helper.php";
46require_once "router.php";
47require_once 'trax_exceptions.php';
48require_once 'inflector.php';
49require_once 'action_controller.php';
50
51// Set Trax operating mode
52define("TRAX_MODE",   "development");
53
54class DataType extends ActiveRecord {}
55
56/**
57 * Test class for ActiveRecordHelper.
58 * Generated by PHPUnit2_Util_Skeleton on 2006-03-01 at 13:17:40.
59 */
60class ActiveRecordHelperTest extends PHPUnit2_Framework_TestCase {
61    /**
62     * Runs the test methods of this class.
63     *
64     * @access public
65     * @static
66     */
67    public static function main() {
68        require_once "PHPUnit2/TextUI/TestRunner.php";
69
70        $suite  = new PHPUnit2_Framework_TestSuite("ActiveRecordHelperTest");
71        $result = PHPUnit2_TextUI_TestRunner::run($suite);
72    }
73
74    /**
75     * Sets up the fixture, for example, open a network connection.
76     * This method is called before a test is executed.
77     *
78     * @access protected
79     */
80    protected function setUp() {
81
82        //  Force constructor to get a connection
83        $GLOBALS['ACTIVE_RECORD_DB'] = null;
84
85        // Set up information that normally comes from database.ini
86        $GLOBALS['TRAX_DB_SETTINGS'][TRAX_MODE]
87            = array('phptype'    => 'mysql',
88                    'database'   => 'database_development',
89                    'hostspec'   => 'localhost',
90                    'username'   => 'root',
91                    'password'   => '',
92                    'persistent' => true);
93    }
94
95    /**
96     * Tears down the fixture, for example, close a network connection.
97     * This method is called after a test is executed.
98     *
99     * @access protected
100     */
101    protected function tearDown() {
102    }
103
104    /**
105     * @todo Implement testInput_method().
106     */
107    public function testInput_method() {
108        // Remove the following line when you implement this test.
109        throw new PHPUnit2_Framework_IncompleteTestError;
110    }
111
112    /**
113     * @todo Implement testInput_function().
114     */
115    public function testInput_function() {
116        // Remove the following line when you implement this test.
117        throw new PHPUnit2_Framework_IncompleteTestError;
118    }
119
120    /**
121     * @todo Implement testInput_scaffolding_method().
122     */
123    public function testInput_scaffolding_method() {
124        // Remove the following line when you implement this test.
125        throw new PHPUnit2_Framework_IncompleteTestError;
126    }
127
128    /**
129     * @todo Implement testInput_scaffolding_function().
130     */
131    public function testInput_scaffolding_function() {
132        // Remove the following line when you implement this test.
133        throw new PHPUnit2_Framework_IncompleteTestError;
134    }
135
136    /**
137     * @todo Implement testForm_method().
138     */
139    public function testForm_method() {
140        // Remove the following line when you implement this test.
141        throw new PHPUnit2_Framework_IncompleteTestError;
142    }
143
144    /**
145     * @todo Implement testForm_function().
146     */
147    public function testForm_function() {
148        // Remove the following line when you implement this test.
149        throw new PHPUnit2_Framework_IncompleteTestError;
150    }
151
152    /**
153     * @todo Implement testError_message_on_method().
154     */
155    public function testError_message_on_method() {
156        // Remove the following line when you implement this test.
157        throw new PHPUnit2_Framework_IncompleteTestError;
158    }
159
160    /**
161     * @todo Implement testError_message_on_function().
162     */
163    public function testError_message_on_function() {
164        // Remove the following line when you implement this test.
165        throw new PHPUnit2_Framework_IncompleteTestError;
166    }
167
168    /**
169     * @todo Implement testError_messages_for_method().
170     */
171    public function testError_messages_for_method() {
172        // Remove the following line when you implement this test.
173        throw new PHPUnit2_Framework_IncompleteTestError;
174    }
175
176    /**
177     * @todo Implement testError_messages_for_function().
178     */
179    public function testError_messages_for_function() {
180        // Remove the following line when you implement this test.
181        throw new PHPUnit2_Framework_IncompleteTestError;
182    }
183
184    /**
185     * @todo Implement testAll_input_tags().
186     */
187    public function testAll_input_tags() {
188        $ar = new ActionController;
189        $GLOBALS['current_controller_object'] = $ar;
190        $dt = new DataType;
191        $ar->DataType = $dt;
192        $arh = new ActiveRecordHelper();
193        $arh->scaffolding = true;
194        echo "calling all_input_tags()\n";
195        echo $arh->all_input_tags($dt, 'DataType', array()); 
196
197
198
199        // Remove the following line when you implement this test.
200        throw new PHPUnit2_Framework_IncompleteTestError;
201    }
202
203    /**
204     * @todo Implement testDefault_input_block().
205     */
206    public function testDefault_input_block() {
207        // Remove the following line when you implement this test.
208        throw new PHPUnit2_Framework_IncompleteTestError;
209    }
210
211    /**
212     * @todo Implement testTo_tag().
213     */
214    public function testTo_tag() {
215        // Remove the following line when you implement this test.
216        throw new PHPUnit2_Framework_IncompleteTestError;
217    }
218
219    /**
220     * @todo Implement testTo_scaffold_tag().
221     */
222    public function testTo_scaffold_tag() {
223        // Remove the following line when you implement this test.
224        throw new PHPUnit2_Framework_IncompleteTestError;
225    }
226
227    /**
228     * @todo Implement testTag_without_error_wrapping().
229     */
230    public function testTag_without_error_wrapping() {
231        // Remove the following line when you implement this test.
232        throw new PHPUnit2_Framework_IncompleteTestError;
233    }
234
235    /**
236     * @todo Implement testTag().
237     */
238    public function testTag() {
239        // Remove the following line when you implement this test.
240        throw new PHPUnit2_Framework_IncompleteTestError;
241    }
242
243    /**
244     * @todo Implement testContent_tag_without_error_wrapping().
245     */
246    public function testContent_tag_without_error_wrapping() {
247        // Remove the following line when you implement this test.
248        throw new PHPUnit2_Framework_IncompleteTestError;
249    }
250
251    /**
252     * @todo Implement testContent_tag().
253     */
254    public function testContent_tag() {
255        // Remove the following line when you implement this test.
256        throw new PHPUnit2_Framework_IncompleteTestError;
257    }
258
259    /**
260     * @todo Implement testTo_date_select_tag_without_error_wrapping().
261     */
262    public function testTo_date_select_tag_without_error_wrapping() {
263        // Remove the following line when you implement this test.
264        throw new PHPUnit2_Framework_IncompleteTestError;
265    }
266
267    /**
268     * @todo Implement testTo_date_select_tag().
269     */
270    public function testTo_date_select_tag() {
271        // Remove the following line when you implement this test.
272        throw new PHPUnit2_Framework_IncompleteTestError;
273    }
274
275    /**
276     * @todo Implement testTo_datetime_select_tag_without_error_wrapping().
277     */
278    public function testTo_datetime_select_tag_without_error_wrapping() {
279        // Remove the following line when you implement this test.
280        throw new PHPUnit2_Framework_IncompleteTestError;
281    }
282
283    /**
284     * @todo Implement testTo_datetime_select_tag().
285     */
286    public function testTo_datetime_select_tag() {
287        // Remove the following line when you implement this test.
288        throw new PHPUnit2_Framework_IncompleteTestError;
289    }
290
291    /**
292     * @todo Implement testError_wrapping().
293     */
294    public function testError_wrapping() {
295        // Remove the following line when you implement this test.
296        throw new PHPUnit2_Framework_IncompleteTestError;
297    }
298
299    /**
300     * @todo Implement testError_message().
301     */
302    public function testError_message() {
303        // Remove the following line when you implement this test.
304        throw new PHPUnit2_Framework_IncompleteTestError;
305    }
306
307    /**
308     * @todo Implement testColumn_type().
309     */
310    public function testColumn_type() {
311        // Remove the following line when you implement this test.
312        throw new PHPUnit2_Framework_IncompleteTestError;
313    }
314
315    /**
316     * @todo Implement testInput().
317     */
318    public function testInput() {
319        // Remove the following line when you implement this test.
320        throw new PHPUnit2_Framework_IncompleteTestError;
321    }
322
323
324}
325
326// Call ActiveRecordHelperTest::main() if this source file is executed directly.
327if (PHPUnit2_MAIN_METHOD == "ActiveRecordHelperTest::main") {
328    ActiveRecordHelperTest::main();
329}
330
331// -- set Emacs parameters --
332// Local variables:
333// tab-width: 4
334// c-basic-offset: 4
335// c-hanging-comment-ender-p: nil
336// indent-tabs-mode: nil
337// End:
338?>
Note: See TracBrowser for help on using the browser.