File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,17 @@ public function remove(string $path):void {
33
33
$ this ->pathList = array_values ($ this ->pathList );
34
34
}
35
35
36
+ public function containsDistinctFile ():bool {
37
+ foreach ($ this ->pathList as $ path ) {
38
+ $ fileName = pathinfo ($ path , PATHINFO_FILENAME );
39
+ if ($ fileName [0 ] !== "_ " ) {
40
+ return true ;
41
+ }
42
+ }
43
+
44
+ return false ;
45
+ }
46
+
36
47
public function current ():string {
37
48
return $ this ->pathList [$ this ->iteratorIndex ];
38
49
}
Original file line number Diff line number Diff line change @@ -65,4 +65,31 @@ public function testIterator():void {
65
65
self ::assertSame ($ pathList [$ i ], $ path );
66
66
}
67
67
}
68
+
69
+ public function testContainsDistincFile_allMagic ():void {
70
+ $ pathList = [
71
+ "/var/www/_header.html " ,
72
+ "/var/www/_footer.html " ,
73
+ ];
74
+ $ sut = new Assembly ();
75
+ foreach ($ pathList as $ path ) {
76
+ $ sut ->add ($ path );
77
+ }
78
+
79
+ self ::assertFalse ($ sut ->containsDistinctFile ());
80
+ }
81
+
82
+ public function testContainsDistinctFile ():void {
83
+ $ pathList = [
84
+ "/var/www/_header.html " ,
85
+ "/var/www/index.html " ,
86
+ "/var/www/_footer.html " ,
87
+ ];
88
+ $ sut = new Assembly ();
89
+ foreach ($ pathList as $ path ) {
90
+ $ sut ->add ($ path );
91
+ }
92
+
93
+ self ::assertTrue ($ sut ->containsDistinctFile ());
94
+ }
68
95
}
Original file line number Diff line number Diff line change 15
15
</testsuite >
16
16
</testsuites >
17
17
<logging />
18
- </phpunit >
18
+ </phpunit >
You can’t perform that action at this time.
0 commit comments