1010namespace SebastianBergmann \CodeCoverage ;
1111
1212use SebastianBergmann \CodeCoverage \Data \RawCodeCoverageData ;
13+ use SebastianBergmann \CodeCoverage \Test \Target \Target ;
14+ use SebastianBergmann \CodeCoverage \Test \Target \TargetCollection ;
1315use function array_merge ;
1416use function range ;
1517use function rmdir ;
1618use function unlink ;
17- use BankAccountTest ;
19+ use BankAccount ;
1820use RecursiveDirectoryIterator ;
1921use RecursiveIteratorIterator ;
2022use SebastianBergmann \CodeCoverage \Driver \Driver ;
@@ -1029,7 +1031,11 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
10291031 $ coverage ->stop (
10301032 true ,
10311033 null ,
1032- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1034+ TargetCollection::fromArray (
1035+ [
1036+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1037+ ]
1038+ )
10331039 );
10341040
10351041 $ coverage ->start (
@@ -1039,7 +1045,11 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
10391045 $ coverage ->stop (
10401046 true ,
10411047 null ,
1042- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1048+ TargetCollection::fromArray (
1049+ [
1050+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1051+ ]
1052+ )
10431053 );
10441054
10451055 $ coverage ->start (
@@ -1049,7 +1059,11 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
10491059 $ coverage ->stop (
10501060 true ,
10511061 null ,
1052- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1062+ TargetCollection::fromArray (
1063+ [
1064+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1065+ ]
1066+ )
10531067 );
10541068
10551069 $ coverage ->start (
@@ -1059,13 +1073,13 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
10591073 $ coverage ->stop (
10601074 true ,
10611075 null ,
1062- [
1063- TEST_FILES_PATH . ' BankAccount.php ' => array_merge (
1064- range ( 6 , 9 ),
1065- range ( 20 , 25 ),
1066- range ( 27 , 32 )
1067- ),
1068- ]
1076+ TargetCollection:: fromArray (
1077+ [
1078+ Target:: forMethod (BankAccount::class, ' getBalance ' ),
1079+ Target:: forMethod (BankAccount::class, ' depositMoney ' ),
1080+ Target:: forMethod (BankAccount::class, ' withdrawMoney ' ),
1081+ ]
1082+ )
10691083 );
10701084
10711085 return $ coverage ;
@@ -1096,7 +1110,11 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
10961110 $ coverage ->stop (
10971111 true ,
10981112 null ,
1099- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1113+ TargetCollection::fromArray (
1114+ [
1115+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1116+ ]
1117+ )
11001118 );
11011119
11021120 $ coverage ->start (
@@ -1106,7 +1124,11 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
11061124 $ coverage ->stop (
11071125 true ,
11081126 null ,
1109- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1127+ TargetCollection::fromArray (
1128+ [
1129+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1130+ ]
1131+ )
11101132 );
11111133
11121134 $ coverage ->start (
@@ -1116,7 +1138,11 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
11161138 $ coverage ->stop (
11171139 true ,
11181140 null ,
1119- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1141+ TargetCollection::fromArray (
1142+ [
1143+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1144+ ]
1145+ )
11201146 );
11211147
11221148 $ coverage ->start (
@@ -1126,13 +1152,13 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
11261152 $ coverage ->stop (
11271153 true ,
11281154 null ,
1129- [
1130- TEST_FILES_PATH . ' BankAccount.php ' => array_merge (
1131- range ( 6 , 9 ),
1132- range ( 20 , 25 ),
1133- range ( 27 , 32 )
1134- ),
1135- ]
1155+ TargetCollection:: fromArray (
1156+ [
1157+ Target:: forMethod (BankAccount::class, ' getBalance ' ),
1158+ Target:: forMethod (BankAccount::class, ' depositMoney ' ),
1159+ Target:: forMethod (BankAccount::class, ' withdrawMoney ' ),
1160+ ]
1161+ )
11361162 );
11371163
11381164 return $ coverage ;
@@ -1188,7 +1214,11 @@ protected function getLineCoverageForBankAccountForFirstTwoTests(): CodeCoverage
11881214 $ coverage ->stop (
11891215 true ,
11901216 null ,
1191- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1217+ TargetCollection::fromArray (
1218+ [
1219+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1220+ ]
1221+ )
11921222 );
11931223
11941224 $ coverage ->start (
@@ -1198,7 +1228,11 @@ protected function getLineCoverageForBankAccountForFirstTwoTests(): CodeCoverage
11981228 $ coverage ->stop (
11991229 true ,
12001230 null ,
1201- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1231+ TargetCollection::fromArray (
1232+ [
1233+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1234+ ]
1235+ )
12021236 );
12031237
12041238 return $ coverage ;
@@ -1225,7 +1259,11 @@ protected function getLineCoverageForBankAccountForLastTwoTests(): CodeCoverage
12251259 $ coverage ->stop (
12261260 true ,
12271261 null ,
1228- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1262+ TargetCollection::fromArray (
1263+ [
1264+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1265+ ]
1266+ )
12291267 );
12301268
12311269 $ coverage ->start (
@@ -1235,13 +1273,13 @@ protected function getLineCoverageForBankAccountForLastTwoTests(): CodeCoverage
12351273 $ coverage ->stop (
12361274 true ,
12371275 null ,
1238- [
1239- TEST_FILES_PATH . ' BankAccount.php ' => array_merge (
1240- range ( 6 , 9 ),
1241- range ( 20 , 25 ),
1242- range ( 27 , 32 )
1243- ),
1244- ]
1276+ TargetCollection:: fromArray (
1277+ [
1278+ Target:: forMethod (BankAccount::class, ' getBalance ' ),
1279+ Target:: forMethod (BankAccount::class, ' depositMoney ' ),
1280+ Target:: forMethod (BankAccount::class, ' withdrawMoney ' ),
1281+ ]
1282+ )
12451283 );
12461284
12471285 return $ coverage ;
@@ -1330,7 +1368,11 @@ protected function getPathCoverageForBankAccountForFirstTwoTests(): CodeCoverage
13301368 $ coverage ->stop (
13311369 true ,
13321370 null ,
1333- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1371+ TargetCollection::fromArray (
1372+ [
1373+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1374+ ]
1375+ )
13341376 );
13351377
13361378 $ coverage ->start (
@@ -1340,7 +1382,11 @@ protected function getPathCoverageForBankAccountForFirstTwoTests(): CodeCoverage
13401382 $ coverage ->stop (
13411383 true ,
13421384 null ,
1343- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1385+ TargetCollection::fromArray (
1386+ [
1387+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1388+ ]
1389+ )
13441390 );
13451391
13461392 return $ coverage ;
@@ -1367,7 +1413,11 @@ protected function getPathCoverageForBankAccountForLastTwoTests(): CodeCoverage
13671413 $ coverage ->stop (
13681414 true ,
13691415 null ,
1370- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1416+ TargetCollection::fromArray (
1417+ [
1418+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1419+ ]
1420+ )
13711421 );
13721422
13731423 $ coverage ->start (
@@ -1377,13 +1427,13 @@ protected function getPathCoverageForBankAccountForLastTwoTests(): CodeCoverage
13771427 $ coverage ->stop (
13781428 true ,
13791429 null ,
1380- [
1381- TEST_FILES_PATH . ' BankAccount.php ' => array_merge (
1382- range ( 6 , 9 ),
1383- range ( 20 , 25 ),
1384- range ( 27 , 32 )
1385- ),
1386- ]
1430+ TargetCollection:: fromArray (
1431+ [
1432+ Target:: forMethod (BankAccount::class, ' getBalance ' ),
1433+ Target:: forMethod (BankAccount::class, ' depositMoney ' ),
1434+ Target:: forMethod (BankAccount::class, ' withdrawMoney ' ),
1435+ ]
1436+ )
13871437 );
13881438
13891439 return $ coverage ;
0 commit comments