@@ -415,6 +415,142 @@ public static function provider(): array
415415 ),
416416 ),
417417 ],
418+ 'file in hidden directory is not included ' => [
419+ [
420+ self ::fixturePath ('a/c/.hidden/PrefixSuffix.php ' ) => false ,
421+ ],
422+ self ::createSource (
423+ includeDirectories: FilterDirectoryCollection::fromArray (
424+ [
425+ new FilterDirectory (self ::fixturePath (), '' , '.php ' ),
426+ ],
427+ ),
428+ ),
429+ ],
430+ 'files included using directory and prefix ' => [
431+ [
432+ self ::fixturePath ('b/e/PrefixExampleSuffix.php ' ) => true ,
433+ self ::fixturePath ('a/PrefixSuffix.php ' ) => false ,
434+ self ::fixturePath ('a/c/PrefixSuffix.php ' ) => false ,
435+ ],
436+ self ::createSource (
437+ includeDirectories: FilterDirectoryCollection::fromArray (
438+ [
439+ new FilterDirectory (self ::fixturePath (), 'PrefixExample ' , '.php ' ),
440+ ],
441+ ),
442+ ),
443+ ],
444+ 'files included using directory and suffix ' => [
445+ [
446+ self ::fixturePath ('b/e/PrefixExampleSuffix.php ' ) => true ,
447+ self ::fixturePath ('a/PrefixSuffix.php ' ) => false ,
448+ self ::fixturePath ('a/c/Prefix.php ' ) => false ,
449+ ],
450+ self ::createSource (
451+ includeDirectories: FilterDirectoryCollection::fromArray (
452+ [
453+ new FilterDirectory (self ::fixturePath (), '' , 'ExampleSuffix.php ' ),
454+ ],
455+ ),
456+ ),
457+ ],
458+ 'files excluded using directory and prefix ' => [
459+ [
460+ self ::fixturePath ('a/c/Suffix.php ' ) => true ,
461+ self ::fixturePath ('a/c/d/Suffix.php ' ) => true ,
462+ self ::fixturePath ('a/c/PrefixSuffix.php ' ) => false ,
463+ self ::fixturePath ('a/c/d/PrefixSuffix.php ' ) => false ,
464+ self ::fixturePath ('a/PrefixSuffix.php ' ) => false ,
465+ ],
466+ self ::createSource (
467+ includeDirectories: FilterDirectoryCollection::fromArray (
468+ [
469+ new FilterDirectory (self ::fixturePath (), '' , '.php ' ),
470+ ],
471+ ),
472+ excludeDirectories: FilterDirectoryCollection::fromArray (
473+ [
474+ new FilterDirectory (self ::fixturePath (), 'Prefix ' , '.php ' ),
475+ ],
476+ ),
477+ ),
478+ ],
479+ 'files excluded using directory and suffix ' => [
480+ [
481+ self ::fixturePath ('a/c/Prefix.php ' ) => true ,
482+ self ::fixturePath ('a/c/d/Prefix.php ' ) => true ,
483+ self ::fixturePath ('a/c/PrefixSuffix.php ' ) => false ,
484+ self ::fixturePath ('a/c/d/PrefixSuffix.php ' ) => false ,
485+ self ::fixturePath ('a/PrefixSuffix.php ' ) => false ,
486+ ],
487+ self ::createSource (
488+ includeDirectories: FilterDirectoryCollection::fromArray (
489+ [
490+ new FilterDirectory (self ::fixturePath (), '' , '.php ' ),
491+ ],
492+ ),
493+ excludeDirectories: FilterDirectoryCollection::fromArray (
494+ [
495+ new FilterDirectory (self ::fixturePath (), '' , 'Suffix.php ' ),
496+ ],
497+ ),
498+ ),
499+ ],
500+ 'files included using same directory and different suffixes ' => [
501+ [
502+ self ::fixturePath ('a/c/Prefix.php ' ) => true ,
503+ self ::fixturePath ('a/c/d/Prefix.php ' ) => true ,
504+ self ::fixturePath ('b/e/PrefixExampleSuffix.php ' ) => true ,
505+ self ::fixturePath ('a/PrefixSuffix.php ' ) => false ,
506+ ],
507+ self ::createSource (
508+ includeDirectories: FilterDirectoryCollection::fromArray (
509+ [
510+ new FilterDirectory (self ::fixturePath (), '' , 'ExampleSuffix.php ' ),
511+ new FilterDirectory (self ::fixturePath (), '' , 'Prefix.php ' ),
512+ ],
513+ ),
514+ ),
515+ ],
516+ 'files included using same directory and different prefixes ' => [
517+ [
518+ self ::fixturePath ('a/c/Suffix.php ' ) => true ,
519+ self ::fixturePath ('a/c/d/Suffix.php ' ) => true ,
520+ self ::fixturePath ('b/e/PrefixExampleSuffix.php ' ) => true ,
521+ self ::fixturePath ('a/PrefixSuffix.php ' ) => false ,
522+ ],
523+ self ::createSource (
524+ includeDirectories: FilterDirectoryCollection::fromArray (
525+ [
526+ new FilterDirectory (self ::fixturePath (), 'Suffix ' , '.php ' ),
527+ new FilterDirectory (self ::fixturePath (), 'PrefixExample ' , '.php ' ),
528+ ],
529+ ),
530+ ),
531+ ],
532+ 'files excluded using same directory and different prefixes ' => [
533+ [
534+ self ::fixturePath ('a/PrefixSuffix.php ' ) => false ,
535+ self ::fixturePath ('a/c/PrefixSuffix.php ' ) => false ,
536+ self ::fixturePath ('a/c/Suffix.php ' ) => false ,
537+ self ::fixturePath ('a/c/d/PrefixSuffix.php ' ) => false ,
538+ self ::fixturePath ('a/c/d/Suffix.php ' ) => false ,
539+ ],
540+ self ::createSource (
541+ includeDirectories: FilterDirectoryCollection::fromArray (
542+ [
543+ new FilterDirectory (self ::fixturePath (), '' , '.php ' ),
544+ ],
545+ ),
546+ excludeDirectories: FilterDirectoryCollection::fromArray (
547+ [
548+ new FilterDirectory (self ::fixturePath (), 'Prefix ' , '.php ' ),
549+ new FilterDirectory (self ::fixturePath (), 'Suffix ' , '.php ' ),
550+ ],
551+ ),
552+ ),
553+ ],
418554 ];
419555 }
420556
0 commit comments