OSDN Git Service

0cc36282f109a7f7e5b91179c9331578610e9f60
[ethna/ethna.git] / skel / skel.action_test.php
1 <?php
2 /**
3  *  {$action_path}
4  *
5  *  @author     {$author}
6  *  @package    {$project_id}
7  *  @version    $Id$
8  */
9
10 /**
11  *  {$action_name} Form testcase.
12  *
13  *  @author     {$author}
14  *  @access     public
15  *  @package    {$project_id}
16  */
17 class {$action_form}_TestCase extends Ethna_UnitTestCase
18 {
19     /**
20      *  @access private
21      *  @var    string  Action name.
22      */
23     var $action_name = '{$action_name}';
24
25     /**
26      *  initialize test.
27      *
28      *  @access public
29      */
30     function setUp()
31     {
32         $this->createActionForm();  // create ActionForm.
33     }
34
35     /**
36      *  clean up testcase.
37      *
38      *  @access public
39      */
40     function tearDown()
41     {
42     }
43
44     /**
45      *  {$action_name} ActionForm sample testcase.
46      *
47      *  @access public
48      */
49     function test_formSample()
50     {
51         /*
52         // setting form input.
53         $this->af->set('id', 1);
54
55         // {$action_name} ActionForm input validation.
56         $this->assertEqual($this->af->validate(), 0);
57         */
58
59         /**
60          *  TODO: write test case! :)
61          *  @see http://simpletest.org/en/first_test_tutorial.html
62          *  @see http://simpletest.org/en/unit_test_documentation.html
63          */
64         $this->fail('No Test! write Test!');
65     }
66 }
67
68 /**
69  *  {$action_name} Action testcase.
70  *
71  *  @author     {$author}
72  *  @access     public
73  *  @package    {$project_id}
74  */
75 class {$action_class}_TestCase extends Ethna_UnitTestCase
76 {
77     /**
78      *  @access private
79      *  @var    string  Action name.
80      */
81     var $action_name = '{$action_name}';
82
83     /**
84      * initialize test.
85      *
86      * @access public
87      */
88     function setUp()
89     {
90         $this->createActionForm();  // create ActionForm.
91         $this->createActionClass(); // create ActionClass.
92
93         $this->session->start();    // start session.
94     }
95
96     /**
97      *  clean up testcase.
98      *
99      *  @access public
100      */
101     function tearDown()
102     {
103         $this->session->destroy();   // destroy session.
104     }
105
106     /**
107      *  {$action_name} ActionClass sample testcase.
108      *
109      *  @access public
110      */
111     function test_actionSample()
112     {
113         /*
114         // setting form input.
115         $this->af->set('id', 1);
116
117         // Authentication before processing {$action_name} Action.
118         $forward_name = $this->ac->authenticate();
119         $this->assertNull($forward_name);
120
121         // {$action_name} Action preprocess.
122         $forward_name = $this->ac->prepare();
123         $this->assertNull($forward_name);
124
125         // {$action_name} Action implementation.
126         $forward_name = $this->ac->perform();
127         $this->assertEqual($forward_name, '{$action_name}');
128         */
129
130         /**
131          *  TODO: write test case! :)
132          *  @see http://simpletest.org/en/first_test_tutorial.html
133          *  @see http://simpletest.org/en/unit_test_documentation.html
134          */
135         $this->fail('No Test! write Test!');
136     }
137 }
138
139 ?>