|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Removed extensions sniff test file |
|
4
|
|
|
* |
|
5
|
|
|
* @package PHPCompatibility |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* Removed extensions sniff tests |
|
11
|
|
|
* |
|
12
|
|
|
* @uses BaseSniffTest |
|
13
|
|
|
* @package PHPCompatibility |
|
14
|
|
|
* @author Jansen Price <[email protected]> |
|
15
|
|
|
*/ |
|
16
|
|
|
class RemovedExtensionsSniffTest extends BaseSniffTest |
|
17
|
|
|
{ |
|
18
|
|
|
/** |
|
19
|
|
|
* Sniffed file |
|
20
|
|
|
* |
|
21
|
|
|
* @var PHP_CodeSniffer_File |
|
22
|
|
|
*/ |
|
23
|
|
|
protected $_sniffFile; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* setUp |
|
27
|
|
|
* |
|
28
|
|
|
* @return void |
|
29
|
|
|
*/ |
|
30
|
|
|
public function setUp() |
|
31
|
|
|
{ |
|
32
|
|
|
parent::setUp(); |
|
33
|
|
|
|
|
34
|
|
|
$this->_sniffFile = $this->sniffFile('sniff-examples/removed_extensions.php'); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* testActiveScript |
|
39
|
|
|
* |
|
40
|
|
|
* @return void |
|
41
|
|
|
*/ |
|
42
|
|
|
public function testActiveScript() |
|
43
|
|
|
{ |
|
44
|
|
|
$this->assertError($this->_sniffFile, 3, "Extension 'activescript' is removed since PHP 5.3"); |
|
45
|
|
|
$this->assertError($this->_sniffFile, 4, "Extension 'activescript' is removed since PHP 5.3"); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* testCpdf |
|
50
|
|
|
* |
|
51
|
|
|
* @return void |
|
52
|
|
|
*/ |
|
53
|
|
|
public function testCpdf() |
|
54
|
|
|
{ |
|
55
|
|
|
$this->assertError($this->_sniffFile, 6, "Extension 'cpdf' is removed since PHP 5.3"); |
|
56
|
|
|
$this->assertError($this->_sniffFile, 7, "Extension 'cpdf' is removed since PHP 5.3"); |
|
57
|
|
|
$this->assertError($this->_sniffFile, 8, "Extension 'cpdf' is removed since PHP 5.3"); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* testDbase |
|
62
|
|
|
* |
|
63
|
|
|
* @return void |
|
64
|
|
|
*/ |
|
65
|
|
|
public function testDbase() |
|
66
|
|
|
{ |
|
67
|
|
|
$this->assertError($this->_sniffFile, 10, "Extension 'dbase' is removed since PHP 5.3"); |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* testDbx |
|
72
|
|
|
* |
|
73
|
|
|
* @return void |
|
74
|
|
|
*/ |
|
75
|
|
|
public function testDbx() |
|
76
|
|
|
{ |
|
77
|
|
|
$this->assertError($this->_sniffFile, 12, "Extension 'dbx' is removed since PHP 5.1"); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* testDio |
|
82
|
|
|
* |
|
83
|
|
|
* @return void |
|
84
|
|
|
*/ |
|
85
|
|
|
public function testDio() |
|
86
|
|
|
{ |
|
87
|
|
|
$this->assertError($this->_sniffFile, 14, "Extension 'dio' is removed since PHP 5.1"); |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* testFam |
|
92
|
|
|
* |
|
93
|
|
|
* @return void |
|
94
|
|
|
*/ |
|
95
|
|
|
public function testFam() |
|
96
|
|
|
{ |
|
97
|
|
|
$this->assertError($this->_sniffFile, 16, "Extension 'fam' is removed since PHP 5.1"); |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* testFbsql |
|
102
|
|
|
* |
|
103
|
|
|
* @return void |
|
104
|
|
|
*/ |
|
105
|
|
|
public function testFbsql() |
|
106
|
|
|
{ |
|
107
|
|
|
$this->assertError($this->_sniffFile, 18, "Extension 'fbsql' is removed since PHP 5.3"); |
|
108
|
|
|
} |
|
109
|
|
|
|
|
110
|
|
|
/** |
|
111
|
|
|
* testFdf |
|
112
|
|
|
* |
|
113
|
|
|
* @return void |
|
114
|
|
|
*/ |
|
115
|
|
|
public function testFdf() |
|
116
|
|
|
{ |
|
117
|
|
|
$this->assertError($this->_sniffFile, 20, "Extension 'fdf' is removed since PHP 5.3"); |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* testFilepro |
|
122
|
|
|
* |
|
123
|
|
|
* @return void |
|
124
|
|
|
*/ |
|
125
|
|
|
public function testFilepro() |
|
126
|
|
|
{ |
|
127
|
|
|
$this->assertError($this->_sniffFile, 22, "Extension 'filepro' is removed since PHP 5.2"); |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* testHwApi |
|
132
|
|
|
* |
|
133
|
|
|
* @return void |
|
134
|
|
|
*/ |
|
135
|
|
|
public function testHwApi() |
|
136
|
|
|
{ |
|
137
|
|
|
$this->assertError($this->_sniffFile, 24, "Extension 'hw_api' is removed since PHP 5.2"); |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* testIngres |
|
142
|
|
|
* |
|
143
|
|
|
* @return void |
|
144
|
|
|
*/ |
|
145
|
|
|
public function testIngres() |
|
146
|
|
|
{ |
|
147
|
|
|
$this->assertError($this->_sniffFile, 26, "Extension 'ingres' is removed since PHP 5.1"); |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
/** |
|
151
|
|
|
* testIrcg |
|
152
|
|
|
* |
|
153
|
|
|
* @return void |
|
154
|
|
|
*/ |
|
155
|
|
|
public function testIrcg() |
|
156
|
|
|
{ |
|
157
|
|
|
$this->assertError($this->_sniffFile, 28, "Extension 'ircg' is removed since PHP 5.3"); |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* testMcve |
|
162
|
|
|
* |
|
163
|
|
|
* @return void |
|
164
|
|
|
*/ |
|
165
|
|
|
public function testMcve() |
|
166
|
|
|
{ |
|
167
|
|
|
$this->assertError($this->_sniffFile, 30, "Extension 'mcve' is removed since PHP 5.1"); |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
/** |
|
171
|
|
|
* testMing |
|
172
|
|
|
* |
|
173
|
|
|
* @return void |
|
174
|
|
|
*/ |
|
175
|
|
|
public function testMing() |
|
176
|
|
|
{ |
|
177
|
|
|
$this->assertError($this->_sniffFile, 32, "Extension 'ming' is removed since PHP 5.3"); |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* testMnogosearch |
|
182
|
|
|
* |
|
183
|
|
|
* @return void |
|
184
|
|
|
*/ |
|
185
|
|
|
public function testMnogosearch() |
|
186
|
|
|
{ |
|
187
|
|
|
$this->assertError($this->_sniffFile, 34, "Extension 'mnogosearch' is removed since PHP 5.1"); |
|
188
|
|
|
} |
|
189
|
|
|
|
|
190
|
|
|
/** |
|
191
|
|
|
* testMsql |
|
192
|
|
|
* |
|
193
|
|
|
* @return void |
|
194
|
|
|
*/ |
|
195
|
|
|
public function testMsql() |
|
196
|
|
|
{ |
|
197
|
|
|
$this->assertError($this->_sniffFile, 36, "Extension 'msql' is removed since PHP 5.3"); |
|
198
|
|
|
} |
|
199
|
|
|
|
|
200
|
|
|
/** |
|
201
|
|
|
* testMysql |
|
202
|
|
|
* |
|
203
|
|
|
* @return void |
|
204
|
|
|
*/ |
|
205
|
|
|
public function testMysql() |
|
206
|
|
|
{ |
|
207
|
|
|
$file = $this->sniffFile('sniff-examples/removed_extensions.php', '5.4'); |
|
208
|
|
|
$this->assertNoViolation($file, 38); |
|
209
|
|
|
|
|
210
|
|
|
$file = $this->sniffFile('sniff-examples/removed_extensions.php', '5.5'); |
|
211
|
|
|
$this->assertWarning($file, 38, "Extension 'mysql_' is deprecated since PHP 5.5"); |
|
212
|
|
|
} |
|
213
|
|
|
|
|
214
|
|
|
/** |
|
215
|
|
|
* testNcurses |
|
216
|
|
|
* |
|
217
|
|
|
* @return void |
|
218
|
|
|
*/ |
|
219
|
|
|
public function testNcurses() |
|
220
|
|
|
{ |
|
221
|
|
|
$this->assertError($this->_sniffFile, 40, "Extension 'ncurses' is removed since PHP 5.3"); |
|
222
|
|
|
} |
|
223
|
|
|
|
|
224
|
|
|
/** |
|
225
|
|
|
* testOracle |
|
226
|
|
|
* |
|
227
|
|
|
* @return void |
|
228
|
|
|
*/ |
|
229
|
|
|
public function testOracle() |
|
230
|
|
|
{ |
|
231
|
|
|
$this->assertError($this->_sniffFile, 42, "Extension 'oracle' is removed since PHP 5.3"); |
|
232
|
|
|
} |
|
233
|
|
|
|
|
234
|
|
|
/** |
|
235
|
|
|
* testOvrimos |
|
236
|
|
|
* |
|
237
|
|
|
* @return void |
|
238
|
|
|
*/ |
|
239
|
|
|
public function testOvrimos() |
|
240
|
|
|
{ |
|
241
|
|
|
$this->assertError($this->_sniffFile, 44, "Extension 'ovrimos' is removed since PHP 5.1"); |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* testPfpro |
|
246
|
|
|
* |
|
247
|
|
|
* @return void |
|
248
|
|
|
*/ |
|
249
|
|
|
public function testPfpro() |
|
250
|
|
|
{ |
|
251
|
|
|
$this->assertError($this->_sniffFile, 46, "Extension 'pfpro' is removed since PHP 5.3"); |
|
252
|
|
|
} |
|
253
|
|
|
|
|
254
|
|
|
/** |
|
255
|
|
|
* testSqlite |
|
256
|
|
|
* |
|
257
|
|
|
* @return void |
|
258
|
|
|
*/ |
|
259
|
|
|
public function testSqlite() |
|
260
|
|
|
{ |
|
261
|
|
|
$this->assertError($this->_sniffFile, 48, "Extension 'sqlite' is removed since PHP 5.4"); |
|
262
|
|
|
} |
|
263
|
|
|
|
|
264
|
|
|
/** |
|
265
|
|
|
* testSybase |
|
266
|
|
|
* |
|
267
|
|
|
* @return void |
|
268
|
|
|
*/ |
|
269
|
|
|
public function testSybase() |
|
270
|
|
|
{ |
|
271
|
|
|
$this->assertError($this->_sniffFile, 50, "Extension 'sybase' is removed since PHP 5.3"); |
|
272
|
|
|
} |
|
273
|
|
|
|
|
274
|
|
|
/** |
|
275
|
|
|
* testW32api |
|
276
|
|
|
* |
|
277
|
|
|
* @return void |
|
278
|
|
|
*/ |
|
279
|
|
|
public function testW32api() |
|
280
|
|
|
{ |
|
281
|
|
|
$this->assertError($this->_sniffFile, 52, "Extension 'w32api' is removed since PHP 5.1"); |
|
282
|
|
|
} |
|
283
|
|
|
|
|
284
|
|
|
/** |
|
285
|
|
|
* testYp |
|
286
|
|
|
* |
|
287
|
|
|
* @return void |
|
288
|
|
|
*/ |
|
289
|
|
|
public function testYp() |
|
290
|
|
|
{ |
|
291
|
|
|
$this->assertError($this->_sniffFile, 54, "Extension 'yp' is removed since PHP 5.3"); |
|
292
|
|
|
} |
|
293
|
|
|
|
|
294
|
|
|
/** |
|
295
|
|
|
* testErege |
|
296
|
|
|
* |
|
297
|
|
|
* @return void |
|
298
|
|
|
*/ |
|
299
|
|
|
public function testEreg() |
|
300
|
|
|
{ |
|
301
|
|
|
$this->assertError($this->_sniffFile, 64, "Extension 'ereg' is removed since PHP 7.0"); |
|
302
|
|
|
} |
|
303
|
|
|
|
|
304
|
|
|
/** |
|
305
|
|
|
* testMssql |
|
306
|
|
|
* |
|
307
|
|
|
* @return void |
|
308
|
|
|
*/ |
|
309
|
|
|
public function testMssql() |
|
310
|
|
|
{ |
|
311
|
|
|
$this->assertError($this->_sniffFile, 62, "Extension 'mssql' is removed since PHP 7.0"); |
|
312
|
|
|
} |
|
313
|
|
|
|
|
314
|
|
|
/** |
|
315
|
|
|
* testNotAFunctionCall |
|
316
|
|
|
* |
|
317
|
|
|
* @return void |
|
318
|
|
|
*/ |
|
319
|
|
|
public function testNotAFunctionCall() |
|
320
|
|
|
{ |
|
321
|
|
|
$this->assertNoViolation($this->_sniffFile, 57); |
|
322
|
|
|
} |
|
323
|
|
|
|
|
324
|
|
|
/** |
|
325
|
|
|
* testFunctionDeclaration |
|
326
|
|
|
* |
|
327
|
|
|
* @return void |
|
328
|
|
|
*/ |
|
329
|
|
|
public function testFunctionDeclaration() |
|
330
|
|
|
{ |
|
331
|
|
|
$this->assertNoViolation($this->_sniffFile, 58); |
|
332
|
|
|
} |
|
333
|
|
|
|
|
334
|
|
|
/** |
|
335
|
|
|
* testNewClass |
|
336
|
|
|
* |
|
337
|
|
|
* @return void |
|
338
|
|
|
*/ |
|
339
|
|
|
public function testNewClass() |
|
340
|
|
|
{ |
|
341
|
|
|
$this->assertNoViolation($this->_sniffFile, 59); |
|
342
|
|
|
} |
|
343
|
|
|
|
|
344
|
|
|
/** |
|
345
|
|
|
* testMethod |
|
346
|
|
|
* |
|
347
|
|
|
* @return void |
|
348
|
|
|
*/ |
|
349
|
|
|
public function testMethod() |
|
350
|
|
|
{ |
|
351
|
|
|
$this->assertNoViolation($this->_sniffFile, 60); |
|
352
|
|
|
} |
|
353
|
|
|
} |
|
354
|
|
|
|