10
10
namespace SebastianBergmann \CodeCoverage ;
11
11
12
12
use SebastianBergmann \CodeCoverage \Data \RawCodeCoverageData ;
13
+ use SebastianBergmann \CodeCoverage \Test \Target \Target ;
14
+ use SebastianBergmann \CodeCoverage \Test \Target \TargetCollection ;
13
15
use function array_merge ;
14
16
use function range ;
15
17
use function rmdir ;
16
18
use function unlink ;
17
- use BankAccountTest ;
19
+ use BankAccount ;
18
20
use RecursiveDirectoryIterator ;
19
21
use RecursiveIteratorIterator ;
20
22
use SebastianBergmann \CodeCoverage \Driver \Driver ;
@@ -1029,7 +1031,11 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
1029
1031
$ coverage ->stop (
1030
1032
true ,
1031
1033
null ,
1032
- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1034
+ TargetCollection::fromArray (
1035
+ [
1036
+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1037
+ ]
1038
+ )
1033
1039
);
1034
1040
1035
1041
$ coverage ->start (
@@ -1039,7 +1045,11 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
1039
1045
$ coverage ->stop (
1040
1046
true ,
1041
1047
null ,
1042
- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1048
+ TargetCollection::fromArray (
1049
+ [
1050
+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1051
+ ]
1052
+ )
1043
1053
);
1044
1054
1045
1055
$ coverage ->start (
@@ -1049,7 +1059,11 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
1049
1059
$ coverage ->stop (
1050
1060
true ,
1051
1061
null ,
1052
- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1062
+ TargetCollection::fromArray (
1063
+ [
1064
+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1065
+ ]
1066
+ )
1053
1067
);
1054
1068
1055
1069
$ coverage ->start (
@@ -1059,13 +1073,13 @@ protected function getLineCoverageForBankAccount(): CodeCoverage
1059
1073
$ coverage ->stop (
1060
1074
true ,
1061
1075
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
+ )
1069
1083
);
1070
1084
1071
1085
return $ coverage ;
@@ -1096,7 +1110,11 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
1096
1110
$ coverage ->stop (
1097
1111
true ,
1098
1112
null ,
1099
- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1113
+ TargetCollection::fromArray (
1114
+ [
1115
+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1116
+ ]
1117
+ )
1100
1118
);
1101
1119
1102
1120
$ coverage ->start (
@@ -1106,7 +1124,11 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
1106
1124
$ coverage ->stop (
1107
1125
true ,
1108
1126
null ,
1109
- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1127
+ TargetCollection::fromArray (
1128
+ [
1129
+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1130
+ ]
1131
+ )
1110
1132
);
1111
1133
1112
1134
$ coverage ->start (
@@ -1116,7 +1138,11 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
1116
1138
$ coverage ->stop (
1117
1139
true ,
1118
1140
null ,
1119
- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1141
+ TargetCollection::fromArray (
1142
+ [
1143
+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1144
+ ]
1145
+ )
1120
1146
);
1121
1147
1122
1148
$ coverage ->start (
@@ -1126,13 +1152,13 @@ protected function getPathCoverageForBankAccount(): CodeCoverage
1126
1152
$ coverage ->stop (
1127
1153
true ,
1128
1154
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
+ )
1136
1162
);
1137
1163
1138
1164
return $ coverage ;
@@ -1188,7 +1214,11 @@ protected function getLineCoverageForBankAccountForFirstTwoTests(): CodeCoverage
1188
1214
$ coverage ->stop (
1189
1215
true ,
1190
1216
null ,
1191
- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1217
+ TargetCollection::fromArray (
1218
+ [
1219
+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1220
+ ]
1221
+ )
1192
1222
);
1193
1223
1194
1224
$ coverage ->start (
@@ -1198,7 +1228,11 @@ protected function getLineCoverageForBankAccountForFirstTwoTests(): CodeCoverage
1198
1228
$ coverage ->stop (
1199
1229
true ,
1200
1230
null ,
1201
- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1231
+ TargetCollection::fromArray (
1232
+ [
1233
+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1234
+ ]
1235
+ )
1202
1236
);
1203
1237
1204
1238
return $ coverage ;
@@ -1225,7 +1259,11 @@ protected function getLineCoverageForBankAccountForLastTwoTests(): CodeCoverage
1225
1259
$ coverage ->stop (
1226
1260
true ,
1227
1261
null ,
1228
- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1262
+ TargetCollection::fromArray (
1263
+ [
1264
+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1265
+ ]
1266
+ )
1229
1267
);
1230
1268
1231
1269
$ coverage ->start (
@@ -1235,13 +1273,13 @@ protected function getLineCoverageForBankAccountForLastTwoTests(): CodeCoverage
1235
1273
$ coverage ->stop (
1236
1274
true ,
1237
1275
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
+ )
1245
1283
);
1246
1284
1247
1285
return $ coverage ;
@@ -1330,7 +1368,11 @@ protected function getPathCoverageForBankAccountForFirstTwoTests(): CodeCoverage
1330
1368
$ coverage ->stop (
1331
1369
true ,
1332
1370
null ,
1333
- [TEST_FILES_PATH . 'BankAccount.php ' => range (6 , 9 )]
1371
+ TargetCollection::fromArray (
1372
+ [
1373
+ Target::forMethod (BankAccount::class, 'getBalance ' ),
1374
+ ]
1375
+ )
1334
1376
);
1335
1377
1336
1378
$ coverage ->start (
@@ -1340,7 +1382,11 @@ protected function getPathCoverageForBankAccountForFirstTwoTests(): CodeCoverage
1340
1382
$ coverage ->stop (
1341
1383
true ,
1342
1384
null ,
1343
- [TEST_FILES_PATH . 'BankAccount.php ' => range (27 , 32 )]
1385
+ TargetCollection::fromArray (
1386
+ [
1387
+ Target::forMethod (BankAccount::class, 'withdrawMoney ' ),
1388
+ ]
1389
+ )
1344
1390
);
1345
1391
1346
1392
return $ coverage ;
@@ -1367,7 +1413,11 @@ protected function getPathCoverageForBankAccountForLastTwoTests(): CodeCoverage
1367
1413
$ coverage ->stop (
1368
1414
true ,
1369
1415
null ,
1370
- [TEST_FILES_PATH . 'BankAccount.php ' => range (20 , 25 )]
1416
+ TargetCollection::fromArray (
1417
+ [
1418
+ Target::forMethod (BankAccount::class, 'depositMoney ' ),
1419
+ ]
1420
+ )
1371
1421
);
1372
1422
1373
1423
$ coverage ->start (
@@ -1377,13 +1427,13 @@ protected function getPathCoverageForBankAccountForLastTwoTests(): CodeCoverage
1377
1427
$ coverage ->stop (
1378
1428
true ,
1379
1429
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
+ )
1387
1437
);
1388
1438
1389
1439
return $ coverage ;
0 commit comments