Skip to content

Commit 094faca

Browse files
committed
removed phpunit from .gitignore
1 parent fa61a28 commit 094faca

File tree

1,085 files changed

+94711
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,085 files changed

+94711
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,13 @@ user_guide_src/cilexer/pycilexer.egg-info/*
7979
tests/coverage*
8080

8181
# Don't save phpunit under version control.
82-
phpunit
82+
#? DDEV disabled
83+
# phpunit
8384

8485
#-------------------------
8586
# Composer
8687
#-------------------------
88+
#? DDEV disabled
8789
# vendor/
8890

8991
#-------------------------

vendor/bin/phpunit

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/**
5+
* Proxy PHP file generated by Composer
6+
*
7+
* This file includes the referenced bin path (../phpunit/phpunit/phpunit)
8+
* using a stream wrapper to prevent the shebang from being output on PHP<8
9+
*
10+
* @generated
11+
*/
12+
13+
namespace Composer;
14+
15+
$GLOBALS['_composer_bin_dir'] = __DIR__;
16+
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
17+
$GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST'] = $GLOBALS['__PHPUNIT_ISOLATION_BLACKLIST'] = array(realpath(__DIR__ . '/..'.'/phpunit/phpunit/phpunit'));
18+
19+
if (PHP_VERSION_ID < 80000) {
20+
if (!class_exists('Composer\BinProxyWrapper')) {
21+
/**
22+
* @internal
23+
*/
24+
final class BinProxyWrapper
25+
{
26+
private $handle;
27+
private $position;
28+
private $realpath;
29+
30+
public function stream_open($path, $mode, $options, &$opened_path)
31+
{
32+
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
33+
$opened_path = substr($path, 17);
34+
$this->realpath = realpath($opened_path) ?: $opened_path;
35+
$opened_path = 'phpvfscomposer://'.$this->realpath;
36+
$this->handle = fopen($this->realpath, $mode);
37+
$this->position = 0;
38+
39+
return (bool) $this->handle;
40+
}
41+
42+
public function stream_read($count)
43+
{
44+
$data = fread($this->handle, $count);
45+
46+
if ($this->position === 0) {
47+
$data = preg_replace('{^#!.*\r?\n}', '', $data);
48+
}
49+
$data = str_replace('__DIR__', var_export(dirname($this->realpath), true), $data);
50+
$data = str_replace('__FILE__', var_export($this->realpath, true), $data);
51+
52+
$this->position += strlen($data);
53+
54+
return $data;
55+
}
56+
57+
public function stream_cast($castAs)
58+
{
59+
return $this->handle;
60+
}
61+
62+
public function stream_close()
63+
{
64+
fclose($this->handle);
65+
}
66+
67+
public function stream_lock($operation)
68+
{
69+
return $operation ? flock($this->handle, $operation) : true;
70+
}
71+
72+
public function stream_seek($offset, $whence)
73+
{
74+
if (0 === fseek($this->handle, $offset, $whence)) {
75+
$this->position = ftell($this->handle);
76+
return true;
77+
}
78+
79+
return false;
80+
}
81+
82+
public function stream_tell()
83+
{
84+
return $this->position;
85+
}
86+
87+
public function stream_eof()
88+
{
89+
return feof($this->handle);
90+
}
91+
92+
public function stream_stat()
93+
{
94+
return array();
95+
}
96+
97+
public function stream_set_option($option, $arg1, $arg2)
98+
{
99+
return true;
100+
}
101+
102+
public function url_stat($path, $flags)
103+
{
104+
$path = substr($path, 17);
105+
if (file_exists($path)) {
106+
return stat($path);
107+
}
108+
109+
return false;
110+
}
111+
}
112+
}
113+
114+
if (
115+
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
116+
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
117+
) {
118+
return include("phpvfscomposer://" . __DIR__ . '/..'.'/phpunit/phpunit/phpunit');
119+
}
120+
}
121+
122+
return include __DIR__ . '/..'.'/phpunit/phpunit/phpunit';
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# ChangeLog
2+
3+
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
4+
5+
## [10.1.16] - 2024-08-22
6+
7+
### Changed
8+
9+
* Updated dependencies (so that users that install using Composer's `--prefer-lowest` CLI option also get recent versions)
10+
11+
## [10.1.15] - 2024-06-29
12+
13+
### Fixed
14+
15+
* [#967](https://github.com/sebastianbergmann/php-code-coverage/issues/967): Identification of executable lines for `match` expressions does not work correctly
16+
17+
## [10.1.14] - 2024-03-12
18+
19+
### Fixed
20+
21+
* [#1033](https://github.com/sebastianbergmann/php-code-coverage/issues/1033): `@codeCoverageIgnore` annotation does not work on `enum`
22+
23+
## [10.1.13] - 2024-03-09
24+
25+
### Changed
26+
27+
* [#1032](https://github.com/sebastianbergmann/php-code-coverage/pull/1032): Pad lines in code coverage report only when colors are shown
28+
29+
## [10.1.12] - 2024-03-02
30+
31+
### Changed
32+
33+
* Do not use implicitly nullable parameters
34+
35+
## [10.1.11] - 2023-12-21
36+
37+
### Changed
38+
39+
* This component is now compatible with `nikic/php-parser` 5.0
40+
41+
## [10.1.10] - 2023-12-11
42+
43+
### Fixed
44+
45+
* [#1023](https://github.com/sebastianbergmann/php-code-coverage/issues/1023): Branch Coverage and Path Coverage are not correctly reported for traits
46+
47+
## [10.1.9] - 2023-11-23
48+
49+
### Fixed
50+
51+
* [#1020](https://github.com/sebastianbergmann/php-code-coverage/issues/1020): Single line method is ignored
52+
53+
## [10.1.8] - 2023-11-15
54+
55+
### Fixed
56+
57+
* [#1018](https://github.com/sebastianbergmann/php-code-coverage/issues/1018): Interface methods are not ignored when their signature is split over multiple lines
58+
59+
## [10.1.7] - 2023-10-04
60+
61+
### Fixed
62+
63+
* [#1014](https://github.com/sebastianbergmann/php-code-coverage/issues/1014): Incorrect statement count in coverage report for constructor property promotion
64+
65+
## [10.1.6] - 2023-09-19
66+
67+
### Fixed
68+
69+
* [#1012](https://github.com/sebastianbergmann/php-code-coverage/issues/1012): Cobertura report pulls functions from report scope, not the individual element
70+
71+
## [10.1.5] - 2023-09-12
72+
73+
### Changed
74+
75+
* [#1011](https://github.com/sebastianbergmann/php-code-coverage/pull/1011): Avoid serialization of cache data in PHP report
76+
77+
## [10.1.4] - 2023-08-31
78+
79+
### Fixed
80+
81+
* Exceptions of type `SebastianBergmann\Template\Exception` are now properly handled
82+
83+
## [10.1.3] - 2023-07-26
84+
85+
### Changed
86+
87+
* The result of `CodeCoverage::getReport()` is now cached
88+
89+
### Fixed
90+
91+
* Static analysis cache keys do not include configuration settings that affect source code parsing
92+
* The Clover, Cobertura, Crap4j, and PHP report writers no longer create a `php:` directory when they should write to `php://stdout`, for instance
93+
94+
## [10.1.2] - 2023-05-22
95+
96+
### Fixed
97+
98+
* [#998](https://github.com/sebastianbergmann/php-code-coverage/pull/998): Group Use Declarations are not handled properly
99+
100+
## [10.1.1] - 2023-04-17
101+
102+
### Fixed
103+
104+
* [#994](https://github.com/sebastianbergmann/php-code-coverage/issues/994): Argument `$linesToBeIgnored` of `CodeCoverage::stop()` has no effect for files that are not executed at all
105+
106+
## [10.1.0] - 2023-04-13
107+
108+
### Added
109+
110+
* [#982](https://github.com/sebastianbergmann/php-code-coverage/issues/982): Add option to ignore lines from code coverage
111+
112+
### Deprecated
113+
114+
* The `SebastianBergmann\CodeCoverage\Filter::includeDirectory()`, `SebastianBergmann\CodeCoverage\Filter::excludeDirectory()`, and `SebastianBergmann\CodeCoverage\Filter::excludeFile()` methods are now deprecated
115+
116+
[10.1.16]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.15...10.1.16
117+
[10.1.15]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.14...10.1.15
118+
[10.1.14]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.13...10.1.14
119+
[10.1.13]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.12...10.1.13
120+
[10.1.12]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.11...10.1.12
121+
[10.1.11]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.10...10.1.11
122+
[10.1.10]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.9...10.1.10
123+
[10.1.9]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.8...10.1.9
124+
[10.1.8]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.7...10.1.8
125+
[10.1.7]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.6...10.1.7
126+
[10.1.6]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.5...10.1.6
127+
[10.1.5]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.4...10.1.5
128+
[10.1.4]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.3...10.1.4
129+
[10.1.3]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.2...10.1.3
130+
[10.1.2]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.1...10.1.2
131+
[10.1.1]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.1.0...10.1.1
132+
[10.1.0]: https://github.com/sebastianbergmann/php-code-coverage/compare/10.0.2...10.1.0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2009-2024, Sebastian Bergmann
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# phpunit/php-code-coverage
2+
3+
[![Latest Stable Version](https://poser.pugx.org/phpunit/php-code-coverage/v/stable.png)](https://packagist.org/packages/phpunit/php-code-coverage)
4+
[![CI Status](https://github.com/sebastianbergmann/php-code-coverage/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/php-code-coverage/actions)
5+
[![Type Coverage](https://shepherd.dev/github/sebastianbergmann/php-code-coverage/coverage.svg)](https://shepherd.dev/github/sebastianbergmann/php-code-coverage)
6+
[![codecov](https://codecov.io/gh/sebastianbergmann/php-code-coverage/branch/main/graph/badge.svg)](https://codecov.io/gh/sebastianbergmann/php-code-coverage)
7+
8+
Provides collection, processing, and rendering functionality for PHP code coverage information.
9+
10+
## Installation
11+
12+
You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):
13+
14+
```
15+
composer require phpunit/php-code-coverage
16+
```
17+
18+
If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:
19+
20+
```
21+
composer require --dev phpunit/php-code-coverage
22+
```
23+
24+
## Usage
25+
26+
```php
27+
<?php declare(strict_types=1);
28+
use SebastianBergmann\CodeCoverage\Filter;
29+
use SebastianBergmann\CodeCoverage\Driver\Selector;
30+
use SebastianBergmann\CodeCoverage\CodeCoverage;
31+
use SebastianBergmann\CodeCoverage\Report\Html\Facade as HtmlReport;
32+
33+
$filter = new Filter;
34+
35+
$filter->includeFiles(
36+
[
37+
'/path/to/file.php',
38+
'/path/to/another_file.php',
39+
]
40+
);
41+
42+
$coverage = new CodeCoverage(
43+
(new Selector)->forLineCoverage($filter),
44+
$filter
45+
);
46+
47+
$coverage->start('<name of test>');
48+
49+
// ...
50+
51+
$coverage->stop();
52+
53+
54+
(new HtmlReport)->process($coverage, '/tmp/code-coverage-report');
55+
```
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Security Policy
2+
3+
If you believe you have found a security vulnerability in the library that is developed in this repository, please report it to us through coordinated disclosure.
4+
5+
**Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.**
6+
7+
Instead, please email `[email protected]`.
8+
9+
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
10+
11+
* The type of issue
12+
* Full paths of source file(s) related to the manifestation of the issue
13+
* The location of the affected source code (tag/branch/commit or direct URL)
14+
* Any special configuration required to reproduce the issue
15+
* Step-by-step instructions to reproduce the issue
16+
* Proof-of-concept or exploit code (if possible)
17+
* Impact of the issue, including how an attacker might exploit the issue
18+
19+
This information will help us triage your report more quickly.
20+
21+
## Web Context
22+
23+
The library that is developed in this repository was either extracted from [PHPUnit](https://github.com/sebastianbergmann/phpunit) or developed specifically as a dependency for PHPUnit.
24+
25+
The library is developed with a focus on development environments and the command-line. No specific testing or hardening with regard to using the library in an HTTP or web context or with untrusted input data is performed. The library might also contain functionality that intentionally exposes internal application data for debugging purposes.
26+
27+
If the library is used in a web application, the application developer is responsible for filtering inputs or escaping outputs as necessary and for verifying that the used functionality is safe for use within the intended context.
28+
29+
Vulnerabilities specific to the use outside a development context will be fixed as applicable, provided that the fix does not have an averse effect on the primary use case for development purposes.
30+

0 commit comments

Comments
 (0)