-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sebastian Bergmann <sb@sebastian-bergmann.de> Co-authored-by: Arne Blankerts <Arne@Blankerts.de> Co-authored-by: Andreas Möller <am@localheinz.com> Co-authored-by: Sebastian Heuer <sebastian@phpeople.de> Co-authored-by: Fabian Blechschmidt <blechschmidt@fabian-blechschmidt.de> Co-authored-by: Frank Sons <frank.sons@code-quality.de>
- Loading branch information
1 parent
41a9886
commit b5d1fe7
Showing
6 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--TEST-- | ||
https://github.com/sebastianbergmann/phpunit/issues/5351 | ||
--INI-- | ||
pcov.directory=tests/end-to-end/regression/5351/src/ | ||
--SKIPIF-- | ||
<?php declare(strict_types=1); | ||
require __DIR__ . '/../../_files/skip-if-requires-code-coverage-driver.php'; | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--colors=never'; | ||
$_SERVER['argv'][] = '--coverage-text'; | ||
$_SERVER['argv'][] = '--configuration'; | ||
$_SERVER['argv'][] = __DIR__ . '/5351/phpunit.xml'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Runtime: %s | ||
Configuration: %s | ||
|
||
W 1 / 1 (100%) | ||
|
||
Time: %s, Memory: %s MB | ||
|
||
1 test triggered 1 PHPUnit warning: | ||
|
||
1) PHPUnit\TestFixture\Issue5351\GreeterTest::testGreets | ||
Class "PHPUnit\TestFixture\Issue5351\DoesNotExist" is not a valid target for code coverage | ||
|
||
%sGreeterTest.php:18 | ||
|
||
WARNINGS! | ||
Tests: 1, Assertions: 1, Warnings: 1. | ||
|
||
|
||
Code Coverage Report: | ||
%s | ||
|
||
Summary: | ||
Classes: 0.00% (0/1) | ||
Methods: 0.00% (0/1) | ||
Lines: 0.00% (0/1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../phpunit.xsd" | ||
bootstrap="src/Greeter.php" | ||
executionOrder="depends,defects" | ||
requireCoverageMetadata="true" | ||
beStrictAboutCoverageMetadata="true" | ||
beStrictAboutOutputDuringTests="true" | ||
failOnRisky="true" | ||
failOnWarning="true"> | ||
<testsuites> | ||
<testsuite name="default"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<source restrictDeprecations="true" restrictNotices="true" restrictWarnings="true"> | ||
<include> | ||
<directory>src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\Issue5351; | ||
|
||
final class Greeter | ||
{ | ||
public function greet(): string | ||
{ | ||
return 'Hello world!'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\Issue5351; | ||
|
||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
#[CoversClass('PHPUnit\TestFixture\Issue5351\DoesNotExist')] | ||
final class GreeterTest extends TestCase | ||
{ | ||
public function testGreets(): void | ||
{ | ||
$this->assertSame('Hello world!', (new Greeter)->greet()); | ||
} | ||
} |