@@ -68,7 +68,7 @@ public function testAdapterShouldAllowAddingValidatorViaPluginManager()
68
68
{
69
69
$ this ->adapter ->addValidator ('Count ' , false , array ('min ' => 1 , 'max ' => 1 ));
70
70
$ test = $ this ->adapter ->getValidator ('Count ' );
71
- $ this ->assertTrue ( $ test instanceof FileValidator \ Count);
71
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Count' , $ test );
72
72
}
73
73
74
74
public function testAdapterhShouldRaiseExceptionWhenAddingInvalidValidatorType ()
@@ -90,16 +90,16 @@ public function testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothIns
90
90
);
91
91
$ this ->adapter ->addValidators ($ validators );
92
92
$ test = $ this ->adapter ->getValidators ();
93
- $ this ->assertTrue ( is_array ( $ test) );
93
+ $ this ->assertInternalType ( ' array ' , $ test );
94
94
$ this ->assertEquals (4 , count ($ test ), var_export ($ test , 1 ));
95
95
$ count = array_shift ($ test );
96
- $ this ->assertTrue ( $ count instanceof FileValidator \ Count);
96
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Count' , $ count );
97
97
$ exists = array_shift ($ test );
98
- $ this ->assertTrue ( $ exists instanceof FileValidator \ Exists);
98
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Exists' , $ exists );
99
99
$ size = array_shift ($ test );
100
- $ this ->assertTrue ( $ size instanceof FileValidator \ Upload);
100
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Upload' , $ size );
101
101
$ ext = array_shift ($ test );
102
- $ this ->assertTrue ( $ ext instanceof FileValidator \ Extension);
102
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Extension' , $ ext );
103
103
$ orig = array_pop ($ validators );
104
104
$ this ->assertSame ($ orig , $ ext );
105
105
}
@@ -115,7 +115,7 @@ public function testAdapterShouldAllowPullingValidatorsByFile()
115
115
$ validators = $ this ->adapter ->getValidators ('foo ' );
116
116
$ this ->assertEquals (1 , count ($ validators ));
117
117
$ validator = array_shift ($ validators );
118
- $ this ->assertTrue ( $ validator instanceof Validator \Between);
118
+ $ this ->assertInstanceOf ( ' Zend\ Validator\Between' , $ validator );
119
119
}
120
120
121
121
public function testCallingSetValidatorsOnAdapterShouldOverwriteExistingValidators ()
@@ -134,24 +134,24 @@ public function testAdapterShouldAllowRetrievingValidatorInstancesByClassName()
134
134
{
135
135
$ this ->testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothInstancesAndPluginLoader ();
136
136
$ ext = $ this ->adapter ->getValidator ('Zend\Validator\File\Extension ' );
137
- $ this ->assertTrue ( $ ext instanceof FileValidator \ Extension);
137
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Extension' , $ ext );
138
138
}
139
139
140
140
public function testAdapterShouldAllowRetrievingValidatorInstancesByPluginName ()
141
141
{
142
142
$ this ->testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothInstancesAndPluginLoader ();
143
143
$ count = $ this ->adapter ->getValidator ('Count ' );
144
- $ this ->assertTrue ( $ count instanceof FileValidator \ Count);
144
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Count' , $ count );
145
145
}
146
146
147
147
public function testAdapterShouldAllowRetrievingAllValidatorsAtOnce ()
148
148
{
149
149
$ this ->testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothInstancesAndPluginLoader ();
150
150
$ validators = $ this ->adapter ->getValidators ();
151
- $ this ->assertTrue ( is_array ( $ validators) );
151
+ $ this ->assertInternalType ( ' array ' , $ validators );
152
152
$ this ->assertEquals (4 , count ($ validators ));
153
153
foreach ($ validators as $ validator ) {
154
- $ this ->assertTrue ( $ validator instanceof Validator \ValidatorInterface);
154
+ $ this ->assertInstanceOf ( ' Zend\ Validator\ValidatorInterface' , $ validator );
155
155
}
156
156
}
157
157
@@ -187,7 +187,7 @@ public function testAdapterShouldAllowRemovingAllValidatorsAtOnce()
187
187
$ this ->testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothInstancesAndPluginLoader ();
188
188
$ this ->adapter ->clearValidators ();
189
189
$ validators = $ this ->adapter ->getValidators ();
190
- $ this ->assertTrue ( is_array ( $ validators) );
190
+ $ this ->assertInternalType ( ' array ' , $ validators );
191
191
$ this ->assertEquals (0 , count ($ validators ));
192
192
}
193
193
@@ -216,31 +216,31 @@ public function testValidationShouldThrowExceptionForNonexistentFile()
216
216
public function testErrorMessagesShouldBeEmptyByDefault ()
217
217
{
218
218
$ messages = $ this ->adapter ->getMessages ();
219
- $ this ->assertTrue ( is_array ( $ messages) );
219
+ $ this ->assertInternalType ( ' array ' , $ messages );
220
220
$ this ->assertEquals (0 , count ($ messages ));
221
221
}
222
222
223
223
public function testErrorMessagesShouldBePopulatedAfterInvalidTransfer ()
224
224
{
225
225
$ this ->testValidationShouldReturnFalseForInvalidTransfer ();
226
226
$ messages = $ this ->adapter ->getMessages ();
227
- $ this ->assertTrue ( is_array ( $ messages) );
228
- $ this ->assertFalse ( empty ( $ messages) );
227
+ $ this ->assertInternalType ( ' array ' , $ messages );
228
+ $ this ->assertNotEmpty ( $ messages );
229
229
}
230
230
231
231
public function testErrorCodesShouldBeNullByDefault ()
232
232
{
233
233
$ errors = $ this ->adapter ->getErrors ();
234
- $ this ->assertTrue ( is_array ( $ errors) );
234
+ $ this ->assertInternalType ( ' array ' , $ errors );
235
235
$ this ->assertEquals (0 , count ($ errors ));
236
236
}
237
237
238
238
public function testErrorCodesShouldBePopulatedAfterInvalidTransfer ()
239
239
{
240
240
$ this ->testValidationShouldReturnFalseForInvalidTransfer ();
241
241
$ errors = $ this ->adapter ->getErrors ();
242
- $ this ->assertTrue ( is_array ( $ errors) );
243
- $ this ->assertFalse ( empty ( $ errors) );
242
+ $ this ->assertInternalType ( ' array ' , $ errors );
243
+ $ this ->assertNotEmpty ( $ errors );
244
244
}
245
245
246
246
public function testAdapterShouldLazyLoadFilterPluginManager ()
@@ -261,7 +261,7 @@ public function testAdapterShouldAllowAddingFilterViaPluginManager()
261
261
{
262
262
$ this ->adapter ->addFilter ('StringTrim ' );
263
263
$ test = $ this ->adapter ->getFilter ('StringTrim ' );
264
- $ this ->assertTrue ( $ test instanceof Filter \StringTrim);
264
+ $ this ->assertInstanceOf ( ' Zend\ Filter\StringTrim' , $ test );
265
265
}
266
266
267
267
@@ -283,12 +283,12 @@ public function testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstan
283
283
);
284
284
$ this ->adapter ->addFilters ($ filters );
285
285
$ test = $ this ->adapter ->getFilters ();
286
- $ this ->assertTrue ( is_array ( $ test) );
286
+ $ this ->assertInternalType ( ' array ' , $ test );
287
287
$ this ->assertEquals (3 , count ($ test ), var_export ($ test , 1 ));
288
288
$ count = array_shift ($ test );
289
- $ this ->assertTrue ( $ count instanceof Word \SeparatorToCamelCase);
289
+ $ this ->assertInstanceOf ( ' Zend\Filter\ Word\SeparatorToCamelCase' , $ count );
290
290
$ size = array_shift ($ test );
291
- $ this ->assertTrue ( $ size instanceof Filter \Boolean);
291
+ $ this ->assertInstanceOf ( ' Zend\ Filter\Boolean' , $ size );
292
292
$ ext = array_shift ($ test );
293
293
$ orig = array_pop ($ filters );
294
294
$ this ->assertSame ($ orig , $ ext );
@@ -305,7 +305,7 @@ public function testAdapterShouldAllowPullingFiltersByFile()
305
305
$ filters = $ this ->adapter ->getFilters ('foo ' );
306
306
$ this ->assertEquals (1 , count ($ filters ));
307
307
$ filter = array_shift ($ filters );
308
- $ this ->assertTrue ( $ filter instanceof Filter \Boolean);
308
+ $ this ->assertInstanceOf ( ' Zend\ Filter\Boolean' , $ filter );
309
309
}
310
310
311
311
public function testCallingSetFiltersOnAdapterShouldOverwriteExistingFilters ()
@@ -324,24 +324,24 @@ public function testAdapterShouldAllowRetrievingFilterInstancesByClassName()
324
324
{
325
325
$ this ->testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstancesAndPluginLoader ();
326
326
$ ext = $ this ->adapter ->getFilter ('Zend\Filter\BaseName ' );
327
- $ this ->assertTrue ( $ ext instanceof Filter \BaseName);
327
+ $ this ->assertInstanceOf ( ' Zend\ Filter\BaseName' , $ ext );
328
328
}
329
329
330
330
public function testAdapterShouldAllowRetrievingFilterInstancesByPluginName ()
331
331
{
332
332
$ this ->testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstancesAndPluginLoader ();
333
333
$ count = $ this ->adapter ->getFilter ('Boolean ' );
334
- $ this ->assertTrue ( $ count instanceof Filter \Boolean);
334
+ $ this ->assertInstanceOf ( ' Zend\ Filter\Boolean' , $ count );
335
335
}
336
336
337
337
public function testAdapterShouldAllowRetrievingAllFiltersAtOnce ()
338
338
{
339
339
$ this ->testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstancesAndPluginLoader ();
340
340
$ filters = $ this ->adapter ->getFilters ();
341
- $ this ->assertTrue ( is_array ( $ filters) );
341
+ $ this ->assertInternalType ( ' array ' , $ filters );
342
342
$ this ->assertEquals (3 , count ($ filters ));
343
343
foreach ($ filters as $ filter ) {
344
- $ this ->assertTrue ( $ filter instanceof Filter \FilterInterface);
344
+ $ this ->assertInstanceOf ( ' Zend\ Filter\FilterInterface' , $ filter );
345
345
}
346
346
}
347
347
@@ -377,7 +377,7 @@ public function testAdapterShouldAllowRemovingAllFiltersAtOnce()
377
377
$ this ->testAdapterShouldAllowAddingMultipleFiltersAtOnceUsingBothInstancesAndPluginLoader ();
378
378
$ this ->adapter ->clearFilters ();
379
379
$ filters = $ this ->adapter ->getFilters ();
380
- $ this ->assertTrue ( is_array ( $ filters) );
380
+ $ this ->assertInternalType ( ' array ' , $ filters );
381
381
$ this ->assertEquals (0 , count ($ filters ));
382
382
}
383
383
@@ -386,7 +386,7 @@ public function testTransferDestinationShouldBeMutable()
386
386
$ directory = __DIR__ ;
387
387
$ this ->adapter ->setDestination ($ directory );
388
388
$ destinations = $ this ->adapter ->getDestination ();
389
- $ this ->assertTrue ( is_array ( $ destinations) );
389
+ $ this ->assertInternalType ( ' array ' , $ destinations );
390
390
foreach ($ destinations as $ file => $ destination ) {
391
391
$ this ->assertEquals ($ directory , $ destination );
392
392
}
@@ -402,10 +402,10 @@ public function testAdapterShouldAllowRetrievingDestinationsForAnArrayOfSpecifie
402
402
{
403
403
$ this ->adapter ->setDestination (__DIR__ );
404
404
$ destinations = $ this ->adapter ->getDestination (array ('bar ' , 'baz ' ));
405
- $ this ->assertTrue ( is_array ( $ destinations) );
405
+ $ this ->assertInternalType ( ' array ' , $ destinations );
406
406
$ directory = __DIR__ ;
407
407
foreach ($ destinations as $ file => $ destination ) {
408
- $ this ->assertTrue ( in_array ( $ file , array ('bar ' , 'baz ' ) ));
408
+ $ this ->assertContains ( $ file , array ('bar ' , 'baz ' ));
409
409
$ this ->assertEquals ($ directory , $ destination );
410
410
}
411
411
}
@@ -484,7 +484,7 @@ public function testAdapterShouldAllowRetrievingAllFileNames()
484
484
. DIRECTORY_SEPARATOR . '_files ' ;
485
485
$ this ->adapter ->setDestination ($ path );
486
486
$ files = $ this ->adapter ->getFileName ();
487
- $ this ->assertTrue ( is_array ( $ files) );
487
+ $ this ->assertInternalType ( ' array ' , $ files );
488
488
$ this ->assertEquals ($ path . DIRECTORY_SEPARATOR . 'bar.png ' , $ files ['bar ' ]);
489
489
}
490
490
@@ -494,7 +494,7 @@ public function testAdapterShouldAllowRetrievingAllFileNamesWithoutPath()
494
494
. DIRECTORY_SEPARATOR . '_files ' ;
495
495
$ this ->adapter ->setDestination ($ path );
496
496
$ files = $ this ->adapter ->getFileName (null , false );
497
- $ this ->assertTrue ( is_array ( $ files) );
497
+ $ this ->assertInternalType ( ' array ' , $ files );
498
498
$ this ->assertEquals ('bar.png ' , $ files ['bar ' ]);
499
499
}
500
500
@@ -514,13 +514,13 @@ public function testIgnoreHashValue()
514
514
public function testEmptyTempDirectoryDetection ()
515
515
{
516
516
$ this ->adapter ->tmpDir = "" ;
517
- $ this ->assertTrue ( empty ( $ this ->adapter ->tmpDir ) , "Empty temporary directory " );
517
+ $ this ->assertEmpty ( $ this ->adapter ->tmpDir , "Empty temporary directory " );
518
518
}
519
519
520
520
public function testTempDirectoryDetection ()
521
521
{
522
522
$ this ->adapter ->getTmpDir ();
523
- $ this ->assertTrue (! empty ( $ this ->adapter ->tmpDir ) , "Temporary directory filled " );
523
+ $ this ->assertNotEmpty ( $ this ->adapter ->tmpDir , "Temporary directory filled " );
524
524
}
525
525
526
526
public function testTemporaryDirectoryAccessDetection ()
@@ -592,7 +592,7 @@ public function testTransferDestinationAtNonExistingElement()
592
592
$ this ->assertEquals ($ directory , $ this ->adapter ->getDestination ('nonexisting ' ));
593
593
594
594
$ this ->setExpectedException ('Zend\File\Transfer\Exception\InvalidArgumentException ' , 'not find ' );
595
- $ this ->assertTrue ( is_string ( $ this ->adapter ->getDestination ('reallynonexisting ' ) ));
595
+ $ this ->assertInternalType ( ' string ' , $ this ->adapter ->getDestination ('reallynonexisting ' ));
596
596
}
597
597
598
598
/**
@@ -628,16 +628,16 @@ public function testAdapterShouldAllowAddingMultipleValidatorsAtOnceUsingBothIns
628
628
$ test = $ this ->adapter ->getValidators ('foo ' );
629
629
$ this ->assertEquals (2 , count ($ test ));
630
630
$ mimeType = array_shift ($ test );
631
- $ this ->assertTrue ( $ mimeType instanceof FileValidator \ MimeType);
631
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ MimeType' , $ mimeType );
632
632
$ filesSize = array_shift ($ test );
633
- $ this ->assertTrue ( $ filesSize instanceof FileValidator \ FilesSize);
633
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ FilesSize' , $ filesSize );
634
634
635
635
$ test = $ this ->adapter ->getValidators ('bar ' );
636
636
$ this ->assertEquals (2 , count ($ test ));
637
637
$ filesSize = array_shift ($ test );
638
- $ this ->assertTrue ( $ filesSize instanceof FileValidator \ Count);
638
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ Count' , $ filesSize );
639
639
$ mimeType = array_shift ($ test );
640
- $ this ->assertTrue ( $ mimeType instanceof FileValidator \ MimeType);
640
+ $ this ->assertInstanceOf ( ' Zend\Validator\File\ MimeType' , $ mimeType );
641
641
642
642
$ test = $ this ->adapter ->getValidators ('baz ' );
643
643
$ this ->assertEquals (0 , count ($ test ));
0 commit comments