Skip to content

Commit a8027d9

Browse files
Slamdunksebastianbergmann
authored andcommitted
Update test data set to new PHPUnit version
1 parent 5d85529 commit a8027d9

File tree

6 files changed

+36
-14
lines changed

6 files changed

+36
-14
lines changed

src/PatchCoverageCalculator.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ final class PatchCoverageCalculator
2727
* @param LineCoverageType $lineCoverage
2828
* @param list<Diff> $patch
2929
*
30-
* @return array{numChangedLinesThatAreExecutable: non-negative-int, numChangedLinesThatWereExecuted: non-negative-int, changedLinesThatWereNotExecuted: array<non-empty-string, non-empty-list<positive-int>>}
30+
* @return array{numChangedLinesThatAreExecutable: non-negative-int, numChangedLinesThatWereExecuted: non-negative-int, numChangedLinesNotCovered: non-negative-int, changedLinesThatWereNotExecuted: array<non-empty-string, non-empty-list<positive-int>>}
3131
*/
3232
public function calculate(array $lineCoverage, array $patch, string $basePath, string $pathPrefix): array
3333
{
@@ -87,7 +87,8 @@ public function calculate(array $lineCoverage, array $patch, string $basePath, s
8787
$result['numChangedLinesThatWereExecuted']++;
8888
}
8989
}
90-
if (isset($coverage[$key]) && !isset($coverage[$key][$line])) {
90+
91+
if (isset($lineCoverage[$key]) && !isset($lineCoverage[$key][$line])) {
9192
$result['numChangedLinesNotCovered']++;
9293
}
9394
}
-3.28 KB
Binary file not shown.

tests/fixture/example2/phpunit.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
44
bootstrap="src/autoload.php"
55
failOnRisky="true"
66
failOnWarning="true">
77
<testsuites>
88
<testsuite name="default">
9-
<directory suffix="Test.php">tests</directory>
9+
<directory>tests</directory>
1010
</testsuite>
1111
</testsuites>
1212

13-
<coverage>
13+
<source>
1414
<include>
1515
<directory>src</directory>
1616
</include>
17-
</coverage>
17+
</source>
1818
</phpunit>
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
<?php
2-
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of phpcov.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
310
namespace fixture\example2\src;
411

512
final class Greeter2
613
{
7-
public const GREETING='Hello world!';
14+
public const GREETING = 'Hello world!';
815

916
public function greetWorld(): string
1017
{
1118
return self::GREETING;
1219
}
13-
}
20+
}

tests/fixture/example2/src/autoload.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
<?php declare(strict_types=1);
22

3+
/*
4+
* This file is part of phpcov.
5+
*
6+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
311
require __DIR__ . '/Greeter2.php';
4-

tests/fixture/example2/tests/Greeter2Test.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
<?php
2-
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of phpcov.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
310
namespace fixture\example2\tests;
411

512
use fixture\example2\src\Greeter2;
@@ -12,6 +19,6 @@ final class Greeter2Test extends TestCase
1219
{
1320
public function testGreetsWorld(): void
1421
{
15-
$this->assertSame(Greeter2::GREETING, (new Greeter2())->greetWorld());
22+
$this->assertSame(Greeter2::GREETING, (new Greeter2)->greetWorld());
1623
}
1724
}

0 commit comments

Comments
 (0)