-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpunitgen.php
More file actions
220 lines (199 loc) · 7.85 KB
/
phpunitgen.php
File metadata and controls
220 lines (199 loc) · 7.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?php
// ./ow_libraries/vendor/bin/phpunitgen . ow_unittest/
use PhpUnitGen\Core\Generators\Tests\DelegateTestGenerator;
return [
/*
|--------------------------------------------------------------------------
| Overwrite files.
|
| Tells if the generator should overwrite existing files with generated
| tests files.
|--------------------------------------------------------------------------
*/
'overwriteFiles' => false,
/*
|--------------------------------------------------------------------------
| Backup files.
|
| Tells if the generator should backup the existing files which will be
| overwritten (useful when "overwriteFile" is enabled).
|--------------------------------------------------------------------------
*/
'backupFiles' => true,
/*
|--------------------------------------------------------------------------
| Excluded files.
|
| Files matching this regex will not have tests generation. This must
| be an array of RegExp compatible with "preg_match", but without the
| opening and closing "/", as they will be added automatically.
|--------------------------------------------------------------------------
*/
'excludedFiles' => [],
/*
|--------------------------------------------------------------------------
| Included files.
|
| Only files matching this regex will have tests generation. This must
| be an array of RegExp compatible with "preg_match", but without the
| opening and closing "/", as they will be added automatically.
|--------------------------------------------------------------------------
*/
'includedFiles' => [
'\.php$',
],
/*
|--------------------------------------------------------------------------
| Generation on Make.
|
| Tells if calling a framework "make" command should call PhpUnitGen to
| generate the associated tests. Only works with Laravel for the moment.
|--------------------------------------------------------------------------
*/
'generateOnMake' => true,
/*
|--------------------------------------------------------------------------
| Automatic Generation.
|
| Tells if the generator should create tested class instantiation and
| complex tests skeleton (getter/setter tests...).
|--------------------------------------------------------------------------
*/
'automaticGeneration' => true,
/*
|--------------------------------------------------------------------------
| Contract implementations to use.
|
| Tells which implementation you want to use when PhpUnitGen requires a
| specific contract. Please see
| https://phpunitgen.io/docs#/en/configuration?id=implementations-to-use
|--------------------------------------------------------------------------
*/
'implementations' => DelegateTestGenerator::implementations(),
/*
|--------------------------------------------------------------------------
| Base Namespace of source code.
|
| This string will be removed from the test class namespace.
|--------------------------------------------------------------------------
*/
'baseNamespace' => 'App',
/*
|--------------------------------------------------------------------------
| Base Namespace of tests.
|
| This string will be prepend to the test class namespace.
|--------------------------------------------------------------------------
*/
'baseTestNamespace' => 'Tests',
/*
|--------------------------------------------------------------------------
| Test Case.
|
| The absolute class name to TestCase.
|--------------------------------------------------------------------------
*/
'testCase' => 'Tests\\TestCase',
/*
|--------------------------------------------------------------------------
| Test class final.
|
| Tells if the test class should be final.
|--------------------------------------------------------------------------
*/
'testClassFinal' => true,
/*
|--------------------------------------------------------------------------
| Test class strict types.
|
| Tells if the test class should declare strict types.
|--------------------------------------------------------------------------
*/
'testClassStrictTypes' => false,
/*
|--------------------------------------------------------------------------
| Test class typed properties.
|
| Tells if the test class properties should be typed or documented.
|--------------------------------------------------------------------------
*/
'testClassTypedProperties' => true,
/*
|--------------------------------------------------------------------------
| Excluded methods.
|
| Those methods will not have tests or skeleton generation. This must be an
| array of RegExp compatible with "preg_match", but without the opening and
| closing "/", as they will be added automatically.
|--------------------------------------------------------------------------
*/
'excludedMethods' => [
'__construct',
'__destruct',
],
/*
|--------------------------------------------------------------------------
| Merged PHP documentation tags.
|
| Those tags will be retrieved from tested class documentation, and appends
| to the test class documentation.
|--------------------------------------------------------------------------
*/
'mergedPhpDoc' => [
'author',
'copyright',
'license',
'version',
],
/*
|--------------------------------------------------------------------------
| PHP documentation lines.
|
| Those complete documentation line (such as "@author John Doe") will be
| added to the test class documentation.
|--------------------------------------------------------------------------
*/
'phpDoc' => [],
/*
|--------------------------------------------------------------------------
| PHP header documentation lines.
|
| The documentation header to append to generated files.
| Should be a full documentation content (with lines breaks, opening tags,
| etc.) or an empty string to disable printing a documentation header.
|--------------------------------------------------------------------------
*/
'phpHeaderDoc' => '',
/*
|--------------------------------------------------------------------------
| Options.
|
| This property is for generator's specific configurations. It might
| contains any other useful information for test generation.
|--------------------------------------------------------------------------
*/
'options' => [
/*
|----------------------------------------------------------------------
| Context.
|
| Tells the DelegateTestGenerator (default one) that we are in a
| specific project context. If defined to "null", it will used basic
| generators. If set to "laravel", it will use the Laravel tests
| generators.
|----------------------------------------------------------------------
*/
// 'context' => 'laravel',
/*
|----------------------------------------------------------------------
| Laravel Options.
|
| Those options are used by Laravel Test Generators and are nested in
| a "laravel." namespace.
| - "user" is the class of User Eloquent model, since it will be used
| in many tests.
|----------------------------------------------------------------------
*/
// 'laravel.user' => 'App\\User',
],
];