@@ -82,7 +82,7 @@ protected function setUp(): void
8282 ];
8383 }
8484
85- public function testAddingAFileToTheWhitelistWorks (): void
85+ public function testSingleFileCanBeAdded (): void
8686 {
8787 $ this ->filter ->includeFile ($ this ->files [0 ]);
8888
@@ -92,54 +92,48 @@ public function testAddingAFileToTheWhitelistWorks(): void
9292 );
9393 }
9494
95- public function testRemovingAFileFromTheWhitelistWorks (): void
95+ public function testMultipleFilesCanBeAdded (): void
9696 {
97- $ this ->filter ->includeFile ($ this ->files [0 ]);
98- $ this ->filter ->excludeFile ($ this ->files [0 ]);
97+ $ files = (new FileIteratorFacade )->getFilesAsArray (
98+ TEST_FILES_PATH ,
99+ $ suffixes = '.php '
100+ );
99101
100- $ this ->assertEquals ([], $ this ->filter ->files ());
102+ $ this ->filter ->includeFiles ($ files );
103+
104+ $ files = $ this ->filter ->files ();
105+ sort ($ files );
106+
107+ $ this ->assertEquals ($ this ->files , $ files );
101108 }
102109
103- /**
104- * @depends testAddingAFileToTheWhitelistWorks
105- */
106- public function testAddingADirectoryToTheWhitelistWorks (): void
110+ public function testDirectoryCanBeAdded (): void
107111 {
108112 $ this ->filter ->includeDirectory (TEST_FILES_PATH );
109113
110- $ whitelist = $ this ->filter ->files ();
111- sort ($ whitelist );
114+ $ files = $ this ->filter ->files ();
115+ sort ($ files );
112116
113- $ this ->assertEquals ($ this ->files , $ whitelist );
117+ $ this ->assertEquals ($ this ->files , $ files );
114118 }
115119
116- public function testAddingFilesToTheWhitelistWorks (): void
120+ public function testSingleFileCanBeRemoved (): void
117121 {
118- $ files = (new FileIteratorFacade )->getFilesAsArray (
119- TEST_FILES_PATH ,
120- $ suffixes = '.php '
121- );
122-
123- $ this ->filter ->includeFiles ($ files );
124-
125- $ whitelist = $ this ->filter ->files ();
126- sort ($ whitelist );
122+ $ this ->filter ->includeFile ($ this ->files [0 ]);
123+ $ this ->filter ->excludeFile ($ this ->files [0 ]);
127124
128- $ this ->assertEquals ($ this ->files , $ whitelist );
125+ $ this ->assertEquals ([], $ this ->filter -> files () );
129126 }
130127
131- /**
132- * @depends testAddingADirectoryToTheWhitelistWorks
133- */
134- public function testRemovingADirectoryFromTheWhitelistWorks (): void
128+ public function testDirectoryCanBeRemoved (): void
135129 {
136130 $ this ->filter ->includeDirectory (TEST_FILES_PATH );
137131 $ this ->filter ->excludeDirectory (TEST_FILES_PATH );
138132
139133 $ this ->assertEquals ([], $ this ->filter ->files ());
140134 }
141135
142- public function testIsFile (): void
136+ public function testDeterminesWhetherStringContainsNameOfRealFileThatExists (): void
143137 {
144138 $ this ->assertFalse ($ this ->filter ->isFile ('vfs://root/a/path ' ));
145139 $ this ->assertFalse ($ this ->filter ->isFile ('xdebug://debug-eval ' ));
@@ -150,15 +144,17 @@ public function testIsFile(): void
150144 $ this ->assertTrue ($ this ->filter ->isFile (__FILE__ ));
151145 }
152146
153- public function testWhitelistedFileIsNotFiltered (): void
147+ public function testIncludedFileIsNotFiltered (): void
154148 {
155149 $ this ->filter ->includeFile ($ this ->files [0 ]);
150+
156151 $ this ->assertFalse ($ this ->filter ->isExcluded ($ this ->files [0 ]));
157152 }
158153
159- public function testNotWhitelistedFileIsFiltered (): void
154+ public function testNotIncludedFileIsFiltered (): void
160155 {
161156 $ this ->filter ->includeFile ($ this ->files [0 ]);
157+
162158 $ this ->assertTrue ($ this ->filter ->isExcluded ($ this ->files [1 ]));
163159 }
164160
0 commit comments