77 * For the full copyright and license information, please view the LICENSE
88 * file that was distributed with this source code.
99 */
10-
1110namespace SebastianBergmann \CodeCoverage \Report ;
1211
13- use SebastianBergmann \CodeCoverage \Driver \Driver ;
14- use SebastianBergmann \CodeCoverage \CodeCoverage ;
15- use SebastianBergmann \CodeCoverage \Filter ;
16- use SebastianBergmann \CodeCoverage \TestCase ;
1712use SebastianBergmann \CodeCoverage \Node \Builder ;
13+ use SebastianBergmann \CodeCoverage \TestCase ;
1814
1915class BuilderTest extends TestCase
2016{
2117 protected $ factory ;
2218
23- protected function setUp ()
19+ protected function setUp (): void
2420 {
2521 $ this ->factory = new Builder ;
2622 }
2723
28- public function testSomething ()
24+ public function testSomething (): void
2925 {
3026 $ root = $ this ->getCoverageForBankAccount ()->getReport ();
3127
32- $ expectedPath = rtrim (TEST_FILES_PATH , DIRECTORY_SEPARATOR );
28+ $ expectedPath = \ rtrim (TEST_FILES_PATH , \ DIRECTORY_SEPARATOR );
3329 $ this ->assertEquals ($ expectedPath , $ root ->getName ());
3430 $ this ->assertEquals ($ expectedPath , $ root ->getPath ());
3531 $ this ->assertEquals (10 , $ root ->getNumExecutableLines ());
@@ -116,34 +112,34 @@ public function testSomething()
116112 'fullPackage ' => '' ,
117113 'category ' => '' ,
118114 'package ' => '' ,
119- 'subpackage ' => ''
115+ 'subpackage ' => '' ,
120116 ],
121117 'link ' => 'BankAccount.php.html#2 ' ,
122- 'className ' => 'BankAccount '
123- ]
118+ 'className ' => 'BankAccount ' ,
119+ ],
124120 ],
125121 $ root ->getClasses ()
126122 );
127123
128124 $ this ->assertEquals ([], $ root ->getFunctions ());
129125 }
130126
131- public function testNotCrashParsing ()
127+ public function testNotCrashParsing (): void
132128 {
133129 $ coverage = $ this ->getCoverageForCrashParsing ();
134- $ root = $ coverage ->getReport ();
130+ $ root = $ coverage ->getReport ();
135131
136- $ expectedPath = rtrim (TEST_FILES_PATH , DIRECTORY_SEPARATOR );
132+ $ expectedPath = \ rtrim (TEST_FILES_PATH , \ DIRECTORY_SEPARATOR );
137133 $ this ->assertEquals ($ expectedPath , $ root ->getName ());
138134 $ this ->assertEquals ($ expectedPath , $ root ->getPath ());
139135 $ this ->assertEquals (2 , $ root ->getNumExecutableLines ());
140136 $ this ->assertEquals (0 , $ root ->getNumExecutedLines ());
141- $ data = $ coverage ->getData ();
142- $ expectedFile = $ expectedPath . DIRECTORY_SEPARATOR . 'Crash.php ' ;
137+ $ data = $ coverage ->getData ();
138+ $ expectedFile = $ expectedPath . \ DIRECTORY_SEPARATOR . 'Crash.php ' ;
143139 $ this ->assertSame ([$ expectedFile => [1 => [], 2 => []]], $ data );
144140 }
145141
146- public function testBuildDirectoryStructure ()
142+ public function testBuildDirectoryStructure (): void
147143 {
148144 $ s = \DIRECTORY_SEPARATOR ;
149145
@@ -159,20 +155,20 @@ public function testBuildDirectoryStructure()
159155 'src ' => [
160156 'Money.php/f ' => [],
161157 'MoneyBag.php/f ' => [],
162- 'Foo ' => [
158+ 'Foo ' => [
163159 'Bar ' => [
164160 'Baz ' => [
165161 'Foo.php/f ' => [],
166162 ],
167163 ],
168164 ],
169- ]
165+ ],
170166 ],
171167 $ method ->invoke (
172168 $ this ->factory ,
173169 [
174- "src {$ s }Money.php " => [],
175- "src {$ s }MoneyBag.php " => [],
170+ "src {$ s }Money.php " => [],
171+ "src {$ s }MoneyBag.php " => [],
176172 "src {$ s }Foo {$ s }Bar {$ s }Baz {$ s }Foo.php " => [],
177173 ]
178174 )
@@ -182,7 +178,7 @@ public function testBuildDirectoryStructure()
182178 /**
183179 * @dataProvider reducePathsProvider
184180 */
185- public function testReducePaths ($ reducedPaths , $ commonPath , $ paths )
181+ public function testReducePaths ($ reducedPaths , $ commonPath , $ paths ): void
186182 {
187183 $ method = new \ReflectionMethod (
188184 Builder::class,
@@ -203,45 +199,45 @@ public function reducePathsProvider()
203199
204200 yield [
205201 [],
206- " . " ,
207- []
202+ ' . ' ,
203+ [],
208204 ];
209205
210206 $ prefixes = ["C: $ s " , "$ s " ];
211207
212- foreach ($ prefixes as $ p ){
208+ foreach ($ prefixes as $ p ) {
213209 yield [
214210 [
215- " Money.php " => []
211+ ' Money.php ' => [],
216212 ],
217213 "{$ p }home {$ s }sb {$ s }Money {$ s }" ,
218214 [
219- "{$ p }home {$ s }sb {$ s }Money {$ s }Money.php " => []
220- ]
215+ "{$ p }home {$ s }sb {$ s }Money {$ s }Money.php " => [],
216+ ],
221217 ];
222218
223219 yield [
224220 [
225- " Money.php " => [],
226- " MoneyBag.php " => []
221+ ' Money.php ' => [],
222+ ' MoneyBag.php ' => [],
227223 ],
228224 "{$ p }home {$ s }sb {$ s }Money " ,
229225 [
230226 "{$ p }home {$ s }sb {$ s }Money {$ s }Money.php " => [],
231- "{$ p }home {$ s }sb {$ s }Money {$ s }MoneyBag.php " => []
232- ]
227+ "{$ p }home {$ s }sb {$ s }Money {$ s }MoneyBag.php " => [],
228+ ],
233229 ];
234230
235231 yield [
236232 [
237- " Money.php " => [],
238- " MoneyBag.php " => [],
233+ ' Money.php ' => [],
234+ ' MoneyBag.php ' => [],
239235 "Cash.phar {$ s }Cash.php " => [],
240236 ],
241237 "{$ p }home {$ s }sb {$ s }Money " ,
242238 [
243- "{$ p }home {$ s }sb {$ s }Money {$ s }Money.php " => [],
244- "{$ p }home {$ s }sb {$ s }Money {$ s }MoneyBag.php " => [],
239+ "{$ p }home {$ s }sb {$ s }Money {$ s }Money.php " => [],
240+ "{$ p }home {$ s }sb {$ s }Money {$ s }MoneyBag.php " => [],
245241 "phar:// {$ p }home {$ s }sb {$ s }Money {$ s }Cash.phar {$ s }Cash.php " => [],
246242 ],
247243 ];
0 commit comments