Skip to content

Commit 3b17cf5

Browse files
committed
Update TestCase.php
1 parent f29af67 commit 3b17cf5

File tree

1 file changed

+124
-123
lines changed

1 file changed

+124
-123
lines changed

tests/src/TestCase.php

Lines changed: 124 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
namespace SebastianBergmann\CodeCoverage;
1111

12+
use SebastianBergmann\CodeCoverage\Data\ProcessedBranchCoverageData;
13+
use SebastianBergmann\CodeCoverage\Data\ProcessedFunctionCoverageData;
14+
use SebastianBergmann\CodeCoverage\Data\ProcessedPathCoverageData;
1215
use function rmdir;
1316
use function unlink;
1417
use BankAccount;
@@ -1560,201 +1563,199 @@ protected function getExpectedPathCoverageDataArrayForBankAccount(): array
15601563
{
15611564
return [
15621565
TEST_FILES_PATH . 'BankAccount.php' => [
1563-
'BankAccount->depositMoney' => [
1564-
'branches' => [
1565-
0 => [
1566-
'op_start' => 0,
1567-
'op_end' => 14,
1568-
'line_start' => 20,
1569-
'line_end' => 25,
1570-
'hit' => [
1566+
'BankAccount->depositMoney' => new ProcessedFunctionCoverageData(
1567+
[
1568+
0 => new ProcessedBranchCoverageData(
1569+
0,
1570+
14,
1571+
20,
1572+
25,
1573+
[
15711574
0 => 'BankAccountTest::testBalanceCannotBecomeNegative2',
15721575
1 => 'BankAccountTest::testDepositWithdrawMoney',
15731576
],
1574-
'out' => [
1575-
],
1576-
'out_hit' => [
1577-
],
1578-
],
1577+
[],
1578+
[],
1579+
),
15791580
],
1580-
'paths' => [
1581-
0 => [
1582-
'path' => [
1581+
[
1582+
0 => new ProcessedPathCoverageData(
1583+
[
15831584
0 => 0,
15841585
],
1585-
'hit' => [
1586+
[
15861587
0 => 'BankAccountTest::testBalanceCannotBecomeNegative2',
15871588
1 => 'BankAccountTest::testDepositWithdrawMoney',
15881589
],
1589-
],
1590+
),
15901591
],
1591-
],
1592-
'BankAccount->getBalance' => [
1593-
'branches' => [
1594-
0 => [
1595-
'op_start' => 0,
1596-
'op_end' => 5,
1597-
'line_start' => 6,
1598-
'line_end' => 9,
1599-
'hit' => [
1592+
),
1593+
'BankAccount->getBalance' => new ProcessedFunctionCoverageData(
1594+
[
1595+
0 => new ProcessedBranchCoverageData(
1596+
0,
1597+
5,
1598+
6,
1599+
9,
1600+
[
16001601
0 => 'BankAccountTest::testBalanceIsInitiallyZero',
16011602
1 => 'BankAccountTest::testDepositWithdrawMoney',
16021603
],
1603-
'out' => [
1604+
[
16041605
],
1605-
'out_hit' => [
1606+
[
16061607
],
1607-
],
1608+
),
16081609
],
1609-
'paths' => [
1610-
0 => [
1611-
'path' => [
1610+
[
1611+
0 => new ProcessedPathCoverageData(
1612+
[
16121613
0 => 0,
16131614
],
1614-
'hit' => [
1615+
[
16151616
0 => 'BankAccountTest::testBalanceIsInitiallyZero',
16161617
1 => 'BankAccountTest::testDepositWithdrawMoney',
16171618
],
1618-
],
1619+
),
16191620
],
1620-
],
1621-
'BankAccount->withdrawMoney' => [
1622-
'branches' => [
1623-
0 => [
1624-
'op_start' => 0,
1625-
'op_end' => 14,
1626-
'line_start' => 27,
1627-
'line_end' => 32,
1628-
'hit' => [
1621+
),
1622+
'BankAccount->withdrawMoney' => new ProcessedFunctionCoverageData(
1623+
[
1624+
0 => new ProcessedBranchCoverageData(
1625+
0,
1626+
14,
1627+
27,
1628+
32,
1629+
[
16291630
0 => 'BankAccountTest::testBalanceCannotBecomeNegative',
16301631
1 => 'BankAccountTest::testDepositWithdrawMoney',
16311632
],
1632-
'out' => [
1633+
[
16331634
],
1634-
'out_hit' => [
1635+
[
16351636
],
1636-
],
1637+
),
16371638
],
1638-
'paths' => [
1639-
0 => [
1640-
'path' => [
1639+
[
1640+
0 => new ProcessedPathCoverageData(
1641+
[
16411642
0 => 0,
16421643
],
1643-
'hit' => [
1644+
[
16441645
0 => 'BankAccountTest::testBalanceCannotBecomeNegative',
16451646
1 => 'BankAccountTest::testDepositWithdrawMoney',
16461647
],
1647-
],
1648+
),
16481649
],
1649-
],
1650-
'{main}' => [
1651-
'branches' => [
1652-
0 => [
1653-
'op_start' => 0,
1654-
'op_end' => 1,
1655-
'line_start' => 34,
1656-
'line_end' => 34,
1657-
'hit' => [
1658-
],
1659-
'out' => [
1650+
),
1651+
'{main}' => new ProcessedFunctionCoverageData(
1652+
[
1653+
0 => new ProcessedBranchCoverageData(
1654+
0,
1655+
1,
1656+
34,
1657+
34,
1658+
[
1659+
],
1660+
[
16601661
0 => 2147483645,
16611662
],
1662-
'out_hit' => [
1663+
[
16631664
0 => 0,
16641665
],
1665-
],
1666+
),
16661667
],
1667-
'paths' => [
1668-
0 => [
1669-
'path' => [
1668+
[
1669+
0 => new ProcessedPathCoverageData(
1670+
[
16701671
0 => 0,
16711672
],
1672-
'hit' => [
1673+
[
16731674
],
1674-
],
1675+
),
16751676
],
1676-
],
1677-
'BankAccount->setBalance' => [
1678-
'branches' => [
1679-
0 => [
1680-
'op_start' => 0,
1681-
'op_end' => 4,
1682-
'line_start' => 11,
1683-
'line_end' => 13,
1684-
'hit' => [
1685-
],
1686-
'out' => [
1677+
),
1678+
'BankAccount->setBalance' => new ProcessedFunctionCoverageData(
1679+
[
1680+
0 => new ProcessedBranchCoverageData(
1681+
0,
1682+
4,
1683+
11,
1684+
13,
1685+
[
1686+
],
1687+
[
16871688
0 => 5,
16881689
1 => 9,
16891690
],
1690-
'out_hit' => [
1691+
[
16911692
0 => 0,
16921693
1 => 0,
16931694
],
1694-
],
1695-
5 => [
1696-
'op_start' => 5,
1697-
'op_end' => 8,
1698-
'line_start' => 14,
1699-
'line_end' => 14,
1700-
'hit' => [
1701-
],
1702-
'out' => [
1695+
),
1696+
5 => new ProcessedBranchCoverageData(
1697+
5,
1698+
8,
1699+
14,
1700+
14,
1701+
[
1702+
],
1703+
[
17031704
0 => 13,
17041705
],
1705-
'out_hit' => [
1706+
[
17061707
0 => 0,
17071708
],
1708-
],
1709-
9 => [
1710-
'op_start' => 9,
1711-
'op_end' => 12,
1712-
'line_start' => 16,
1713-
'line_end' => 16,
1714-
'hit' => [
1715-
],
1716-
'out' => [
1709+
),
1710+
9 => new ProcessedBranchCoverageData(
1711+
9,
1712+
12,
1713+
16,
1714+
16,
1715+
[
1716+
],
1717+
[
17171718
0 => 2147483645,
17181719
],
1719-
'out_hit' => [
1720+
[
17201721
0 => 0,
17211722
],
1722-
],
1723-
13 => [
1724-
'op_start' => 13,
1725-
'op_end' => 14,
1726-
'line_start' => 18,
1727-
'line_end' => 18,
1728-
'hit' => [
1729-
],
1730-
'out' => [
1723+
),
1724+
13 => new ProcessedBranchCoverageData(
1725+
13,
1726+
14,
1727+
18,
1728+
18,
1729+
[
1730+
],
1731+
[
17311732
0 => 2147483645,
17321733
],
1733-
'out_hit' => [
1734+
[
17341735
0 => 0,
17351736
],
1736-
],
1737+
),
17371738
],
1738-
'paths' => [
1739-
0 => [
1740-
'path' => [
1739+
[
1740+
0 => new ProcessedPathCoverageData(
1741+
[
17411742
0 => 0,
17421743
1 => 5,
17431744
2 => 13,
17441745
],
1745-
'hit' => [
1746+
[
17461747
],
1747-
],
1748-
1 => [
1749-
'path' => [
1748+
),
1749+
1 => new ProcessedPathCoverageData(
1750+
[
17501751
0 => 0,
17511752
1 => 9,
17521753
],
1753-
'hit' => [
1754+
[
17541755
],
1755-
],
1756+
),
17561757
],
1757-
],
1758+
),
17581759
],
17591760
];
17601761
}

0 commit comments

Comments
 (0)