mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 18:59:09 -04:00
ALPHA 3.0.2
This commit is contained in:
24
vendor/phpunit/phpunit/.php_cs.dist
vendored
24
vendor/phpunit/phpunit/.php_cs.dist
vendored
@@ -12,6 +12,8 @@ return PhpCsFixer\Config::create()
|
||||
->setRiskyAllowed(true)
|
||||
->setRules(
|
||||
[
|
||||
'align_multiline_comment' => true,
|
||||
'array_indentation' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'binary_operator_spaces' => [
|
||||
'operators' => [
|
||||
@@ -43,7 +45,9 @@ return PhpCsFixer\Config::create()
|
||||
],
|
||||
'braces' => true,
|
||||
'cast_spaces' => true,
|
||||
'class_attributes_separation' => ['elements' => ['method']],
|
||||
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
|
||||
'combine_consecutive_issets' => true,
|
||||
'combine_consecutive_unsets' => true,
|
||||
'compact_nullable_typehint' => true,
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'declare_equal_normalize' => ['space' => 'none'],
|
||||
@@ -54,19 +58,28 @@ return PhpCsFixer\Config::create()
|
||||
'function_declaration' => true,
|
||||
'header_comment' => ['header' => $header, 'separate' => 'none'],
|
||||
'indentation_type' => true,
|
||||
'is_null' => true,
|
||||
'line_ending' => true,
|
||||
'list_syntax' => ['syntax' => 'short'],
|
||||
'logical_operators' => true,
|
||||
'lowercase_cast' => true,
|
||||
'lowercase_constants' => true,
|
||||
'lowercase_keywords' => true,
|
||||
'lowercase_static_reference' => true,
|
||||
'magic_constant_casing' => true,
|
||||
'method_argument_space' => ['ensure_fully_multiline' => true],
|
||||
'modernize_types_casting' => true,
|
||||
'multiline_comment_opening_closing' => true,
|
||||
'multiline_whitespace_before_semicolons' => true,
|
||||
'native_constant_invocation' => true,
|
||||
'native_function_casing' => true,
|
||||
'native_function_invocation' => true,
|
||||
'new_with_braces' => false,
|
||||
'no_alias_functions' => true,
|
||||
'no_alternative_syntax' => true,
|
||||
'no_blank_lines_after_class_opening' => true,
|
||||
'no_blank_lines_after_phpdoc' => true,
|
||||
'no_blank_lines_before_namespace' => true,
|
||||
'no_closing_tag' => true,
|
||||
'no_empty_comment' => true,
|
||||
'no_empty_phpdoc' => true,
|
||||
@@ -76,13 +89,16 @@ return PhpCsFixer\Config::create()
|
||||
'no_leading_import_slash' => true,
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
'no_mixed_echo_print' => ['use' => 'print'],
|
||||
'no_multiline_whitespace_around_double_arrow' => true,
|
||||
'no_null_property_initialization' => true,
|
||||
'no_php4_constructor' => true,
|
||||
'no_short_bool_cast' => true,
|
||||
'no_short_echo_tag' => true,
|
||||
'no_singleline_whitespace_before_semicolons' => true,
|
||||
'no_spaces_after_function_name' => true,
|
||||
'no_spaces_inside_parenthesis' => true,
|
||||
'no_superfluous_elseif' => true,
|
||||
'no_superfluous_phpdoc_tags' => true,
|
||||
'no_trailing_comma_in_list_call' => true,
|
||||
'no_trailing_comma_in_singleline_array' => true,
|
||||
'no_trailing_whitespace' => true,
|
||||
@@ -91,8 +107,10 @@ return PhpCsFixer\Config::create()
|
||||
'no_unneeded_curly_braces' => true,
|
||||
'no_unneeded_final_method' => true,
|
||||
'no_unreachable_default_argument_value' => true,
|
||||
'no_unset_on_property' => true,
|
||||
'no_unused_imports' => true,
|
||||
'no_useless_else' => true,
|
||||
'no_useless_return' => true,
|
||||
'no_whitespace_before_comma_in_array' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'non_printable_character' => true,
|
||||
@@ -137,13 +155,17 @@ return PhpCsFixer\Config::create()
|
||||
'phpdoc_single_line_var_spacing' => true,
|
||||
'phpdoc_to_comment' => true,
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_trim_consecutive_blank_line_separation' => true,
|
||||
'phpdoc_types' => true,
|
||||
'phpdoc_types_order' => true,
|
||||
'phpdoc_var_without_name' => true,
|
||||
'pow_to_exponentiation' => true,
|
||||
'protected_to_private' => true,
|
||||
'return_assignment' => true,
|
||||
'return_type_declaration' => ['space_before' => 'none'],
|
||||
'self_accessor' => true,
|
||||
'semicolon_after_instruction' => true,
|
||||
'set_type_to_cast' => true,
|
||||
'short_scalar_cast' => true,
|
||||
'simplified_null_return' => true,
|
||||
'single_blank_line_at_eof' => true,
|
||||
|
||||
15
vendor/phpunit/phpunit/ChangeLog-7.2.md
vendored
15
vendor/phpunit/phpunit/ChangeLog-7.2.md
vendored
@@ -2,6 +2,19 @@
|
||||
|
||||
All notable changes of the PHPUnit 7.2 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
|
||||
|
||||
## [7.2.6] - 2018-06-21
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#3176](https://github.com/sebastianbergmann/phpunit/issues/3176): PHPUnit 7.2.5 breaks backward compatibility
|
||||
|
||||
## [7.2.5] - 2018-06-21
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#3093](https://github.com/sebastianbergmann/phpunit/issues/3093): Unable to chain a `@dataProvider` in method `a` with a `@depends` in method `b`
|
||||
* Fixed [#3174](https://github.com/sebastianbergmann/phpunit/issues/3174): Code generator for test doubles does not handle proxied methods with variadic parameters correctly
|
||||
|
||||
## [7.2.4] - 2018-06-05
|
||||
|
||||
### Fixed
|
||||
@@ -46,6 +59,8 @@ All notable changes of the PHPUnit 7.2 release series are documented in this fil
|
||||
|
||||
* Fixed [#3069](https://github.com/sebastianbergmann/phpunit/issues/3069): Method `ResultPrinter::printWaitPrompt()` seems to be unused
|
||||
|
||||
[7.2.6]: https://github.com/sebastianbergmann/phpunit/compare/7.2.5...7.2.6
|
||||
[7.2.5]: https://github.com/sebastianbergmann/phpunit/compare/7.2.4...7.2.5
|
||||
[7.2.4]: https://github.com/sebastianbergmann/phpunit/compare/7.2.3...7.2.4
|
||||
[7.2.3]: https://github.com/sebastianbergmann/phpunit/compare/7.2.2...7.2.3
|
||||
[7.2.2]: https://github.com/sebastianbergmann/phpunit/compare/7.2.1...7.2.2
|
||||
|
||||
19
vendor/phpunit/phpunit/appveyor.yml
vendored
19
vendor/phpunit/phpunit/appveyor.yml
vendored
@@ -10,13 +10,11 @@ environment:
|
||||
COMPOSER_ROOT_VERSION: '7.0-dev'
|
||||
|
||||
matrix:
|
||||
- PHP_VERSION: '7.2.5-Win32-VC15'
|
||||
- PHP_VERSION: '7.1.11'
|
||||
XDEBUG_VERSION: '2.5.5-7.1'
|
||||
DEPENDENCIES: '--prefer-lowest'
|
||||
- PHP_VERSION: '7.2.5-Win32-VC15'
|
||||
DEPENDENCIES: ''
|
||||
- PHP_VERSION: '7.1.17-Win32-VC14'
|
||||
DEPENDENCIES: '--prefer-lowest'
|
||||
- PHP_VERSION: '7.1.17-Win32-VC14'
|
||||
- PHP_VERSION: '7.1.11'
|
||||
XDEBUG_VERSION: '2.5.5-7.1'
|
||||
DEPENDENCIES: ''
|
||||
|
||||
matrix:
|
||||
@@ -33,8 +31,8 @@ install:
|
||||
- IF NOT EXIST c:\php mkdir c:\php
|
||||
- IF NOT EXIST c:\php\%PHP_VERSION% mkdir c:\php\%PHP_VERSION%
|
||||
- cd c:\php\%PHP_VERSION%
|
||||
- IF NOT EXIST php-installed.txt appveyor-retry curl -fsS -o php.zip https://windows.php.net/downloads/releases/archives/php-%PHP_VERSION%-x86.zip
|
||||
- IF NOT EXIST php-installed.txt 7z x php.zip -y
|
||||
- IF NOT EXIST php-installed.txt curl -fsS -o php-%PHP_VERSION%-Win32-VC14-x86.zip https://windows.php.net/downloads/releases/archives/php-%PHP_VERSION%-Win32-VC14-x86.zip
|
||||
- IF NOT EXIST php-installed.txt 7z x php-%PHP_VERSION%-Win32-VC14-x86.zip -y >nul
|
||||
- IF NOT EXIST php-installed.txt del /Q *.zip
|
||||
- IF NOT EXIST php-installed.txt copy /Y php.ini-development php.ini
|
||||
- IF NOT EXIST php-installed.txt echo max_execution_time=1200 >> php.ini
|
||||
@@ -45,12 +43,13 @@ install:
|
||||
- IF NOT EXIST php-installed.txt echo extension=php_mbstring.dll >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo extension=php_fileinfo.dll >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo extension=php_mysqli.dll >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo extension=php_soap.dll >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo extension=php_pdo_sqlite.dll >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo zend.assertions=1 >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo assert.exception=On >> php.ini
|
||||
- IF NOT EXIST php-installed.txt appveyor DownloadFile https://getcomposer.org/composer.phar
|
||||
- IF NOT EXIST php-installed.txt curl -fsS -o composer.phar https://getcomposer.org/composer.phar
|
||||
- IF NOT EXIST php-installed.txt echo @php %%~dp0composer.phar %%* > composer.bat
|
||||
- IF NOT EXIST php-installed.txt curl -fsS -o c:\php\%PHP_VERSION%\ext\php_xdebug-%XDEBUG_VERSION%-vc14.dll https://xdebug.org/files/php_xdebug-%XDEBUG_VERSION%-vc14.dll
|
||||
- IF NOT EXIST php-installed.txt echo zend_extension=php_xdebug-%XDEBUG_VERSION%-vc14.dll >> php.ini
|
||||
- IF NOT EXIST php-installed.txt type nul >> php-installed.txt
|
||||
- cd c:\phpunit
|
||||
- composer update --no-interaction --no-ansi --no-progress --no-suggest --optimize-autoloader --prefer-stable %DEPENDENCIES%
|
||||
|
||||
2
vendor/phpunit/phpunit/composer.json
vendored
2
vendor/phpunit/phpunit/composer.json
vendored
@@ -33,7 +33,7 @@
|
||||
"phar-io/version": "^1.0",
|
||||
"phpspec/prophecy": "^1.7",
|
||||
"phpunit/php-code-coverage": "^6.0.7",
|
||||
"phpunit/php-file-iterator": "^2.0",
|
||||
"phpunit/php-file-iterator": "^2.0.1",
|
||||
"phpunit/php-text-template": "^1.2.1",
|
||||
"phpunit/php-timer": "^2.0",
|
||||
"sebastian/comparator": "^3.0",
|
||||
|
||||
2
vendor/phpunit/phpunit/phive.xml
vendored
2
vendor/phpunit/phpunit/phive.xml
vendored
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phive xmlns="https://phar.io/phive">
|
||||
<phar name="phpab" version="^1.24.1" installed="1.24.1" location="./build/tools/phpab" copy="true"/>
|
||||
<phar name="php-cs-fixer" version="^2.12.0" installed="2.12.0" location="./build/tools/php-cs-fixer" copy="true"/>
|
||||
<phar name="php-cs-fixer" version="^2.12.0" installed="2.12.1" location="./build/tools/php-cs-fixer" copy="true"/>
|
||||
<phar name="phpdox" version="^0.11.2" installed="0.11.2" location="./build/tools/phpdox" copy="true"/>
|
||||
<phar name="phploc" version="^4.0.1" installed="4.0.1" location="./build/tools/phploc" copy="true"/>
|
||||
</phive>
|
||||
|
||||
0
vendor/phpunit/phpunit/phpunit
vendored
Normal file → Executable file
0
vendor/phpunit/phpunit/phpunit
vendored
Normal file → Executable file
1
vendor/phpunit/phpunit/src/Exception.php
vendored
1
vendor/phpunit/phpunit/src/Exception.php
vendored
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit;
|
||||
|
||||
/**
|
||||
|
||||
396
vendor/phpunit/phpunit/src/Framework/Assert.php
vendored
396
vendor/phpunit/phpunit/src/Framework/Assert.php
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class CodeCoverageException extends Exception
|
||||
|
||||
@@ -28,14 +28,14 @@ class ArraySubset extends Constraint
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $strict;
|
||||
private $checkForObjectIdentity;
|
||||
|
||||
public function __construct(iterable $subset, bool $strict = false)
|
||||
public function __construct(iterable $subset, bool $checkForObjectIdentity = false)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->strict = $strict;
|
||||
$this->subset = $subset;
|
||||
$this->checkForObjectIdentity = $checkForObjectIdentity;
|
||||
$this->subset = $subset;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -54,8 +54,6 @@ class ArraySubset extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
@@ -66,7 +64,7 @@ class ArraySubset extends Constraint
|
||||
|
||||
$patched = \array_replace_recursive($other, $this->subset);
|
||||
|
||||
if ($this->strict) {
|
||||
if ($this->checkForObjectIdentity) {
|
||||
$result = $other === $patched;
|
||||
} else {
|
||||
$result = $other == $patched;
|
||||
|
||||
@@ -43,8 +43,6 @@ class Attribute extends Composite
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -41,8 +41,6 @@ abstract class Composite extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use Countable;
|
||||
@@ -44,8 +43,6 @@ abstract class Constraint implements Countable, SelfDescribing
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -40,8 +40,6 @@ class Count extends Constraint
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other
|
||||
*/
|
||||
protected function matches($other): bool
|
||||
{
|
||||
|
||||
@@ -31,8 +31,6 @@ class IsAnything extends Constraint
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -75,8 +75,6 @@ class IsEqual extends Constraint
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -35,9 +35,6 @@ class IsIdentical extends Constraint
|
||||
*/
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function __construct($value)
|
||||
{
|
||||
parent::__construct();
|
||||
@@ -61,8 +58,6 @@ class IsIdentical extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -18,16 +18,27 @@ namespace PHPUnit\Framework\Constraint;
|
||||
class IsType extends Constraint
|
||||
{
|
||||
public const TYPE_ARRAY = 'array';
|
||||
|
||||
public const TYPE_BOOL = 'bool';
|
||||
|
||||
public const TYPE_FLOAT = 'float';
|
||||
|
||||
public const TYPE_INT = 'int';
|
||||
|
||||
public const TYPE_NULL = 'null';
|
||||
|
||||
public const TYPE_NUMERIC = 'numeric';
|
||||
|
||||
public const TYPE_OBJECT = 'object';
|
||||
|
||||
public const TYPE_RESOURCE = 'resource';
|
||||
|
||||
public const TYPE_STRING = 'string';
|
||||
|
||||
public const TYPE_SCALAR = 'scalar';
|
||||
|
||||
public const TYPE_CALLABLE = 'callable';
|
||||
|
||||
public const TYPE_ITERABLE = 'iterable';
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
@@ -21,17 +20,17 @@ class JsonMatchesErrorMessageProvider
|
||||
public static function determineJsonError(string $error, string $prefix = ''): ?string
|
||||
{
|
||||
switch ($error) {
|
||||
case JSON_ERROR_NONE:
|
||||
case \JSON_ERROR_NONE:
|
||||
return null;
|
||||
case JSON_ERROR_DEPTH:
|
||||
case \JSON_ERROR_DEPTH:
|
||||
return $prefix . 'Maximum stack depth exceeded';
|
||||
case JSON_ERROR_STATE_MISMATCH:
|
||||
case \JSON_ERROR_STATE_MISMATCH:
|
||||
return $prefix . 'Underflow or the modes mismatch';
|
||||
case JSON_ERROR_CTRL_CHAR:
|
||||
case \JSON_ERROR_CTRL_CHAR:
|
||||
return $prefix . 'Unexpected control character found';
|
||||
case JSON_ERROR_SYNTAX:
|
||||
case \JSON_ERROR_SYNTAX:
|
||||
return $prefix . 'Syntax error, malformed JSON';
|
||||
case JSON_ERROR_UTF8:
|
||||
case \JSON_ERROR_UTF8:
|
||||
return $prefix . 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
||||
default:
|
||||
return $prefix . 'Unknown error';
|
||||
|
||||
@@ -67,8 +67,6 @@ class LogicalAnd extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -104,8 +104,6 @@ class LogicalNot extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -64,8 +64,6 @@ class LogicalOr extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -64,8 +64,6 @@ class LogicalXor extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use SebastianBergmann\Diff\Differ;
|
||||
@@ -38,8 +37,6 @@ class StringMatchesFormatDescription extends RegularExpression
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other value or object to evaluate
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other): bool
|
||||
{
|
||||
@@ -93,7 +90,7 @@ class StringMatchesFormatDescription extends RegularExpression
|
||||
'/(?<!%)%c/'
|
||||
],
|
||||
[
|
||||
\str_replace('\\', '\\\\', '\\' . DIRECTORY_SEPARATOR),
|
||||
\str_replace('\\', '\\\\', '\\' . \DIRECTORY_SEPARATOR),
|
||||
'[^\r\n]+',
|
||||
'[^\r\n]*',
|
||||
'.+',
|
||||
|
||||
@@ -33,8 +33,6 @@ class TraversableContains extends Constraint
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function __construct($value, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false)
|
||||
|
||||
@@ -61,8 +61,6 @@ class TraversableContainsOnly extends Constraint
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class CoveredCodeNotExecutedException extends RiskyTestError
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Error;
|
||||
|
||||
use PHPUnit\Framework\Exception;
|
||||
|
||||
@@ -33,9 +33,6 @@ class ExceptionWrapper extends Exception
|
||||
*/
|
||||
protected $previous;
|
||||
|
||||
/**
|
||||
* @param Throwable $t
|
||||
*/
|
||||
public function __construct(Throwable $t)
|
||||
{
|
||||
// PDOException::getCode() is a string.
|
||||
@@ -72,9 +69,6 @@ class ExceptionWrapper extends Exception
|
||||
return $this->previous;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
*/
|
||||
public function setClassName(string $className): void
|
||||
{
|
||||
$this->className = $className;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class MissingCoversAnnotationException extends RiskyTestError
|
||||
|
||||
@@ -41,11 +41,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
*/
|
||||
private $configurableMethods;
|
||||
|
||||
/**
|
||||
* @param MatcherCollection $collection
|
||||
* @param Invocation $invocationMatcher
|
||||
* @param array $configurableMethods
|
||||
*/
|
||||
public function __construct(MatcherCollection $collection, Invocation $invocationMatcher, array $configurableMethods)
|
||||
{
|
||||
$this->collection = $collection;
|
||||
@@ -65,8 +60,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function id($id)
|
||||
@@ -77,8 +70,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Stub $stub
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function will(Stub $stub)
|
||||
@@ -89,9 +80,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @param mixed $nextValues, ...
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function willReturn($value, ...$nextValues)
|
||||
@@ -120,8 +108,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $valueMap
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function willReturnMap(array $valueMap)
|
||||
@@ -132,8 +118,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $argumentIndex
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function willReturnArgument($argumentIndex)
|
||||
@@ -166,8 +150,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $values, ...
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function willReturnOnConsecutiveCalls(...$values)
|
||||
@@ -178,8 +160,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Exception $exception
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function willThrowException(\Exception $exception)
|
||||
@@ -190,8 +170,6 @@ class InvocationMocker implements MethodNameMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function after($id)
|
||||
|
||||
@@ -20,8 +20,6 @@ interface Stub extends Identity
|
||||
* Stubs the matching method with the stub object $stub. Any invocations of
|
||||
* the matched method will now be handled by the stub instead.
|
||||
*
|
||||
* @param BaseStub $stub
|
||||
*
|
||||
* @return Identity
|
||||
*/
|
||||
public function will(BaseStub $stub);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\MockObject;
|
||||
|
||||
use PHPUnit_Framework_MockObject_MockObject;
|
||||
|
||||
@@ -58,7 +58,6 @@ class Generator
|
||||
*
|
||||
* @param string|string[] $type
|
||||
* @param array $methods
|
||||
* @param array $arguments
|
||||
* @param string $mockClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -209,7 +208,6 @@ class Generator
|
||||
* the last parameter
|
||||
*
|
||||
* @param string $originalClassName
|
||||
* @param array $arguments
|
||||
* @param string $mockClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -271,7 +269,6 @@ class Generator
|
||||
* `$mockedMethods` parameter.
|
||||
*
|
||||
* @param string $traitName
|
||||
* @param array $arguments
|
||||
* @param string $mockClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -332,7 +329,6 @@ class Generator
|
||||
* Returns an object for the specified trait.
|
||||
*
|
||||
* @param string $traitName
|
||||
* @param array $arguments
|
||||
* @param string $traitClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -436,8 +432,6 @@ class Generator
|
||||
/**
|
||||
* @param string $wsdlFile
|
||||
* @param string $className
|
||||
* @param array $methods
|
||||
* @param array $options
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*
|
||||
@@ -451,7 +445,7 @@ class Generator
|
||||
);
|
||||
}
|
||||
|
||||
$options = \array_merge($options, ['cache_wsdl' => WSDL_CACHE_NONE]);
|
||||
$options = \array_merge($options, ['cache_wsdl' => \WSDL_CACHE_NONE]);
|
||||
$client = new SoapClient($wsdlFile, $options);
|
||||
$_methods = \array_unique($client->__getFunctions());
|
||||
unset($client);
|
||||
@@ -548,7 +542,6 @@ class Generator
|
||||
* @param array|string $type
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callAutoload
|
||||
* @param array $arguments
|
||||
* @param bool $callOriginalMethods
|
||||
* @param object $proxyTarget
|
||||
* @param bool $returnValueGeneration
|
||||
@@ -838,8 +831,8 @@ class Generator
|
||||
);
|
||||
|
||||
return [
|
||||
'code' => $classTemplate->render(),
|
||||
'mockClassName' => $mockClassName['className']
|
||||
'code' => $classTemplate->render(),
|
||||
'mockClassName' => $mockClassName['className']
|
||||
];
|
||||
}
|
||||
|
||||
@@ -879,17 +872,15 @@ class Generator
|
||||
}
|
||||
|
||||
return [
|
||||
'className' => $className,
|
||||
'originalClassName' => $type,
|
||||
'fullClassName' => $fullClassName,
|
||||
'namespaceName' => $namespaceName
|
||||
'className' => $className,
|
||||
'originalClassName' => $type,
|
||||
'fullClassName' => $fullClassName,
|
||||
'namespaceName' => $namespaceName
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $mockClassName
|
||||
* @param bool $isInterface
|
||||
* @param array $additionalInterfaces
|
||||
* @param bool $isInterface
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -930,9 +921,8 @@ class Generator
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionMethod $method
|
||||
* @param bool $cloneArguments
|
||||
* @param bool $callOriginalMethods
|
||||
* @param bool $cloneArguments
|
||||
* @param bool $callOriginalMethods
|
||||
*
|
||||
* @throws \PHPUnit\Framework\MockObject\RuntimeException
|
||||
*
|
||||
@@ -1084,8 +1074,6 @@ class Generator
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionMethod $method
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function canMockMethod(ReflectionMethod $method)
|
||||
@@ -1108,8 +1096,7 @@ class Generator
|
||||
/**
|
||||
* Returns the parameters of a function or method.
|
||||
*
|
||||
* @param ReflectionMethod $method
|
||||
* @param bool $forCall
|
||||
* @param bool $forCall
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*
|
||||
@@ -1208,7 +1195,7 @@ class Generator
|
||||
*/
|
||||
private function getTemplate($template)
|
||||
{
|
||||
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR . $template;
|
||||
$filename = __DIR__ . \DIRECTORY_SEPARATOR . 'Generator' . \DIRECTORY_SEPARATOR . $template;
|
||||
|
||||
if (!isset(self::$templates[$filename])) {
|
||||
self::$templates[$filename] = new Text_Template($filename);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
$__phpunit_arguments_tmp = func_get_args();
|
||||
|
||||
for ($__phpunit_i = {arguments_count}; $__phpunit_i < $__phpunit_count; $__phpunit_i++) {
|
||||
$__phpunit_arguments[] = $__phpunit_arguments_tmp[$i];
|
||||
$__phpunit_arguments[] = $__phpunit_arguments_tmp[$__phpunit_i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ class ObjectInvocation extends StaticInvocation
|
||||
/**
|
||||
* @param string $className
|
||||
* @param string $methodName
|
||||
* @param array $parameters
|
||||
* @param string $returnType
|
||||
* @param object $object
|
||||
* @param bool $cloneObjects
|
||||
|
||||
@@ -73,7 +73,6 @@ class StaticInvocation implements Invocation, SelfDescribing
|
||||
/**
|
||||
* @param string $className
|
||||
* @param string $methodName
|
||||
* @param array $parameters
|
||||
* @param string $returnType
|
||||
* @param bool $cloneObjects
|
||||
*/
|
||||
|
||||
@@ -47,19 +47,12 @@ class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch
|
||||
*/
|
||||
private $returnValueGeneration;
|
||||
|
||||
/**
|
||||
* @param array $configurableMethods
|
||||
* @param bool $returnValueGeneration
|
||||
*/
|
||||
public function __construct(array $configurableMethods, bool $returnValueGeneration)
|
||||
{
|
||||
$this->configurableMethods = $configurableMethods;
|
||||
$this->returnValueGeneration = $returnValueGeneration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param MatcherInvocation $matcher
|
||||
*/
|
||||
public function addMatcher(MatcherInvocation $matcher): void
|
||||
{
|
||||
$this->matchers[] = $matcher;
|
||||
@@ -77,8 +70,6 @@ class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
*
|
||||
* @return null|bool
|
||||
*/
|
||||
public function lookupId($id)
|
||||
@@ -86,14 +77,9 @@ class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch
|
||||
if (isset($this->builderMap[$id])) {
|
||||
return $this->builderMap[$id];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $id
|
||||
* @param Match $builder
|
||||
*
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function registerId($id, Match $builder): void
|
||||
@@ -108,8 +94,6 @@ class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param MatcherInvocation $matcher
|
||||
*
|
||||
* @return BuilderInvocationMocker
|
||||
*/
|
||||
public function expects(MatcherInvocation $matcher)
|
||||
@@ -122,11 +106,7 @@ class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Invocation $invocation
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function invoke(Invocation $invocation)
|
||||
{
|
||||
@@ -179,8 +159,6 @@ class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Invocation $invocation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function matches(Invocation $invocation)
|
||||
|
||||
@@ -59,9 +59,6 @@ class Matcher implements MatcherInvocation
|
||||
*/
|
||||
private $stub;
|
||||
|
||||
/**
|
||||
* @param MatcherInvocation $invocationMatcher
|
||||
*/
|
||||
public function __construct(MatcherInvocation $invocationMatcher)
|
||||
{
|
||||
$this->invocationMatcher = $invocationMatcher;
|
||||
@@ -113,13 +110,9 @@ class Matcher implements MatcherInvocation
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Invocation $invocation
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws RuntimeException
|
||||
* @throws ExpectationFailedException
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function invoked(Invocation $invocation)
|
||||
{
|
||||
@@ -181,8 +174,6 @@ class Matcher implements MatcherInvocation
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Invocation $invocation
|
||||
*
|
||||
* @throws RuntimeException
|
||||
* @throws ExpectationFailedException
|
||||
*
|
||||
@@ -289,9 +280,6 @@ class Matcher implements MatcherInvocation
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
$list = [];
|
||||
|
||||
@@ -15,9 +15,6 @@ namespace PHPUnit\Framework\MockObject\Matcher;
|
||||
*/
|
||||
class AnyInvokedCount extends InvokedRecorder
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'invoked zero or more times';
|
||||
|
||||
@@ -16,17 +16,12 @@ use PHPUnit\Framework\MockObject\Invocation as BaseInvocation;
|
||||
*/
|
||||
class AnyParameters extends StatelessInvocation
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'with any parameters';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function matches(BaseInvocation $invocation)
|
||||
|
||||
@@ -37,8 +37,6 @@ class ConsecutiveParameters extends StatelessInvocation
|
||||
private $invocations = [];
|
||||
|
||||
/**
|
||||
* @param array $parameterGroups
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function __construct(array $parameterGroups)
|
||||
@@ -54,17 +52,12 @@ class ConsecutiveParameters extends StatelessInvocation
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'with consecutive parameters';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*
|
||||
* @throws \PHPUnit\Framework\ExpectationFailedException
|
||||
*
|
||||
* @return bool
|
||||
@@ -89,8 +82,7 @@ class ConsecutiveParameters extends StatelessInvocation
|
||||
/**
|
||||
* Verify a single invocation
|
||||
*
|
||||
* @param BaseInvocation $invocation
|
||||
* @param int $callIndex
|
||||
* @param int $callIndex
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
|
||||
@@ -31,8 +31,6 @@ interface Invocation extends SelfDescribing, Verifiable
|
||||
* If the matcher is a stub it will also have a return value.
|
||||
*
|
||||
* @param BaseInvocation $invocation Object containing information on a mocked or stubbed method which was invoked
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function invoked(BaseInvocation $invocation);
|
||||
|
||||
|
||||
@@ -42,17 +42,12 @@ class InvokedAtIndex implements Invocation
|
||||
$this->sequenceIndex = $sequenceIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'invoked at sequence index ' . $this->sequenceIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function matches(BaseInvocation $invocation)
|
||||
@@ -62,9 +57,6 @@ class InvokedAtIndex implements Invocation
|
||||
return $this->currentIndex == $this->sequenceIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*/
|
||||
public function invoked(BaseInvocation $invocation): void
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@ class InvokedAtLeastCount extends InvokedRecorder
|
||||
$this->requiredInvocations = $requiredInvocations;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'invoked at least ' . $this->requiredInvocations . ' times';
|
||||
|
||||
@@ -19,9 +19,6 @@ use PHPUnit\Framework\ExpectationFailedException;
|
||||
*/
|
||||
class InvokedAtLeastOnce extends InvokedRecorder
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'invoked at least once';
|
||||
|
||||
@@ -30,9 +30,6 @@ class InvokedAtMostCount extends InvokedRecorder
|
||||
$this->allowedInvocations = $allowedInvocations;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'invoked at most ' . $this->allowedInvocations . ' times';
|
||||
|
||||
@@ -43,17 +43,12 @@ class InvokedCount extends InvokedRecorder
|
||||
return $this->expectedCount === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'invoked ' . $this->expectedCount . ' time(s)';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function invoked(BaseInvocation $invocation): void
|
||||
|
||||
@@ -48,17 +48,12 @@ abstract class InvokedRecorder implements Invocation
|
||||
return \count($this->invocations) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*/
|
||||
public function invoked(BaseInvocation $invocation): void
|
||||
{
|
||||
$this->invocations[] = $invocation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function matches(BaseInvocation $invocation)
|
||||
|
||||
@@ -30,7 +30,6 @@ class MethodName extends StatelessInvocation
|
||||
|
||||
/**
|
||||
* @param Constraint|string
|
||||
* @param mixed $constraint
|
||||
*
|
||||
* @throws Constraint
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
@@ -54,17 +53,12 @@ class MethodName extends StatelessInvocation
|
||||
$this->constraint = $constraint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
return 'method name ' . $this->constraint->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function matches(BaseInvocation $invocation)
|
||||
|
||||
@@ -40,8 +40,6 @@ class Parameters extends StatelessInvocation
|
||||
private $parameterVerificationResult;
|
||||
|
||||
/**
|
||||
* @param array $parameters
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function __construct(array $parameters)
|
||||
@@ -57,9 +55,6 @@ class Parameters extends StatelessInvocation
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
$text = 'with parameter';
|
||||
@@ -76,8 +71,6 @@ class Parameters extends StatelessInvocation
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BaseInvocation $invocation
|
||||
*
|
||||
* @throws \Exception
|
||||
*
|
||||
* @return bool
|
||||
|
||||
@@ -32,8 +32,6 @@ abstract class StatelessInvocation implements Invocation
|
||||
* If the matcher is a stub it will also have a return value.
|
||||
*
|
||||
* @param BaseInvocation $invocation Object containing information on a mocked or stubbed method which was invoked
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function invoked(BaseInvocation $invocation)
|
||||
{
|
||||
@@ -44,8 +42,6 @@ abstract class StatelessInvocation implements Invocation
|
||||
* the matcher will get the invoked() method called which should check if an
|
||||
* expectation is met.
|
||||
*
|
||||
* @param Invocation $invocation Object containing information on a mocked or stubbed method which was invoked
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function verify()
|
||||
|
||||
@@ -92,7 +92,6 @@ class MockBuilder
|
||||
private $generator;
|
||||
|
||||
/**
|
||||
* @param TestCase $testCase
|
||||
* @param array|string $type
|
||||
*/
|
||||
public function __construct(TestCase $testCase, $type)
|
||||
@@ -192,8 +191,6 @@ class MockBuilder
|
||||
/**
|
||||
* Specifies the subset of methods to not mock. Default is to mock all of them.
|
||||
*
|
||||
* @param array $methods
|
||||
*
|
||||
* @return MockBuilder
|
||||
*/
|
||||
public function setMethodsExcept(array $methods = [])
|
||||
@@ -213,8 +210,6 @@ class MockBuilder
|
||||
/**
|
||||
* Specifies the arguments for the constructor.
|
||||
*
|
||||
* @param array $args
|
||||
*
|
||||
* @return MockBuilder
|
||||
*/
|
||||
public function setConstructorArgs(array $args)
|
||||
|
||||
@@ -21,8 +21,6 @@ use PHPUnit\Framework\MockObject\Matcher\Invocation;
|
||||
interface PHPUnit_Framework_MockObject_MockObject /*extends Verifiable*/
|
||||
{
|
||||
/**
|
||||
* @param mixed $originalObject
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function __phpunit_setOriginalObject($originalObject);
|
||||
@@ -51,8 +49,6 @@ interface PHPUnit_Framework_MockObject_MockObject /*extends Verifiable*/
|
||||
* Registers a new expectation in the mock object and returns the match
|
||||
* object which can be infused with further details.
|
||||
*
|
||||
* @param Invocation $matcher
|
||||
*
|
||||
* @return InvocationMocker
|
||||
*/
|
||||
public function expects(Invocation $matcher);
|
||||
|
||||
@@ -24,8 +24,6 @@ interface Stub extends SelfDescribing
|
||||
* specific value.
|
||||
*
|
||||
* @param Invocation $invocation The invocation which was mocked and matched by the current method and argument matchers
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function invoke(Invocation $invocation);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
interface RiskyTest
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
interface SkippedTest
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class SkippedTestError extends AssertionFailedError implements SkippedTest
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class SkippedTestSuiteError extends AssertionFailedError implements SkippedTest
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use Countable;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use DeepCopy\DeepCopy;
|
||||
@@ -56,7 +55,7 @@ use Throwable;
|
||||
|
||||
abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
{
|
||||
private const LOCALE_CATEGORIES = [LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME];
|
||||
private const LOCALE_CATEGORIES = [\LC_ALL, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY, \LC_NUMERIC, \LC_TIME];
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
@@ -334,9 +333,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
return new InvokedAtIndexMatcher($index);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public static function returnValue($value): ReturnStub
|
||||
{
|
||||
return new ReturnStub($value);
|
||||
@@ -352,9 +348,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
return new ReturnArgumentStub($argumentIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $callback
|
||||
*/
|
||||
public static function returnCallback($callback): ReturnCallbackStub
|
||||
{
|
||||
return new ReturnCallbackStub($callback);
|
||||
@@ -382,7 +375,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param array $data
|
||||
* @param string $dataName
|
||||
*/
|
||||
public function __construct($name = null, array $data = [], $dataName = '')
|
||||
@@ -426,7 +418,8 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
/**
|
||||
* Returns a string representation of the test case.
|
||||
*
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public function toString(): string
|
||||
{
|
||||
@@ -465,7 +458,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
public function getName(bool $withDataSet = true): ?string
|
||||
{
|
||||
@@ -479,7 +472,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
/**
|
||||
* Returns the size of the test.
|
||||
*
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
public function getSize(): int
|
||||
{
|
||||
@@ -490,7 +483,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
public function hasSize(): bool
|
||||
{
|
||||
@@ -498,7 +491,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
public function isSmall(): bool
|
||||
{
|
||||
@@ -506,7 +499,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
public function isMedium(): bool
|
||||
{
|
||||
@@ -514,7 +507,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
public function isLarge(): bool
|
||||
{
|
||||
@@ -664,12 +657,12 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
*
|
||||
* @throws CodeCoverageException
|
||||
* @throws ReflectionException
|
||||
* @throws SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException
|
||||
* @throws SebastianBergmann\CodeCoverage\InvalidArgumentException
|
||||
* @throws SebastianBergmann\CodeCoverage\MissingCoversAnnotationException
|
||||
* @throws SebastianBergmann\CodeCoverage\RuntimeException
|
||||
* @throws SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException
|
||||
* @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\CodeCoverage\MissingCoversAnnotationException
|
||||
* @throws \SebastianBergmann\CodeCoverage\RuntimeException
|
||||
* @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
public function run(TestResult $result = null): TestResult
|
||||
{
|
||||
@@ -814,6 +807,9 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function runBare(): void
|
||||
{
|
||||
$this->numAssertions = 0;
|
||||
@@ -1026,17 +1022,11 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
return $this->inIsolation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getResult()
|
||||
{
|
||||
return $this->testResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $result
|
||||
*/
|
||||
public function setResult($result): void
|
||||
{
|
||||
$this->testResult = $result;
|
||||
@@ -1137,10 +1127,8 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* @throws AssertionFailedError
|
||||
* @throws Exception
|
||||
* @throws ExpectationFailedException
|
||||
* @throws SebastianBergmann\ObjectEnumerator\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException
|
||||
* @throws Throwable
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function runTest()
|
||||
{
|
||||
@@ -1248,8 +1236,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* resets the modified php.ini setting to its original value after the
|
||||
* test is run.
|
||||
*
|
||||
* @param mixed $newValue
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function iniSet(string $varName, $newValue): void
|
||||
@@ -1284,7 +1270,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
[$category, $locale] = $args;
|
||||
|
||||
if (\defined('LC_MESSAGES')) {
|
||||
$categories[] = LC_MESSAGES;
|
||||
$categories[] = \LC_MESSAGES;
|
||||
}
|
||||
|
||||
if (!\in_array($category, self::LOCALE_CATEGORIES, true)) {
|
||||
@@ -1330,7 +1316,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* Returns a configured test double for the specified class.
|
||||
*
|
||||
* @param string|string[] $originalClassName
|
||||
* @param array $configuration
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws \InvalidArgumentException
|
||||
@@ -1385,7 +1370,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
*
|
||||
* @param string $originalClassName
|
||||
* @param array $methods
|
||||
* @param array $arguments
|
||||
* @param string $mockClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -1418,7 +1402,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* To mock concrete methods, use the 7th parameter ($mockedMethods).
|
||||
*
|
||||
* @param string $originalClassName
|
||||
* @param array $arguments
|
||||
* @param string $mockClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -1454,7 +1437,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* @param string $wsdlFile
|
||||
* @param string $originalClassName
|
||||
* @param string $mockClassName
|
||||
* @param array $methods
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param array $options An array of options passed to SOAPClient::_construct
|
||||
*
|
||||
@@ -1465,7 +1447,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = [], $callOriginalConstructor = true, array $options = []): MockObject
|
||||
{
|
||||
if ($originalClassName === '') {
|
||||
$originalClassName = \pathinfo(\basename(\parse_url($wsdlFile)['path']), PATHINFO_FILENAME);
|
||||
$originalClassName = \pathinfo(\basename(\parse_url($wsdlFile)['path']), \PATHINFO_FILENAME);
|
||||
}
|
||||
|
||||
if (!\class_exists($originalClassName)) {
|
||||
@@ -1500,7 +1482,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* `$mockedMethods` parameter.
|
||||
*
|
||||
* @param string $traitName
|
||||
* @param array $arguments
|
||||
* @param string $mockClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -1534,7 +1515,6 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* Returns an object for the specified trait.
|
||||
*
|
||||
* @param string $traitName
|
||||
* @param array $arguments
|
||||
* @param string $traitClassName
|
||||
* @param bool $callOriginalConstructor
|
||||
* @param bool $callOriginalClone
|
||||
@@ -1666,7 +1646,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
);
|
||||
|
||||
if (!empty($missingRequirements)) {
|
||||
$this->markTestSkipped(\implode(PHP_EOL, $missingRequirements));
|
||||
$this->markTestSkipped(\implode(\PHP_EOL, $missingRequirements));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1856,7 +1836,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
|
||||
/**
|
||||
* @throws RiskyTestError
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function restoreGlobalState(): void
|
||||
@@ -1936,7 +1916,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
|
||||
/**
|
||||
* @throws RiskyTestError
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after): void
|
||||
@@ -1996,7 +1976,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SebastianBergmann\ObjectEnumerator\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException
|
||||
*/
|
||||
private function shouldInvocationMockerBeReset(MockObject $mock): bool
|
||||
{
|
||||
@@ -2022,9 +2002,9 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SebastianBergmann\ObjectEnumerator\InvalidArgumentException
|
||||
* @throws SebastianBergmann\ObjectReflector\InvalidArgumentException
|
||||
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\ObjectEnumerator\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\ObjectReflector\InvalidArgumentException
|
||||
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
|
||||
*/
|
||||
private function registerMockObjectsFromTestArguments(array $testArguments, array &$visited = []): void
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ class TestFailure
|
||||
* @var Throwable
|
||||
*/
|
||||
protected $thrownException;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@@ -34,8 +35,6 @@ class TestFailure
|
||||
/**
|
||||
* Returns a description for an exception.
|
||||
*
|
||||
* @param Throwable $e
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public static function exceptionToString(Throwable $e): string
|
||||
@@ -68,7 +67,6 @@ class TestFailure
|
||||
/**
|
||||
* Constructs a TestFailure with the given test and exception.
|
||||
*
|
||||
* @param Test $failedTest
|
||||
* @param Throwable $t
|
||||
*/
|
||||
public function __construct(Test $failedTest, $t)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use AssertionError;
|
||||
@@ -588,7 +587,7 @@ class TestResult implements Countable
|
||||
if ($this->convertErrorsToExceptions) {
|
||||
$oldErrorHandler = \set_error_handler(
|
||||
[ErrorHandler::class, 'handleError'],
|
||||
E_ALL | E_STRICT
|
||||
\E_ALL | \E_STRICT
|
||||
);
|
||||
|
||||
if ($oldErrorHandler === null) {
|
||||
@@ -767,7 +766,7 @@ class TestResult implements Countable
|
||||
$test,
|
||||
new UnintentionallyCoveredCodeError(
|
||||
'This test executed code that is not listed as code to be covered or used:' .
|
||||
PHP_EOL . $cce->getMessage()
|
||||
\PHP_EOL . $cce->getMessage()
|
||||
),
|
||||
$time
|
||||
);
|
||||
@@ -776,7 +775,7 @@ class TestResult implements Countable
|
||||
$test,
|
||||
new CoveredCodeNotExecutedException(
|
||||
'This test did not execute all the code that is listed as code to be covered:' .
|
||||
PHP_EOL . $cce->getMessage()
|
||||
\PHP_EOL . $cce->getMessage()
|
||||
),
|
||||
$time
|
||||
);
|
||||
|
||||
@@ -81,6 +81,7 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
* @var array
|
||||
*/
|
||||
protected $foundClasses = [];
|
||||
|
||||
/**
|
||||
* Last count of tests in this suite.
|
||||
*
|
||||
@@ -104,8 +105,7 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
private $declaredClasses;
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $theClass
|
||||
* @param string $name
|
||||
* @param string $name
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@@ -305,9 +305,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
return $test;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionMethod $method
|
||||
*/
|
||||
public static function isTestMethod(ReflectionMethod $method): bool
|
||||
{
|
||||
if (\strpos($method->name, 'test') === 0) {
|
||||
@@ -336,7 +333,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
* name of an existing class) or constructs an empty TestSuite
|
||||
* with the given name.
|
||||
*
|
||||
* @param mixed $theClass
|
||||
* @param string $name
|
||||
*
|
||||
* @throws Exception
|
||||
@@ -451,7 +447,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
/**
|
||||
* Adds a test to the suite.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param array $groups
|
||||
*/
|
||||
public function addTest(Test $test, $groups = []): void
|
||||
@@ -487,8 +482,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
/**
|
||||
* Adds the tests from the given class to the suite.
|
||||
*
|
||||
* @param mixed $testClass
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function addTestSuite($testClass): void
|
||||
@@ -539,8 +532,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
* added, a <code>PHPUnit\Framework\WarningTestCase</code> will be created instead,
|
||||
* leaving the current test run untouched.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function addTestFile(string $filename): void
|
||||
@@ -682,8 +673,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
|
||||
/**
|
||||
* Set tests groups of the test case
|
||||
*
|
||||
* @param array $groups
|
||||
*/
|
||||
public function setGroupDetails(array $groups): void
|
||||
{
|
||||
@@ -717,7 +706,7 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
\class_exists($this->name, false) &&
|
||||
\method_exists($this->name, $beforeClassMethod)) {
|
||||
if ($missingRequirements = \PHPUnit\Util\Test::getMissingRequirements($this->name, $beforeClassMethod)) {
|
||||
$this->markTestSuiteSkipped(\implode(PHP_EOL, $missingRequirements));
|
||||
$this->markTestSuiteSkipped(\implode(\PHP_EOL, $missingRequirements));
|
||||
}
|
||||
|
||||
\call_user_func([$this->name, $beforeClassMethod]);
|
||||
@@ -823,8 +812,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
|
||||
/**
|
||||
* Set tests of the test suite
|
||||
*
|
||||
* @param array $tests
|
||||
*/
|
||||
public function setTests(array $tests): void
|
||||
{
|
||||
@@ -907,9 +894,6 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $class
|
||||
* @param ReflectionMethod $method
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method): void
|
||||
|
||||
@@ -22,13 +22,21 @@ use SebastianBergmann\FileIterator\Facade as FileIteratorFacade;
|
||||
abstract class BaseTestRunner
|
||||
{
|
||||
public const STATUS_UNKNOWN = -1;
|
||||
|
||||
public const STATUS_PASSED = 0;
|
||||
|
||||
public const STATUS_SKIPPED = 1;
|
||||
|
||||
public const STATUS_INCOMPLETE = 2;
|
||||
|
||||
public const STATUS_FAILURE = 3;
|
||||
|
||||
public const STATUS_ERROR = 4;
|
||||
|
||||
public const STATUS_RISKY = 5;
|
||||
|
||||
public const STATUS_WARNING = 6;
|
||||
|
||||
public const SUITE_METHODNAME = 'suite';
|
||||
|
||||
/**
|
||||
@@ -44,8 +52,6 @@ abstract class BaseTestRunner
|
||||
* This is a template method, subclasses override
|
||||
* the runFailed() and clearStatus() methods.
|
||||
*
|
||||
* @param string $suiteClassName
|
||||
* @param string $suiteClassFile
|
||||
* @param array|string $suffixes
|
||||
*
|
||||
* @throws Exception
|
||||
|
||||
@@ -23,9 +23,6 @@ class Factory
|
||||
private $filters = [];
|
||||
|
||||
/**
|
||||
* @param ReflectionClass $filter
|
||||
* @param mixed $args
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function addFilter(ReflectionClass $filter, $args): void
|
||||
|
||||
@@ -27,6 +27,7 @@ class NameFilterIterator extends RecursiveFilterIterator
|
||||
* @var int
|
||||
*/
|
||||
protected $filterMin;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterIncompleteTestHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterLastTestHook extends Hook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterRiskyTestHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterSkippedTestHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterSuccessfulTestHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterTestErrorHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterTestFailureHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface AfterTestWarningHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface BeforeFirstTestHook extends Hook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface BeforeTestHook extends TestHook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface Hook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
interface TestHook extends Hook
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
|
||||
@@ -51,6 +51,7 @@ class PhptTestCase implements Test, SelfDescribing
|
||||
'safe_mode=0',
|
||||
'xdebug.default_enable=0'
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@@ -205,8 +206,6 @@ class PhptTestCase implements Test, SelfDescribing
|
||||
* Parse --INI-- section key value pairs and return as array.
|
||||
*
|
||||
* @param array|string
|
||||
* @param mixed $content
|
||||
* @param mixed $ini
|
||||
*/
|
||||
private function parseIniSection($content, $ini = []): array
|
||||
{
|
||||
@@ -401,7 +400,7 @@ class PhptTestCase implements Test, SelfDescribing
|
||||
'EXPECTF',
|
||||
'EXPECTREGEX'
|
||||
];
|
||||
$testDirectory = \dirname($this->filename) . DIRECTORY_SEPARATOR;
|
||||
$testDirectory = \dirname($this->filename) . \DIRECTORY_SEPARATOR;
|
||||
|
||||
foreach ($allowSections as $section) {
|
||||
if (isset($sections[$section . '_EXTERNAL'])) {
|
||||
@@ -480,7 +479,7 @@ class PhptTestCase implements Test, SelfDescribing
|
||||
|
||||
private function getCoverageFiles(): array
|
||||
{
|
||||
$baseDir = \dirname($this->filename) . DIRECTORY_SEPARATOR;
|
||||
$baseDir = \dirname($this->filename) . \DIRECTORY_SEPARATOR;
|
||||
$basename = \basename($this->filename, 'phpt');
|
||||
|
||||
return [
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
use ReflectionClass;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
use PHPUnit\Framework\DataProviderTestSuite;
|
||||
use PHPUnit\Framework\Test;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit\Framework\TestSuite;
|
||||
@@ -63,11 +63,18 @@ final class TestSuiteSorter
|
||||
$suite->setTests($this->randomize($suite->tests()));
|
||||
}
|
||||
|
||||
if ($resolveDependencies && $suite->tests()[0] instanceof TestCase) {
|
||||
if ($resolveDependencies && !($suite instanceof DataProviderTestSuite) && $this->suiteOnlyContainsTests($suite)) {
|
||||
$suite->setTests($this->resolveDependencies($suite->tests()));
|
||||
}
|
||||
}
|
||||
|
||||
private function suiteOnlyContainsTests(TestSuite $suite): bool
|
||||
{
|
||||
return \array_reduce($suite->tests(), function ($carry, $test) {
|
||||
return $carry && ($test instanceof TestCase || $test instanceof DataProviderTestSuite);
|
||||
}, true);
|
||||
}
|
||||
|
||||
private function reverse(array $tests): array
|
||||
{
|
||||
return \array_reverse($tests);
|
||||
@@ -91,30 +98,21 @@ final class TestSuiteSorter
|
||||
* 3. If the test has dependencies but none left to do: mark done, start again from the top
|
||||
* 4. When we reach the end add any leftover tests to the end. These will be marked 'skipped' during execution.
|
||||
*
|
||||
* @param Test[] $tests
|
||||
* @param array<DataProviderTestSuite|TestCase> $tests
|
||||
*
|
||||
* @return Test[]
|
||||
* @return array<DataProviderTestSuite|TestCase>
|
||||
*/
|
||||
private function resolveDependencies(array $tests): array
|
||||
{
|
||||
if (empty($tests)) {
|
||||
return $tests;
|
||||
}
|
||||
|
||||
$newTestOrder = [];
|
||||
$i = 0;
|
||||
|
||||
do {
|
||||
$todoNames = \array_merge(
|
||||
\array_map(function (Test $t) {
|
||||
return $t->getName();
|
||||
}, $tests),
|
||||
\array_map(function (Test $t) {
|
||||
return \get_class($t) . '::' . $t->getName();
|
||||
}, $tests)
|
||||
);
|
||||
$todoNames = \array_map(function ($test) {
|
||||
return $this->getNormalizedTestName($test);
|
||||
}, $tests);
|
||||
|
||||
if (!$tests[$i]->hasDependencies() || empty(\array_intersect($tests[$i]->getDependencies(), $todoNames))) {
|
||||
if (!$tests[$i]->hasDependencies() || empty(\array_intersect($this->getNormalizedDependencyNames($tests[$i]), $todoNames))) {
|
||||
$newTestOrder = \array_merge($newTestOrder, \array_splice($tests, $i, 1));
|
||||
$i = 0;
|
||||
} else {
|
||||
@@ -124,4 +122,40 @@ final class TestSuiteSorter
|
||||
|
||||
return \array_merge($newTestOrder, $tests);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DataProviderTestSuite|TestCase $test
|
||||
*
|
||||
* @return string Full test name as "TestSuiteClassName::testMethodName"
|
||||
*/
|
||||
private function getNormalizedTestName($test): string
|
||||
{
|
||||
if (\strpos($test->getName(), '::') !== false) {
|
||||
return $test->getName();
|
||||
}
|
||||
|
||||
return \get_class($test) . '::' . $test->getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DataProviderTestSuite|TestCase $test
|
||||
*
|
||||
* @return array<string> A list of full test names as "TestSuiteClassName::testMethodName"
|
||||
*/
|
||||
private function getNormalizedDependencyNames($test): array
|
||||
{
|
||||
if ($test instanceof DataProviderTestSuite) {
|
||||
$testClass = \substr($test->getName(), 0, \strpos($test->getName(), '::'));
|
||||
} else {
|
||||
$testClass = \get_class($test);
|
||||
}
|
||||
|
||||
$names = \array_map(function ($name) use ($testClass) {
|
||||
return \strpos($name, '::') === false
|
||||
? $testClass . '::' . $name
|
||||
: $name;
|
||||
}, $test->getDependencies());
|
||||
|
||||
return $names;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Runner;
|
||||
|
||||
use SebastianBergmann\Version as VersionId;
|
||||
@@ -18,6 +17,7 @@ use SebastianBergmann\Version as VersionId;
|
||||
class Version
|
||||
{
|
||||
private static $pharVersion;
|
||||
|
||||
private static $version;
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ class Version
|
||||
}
|
||||
|
||||
if (self::$version === null) {
|
||||
$version = new VersionId('7.2.4', \dirname(__DIR__, 2));
|
||||
$version = new VersionId('7.2.6', \dirname(__DIR__, 2));
|
||||
self::$version = $version->getVersion();
|
||||
}
|
||||
|
||||
|
||||
39
vendor/phpunit/phpunit/src/TextUI/Command.php
vendored
39
vendor/phpunit/phpunit/src/TextUI/Command.php
vendored
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\TextUI;
|
||||
|
||||
use PharIo\Manifest\ApplicationName;
|
||||
@@ -194,15 +193,13 @@ class Command
|
||||
return $this->handleListTestsXml($suite, $this->arguments['listTestsXml'], $exit);
|
||||
}
|
||||
|
||||
unset(
|
||||
$this->arguments['test'],
|
||||
$this->arguments['testFile']
|
||||
unset($this->arguments['test'], $this->arguments['testFile']
|
||||
);
|
||||
|
||||
try {
|
||||
$result = $runner->doRun($suite, $this->arguments, $exit);
|
||||
} catch (Exception $e) {
|
||||
print $e->getMessage() . PHP_EOL;
|
||||
print $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
|
||||
$return = TestRunner::FAILURE_EXIT;
|
||||
@@ -386,16 +383,16 @@ class Command
|
||||
case '--generate-configuration':
|
||||
$this->printVersionString();
|
||||
|
||||
print 'Generating phpunit.xml in ' . \getcwd() . PHP_EOL . PHP_EOL;
|
||||
print 'Generating phpunit.xml in ' . \getcwd() . \PHP_EOL . \PHP_EOL;
|
||||
|
||||
print 'Bootstrap script (relative to path shown above; default: vendor/autoload.php): ';
|
||||
$bootstrapScript = \trim(\fgets(STDIN));
|
||||
$bootstrapScript = \trim(\fgets(\STDIN));
|
||||
|
||||
print 'Tests directory (relative to path shown above; default: tests): ';
|
||||
$testsDirectory = \trim(\fgets(STDIN));
|
||||
$testsDirectory = \trim(\fgets(\STDIN));
|
||||
|
||||
print 'Source directory (relative to path shown above; default: src): ';
|
||||
$src = \trim(\fgets(STDIN));
|
||||
$src = \trim(\fgets(\STDIN));
|
||||
|
||||
if ($bootstrapScript === '') {
|
||||
$bootstrapScript = 'vendor/autoload.php';
|
||||
@@ -421,7 +418,7 @@ class Command
|
||||
)
|
||||
);
|
||||
|
||||
print PHP_EOL . 'Generated phpunit.xml in ' . \getcwd() . PHP_EOL;
|
||||
print \PHP_EOL . 'Generated phpunit.xml in ' . \getcwd() . \PHP_EOL;
|
||||
|
||||
exit(TestRunner::SUCCESS_EXIT);
|
||||
|
||||
@@ -765,7 +762,7 @@ class Command
|
||||
if (isset($includePath)) {
|
||||
\ini_set(
|
||||
'include_path',
|
||||
$includePath . PATH_SEPARATOR . \ini_get('include_path')
|
||||
$includePath . \PATH_SEPARATOR . \ini_get('include_path')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -803,7 +800,7 @@ class Command
|
||||
$this->arguments['configuration']
|
||||
);
|
||||
} catch (Throwable $t) {
|
||||
print $t->getMessage() . PHP_EOL;
|
||||
print $t->getMessage() . \PHP_EOL;
|
||||
exit(TestRunner::FAILURE_EXIT);
|
||||
}
|
||||
|
||||
@@ -1027,12 +1024,12 @@ class Command
|
||||
|
||||
if ($isOutdated) {
|
||||
\printf(
|
||||
'You are not using the latest version of PHPUnit.' . PHP_EOL .
|
||||
'The latest version is PHPUnit %s.' . PHP_EOL,
|
||||
'You are not using the latest version of PHPUnit.' . \PHP_EOL .
|
||||
'The latest version is PHPUnit %s.' . \PHP_EOL,
|
||||
$latestVersion
|
||||
);
|
||||
} else {
|
||||
print 'You are using the latest version of PHPUnit.' . PHP_EOL;
|
||||
print 'You are using the latest version of PHPUnit.' . \PHP_EOL;
|
||||
}
|
||||
|
||||
exit(TestRunner::SUCCESS_EXIT);
|
||||
@@ -1160,7 +1157,7 @@ EOT;
|
||||
return;
|
||||
}
|
||||
|
||||
print Version::getVersionString() . PHP_EOL . PHP_EOL;
|
||||
print Version::getVersionString() . \PHP_EOL . \PHP_EOL;
|
||||
|
||||
$this->versionStringPrinted = true;
|
||||
}
|
||||
@@ -1169,7 +1166,7 @@ EOT;
|
||||
{
|
||||
$this->printVersionString();
|
||||
|
||||
print $message . PHP_EOL;
|
||||
print $message . \PHP_EOL;
|
||||
|
||||
exit(TestRunner::FAILURE_EXIT);
|
||||
}
|
||||
@@ -1217,14 +1214,14 @@ EOT;
|
||||
{
|
||||
$this->printVersionString();
|
||||
|
||||
print 'Available test group(s):' . PHP_EOL;
|
||||
print 'Available test group(s):' . \PHP_EOL;
|
||||
|
||||
$groups = $suite->getGroups();
|
||||
\sort($groups);
|
||||
|
||||
foreach ($groups as $group) {
|
||||
\printf(
|
||||
' - %s' . PHP_EOL,
|
||||
' - %s' . \PHP_EOL,
|
||||
$group
|
||||
);
|
||||
}
|
||||
@@ -1240,7 +1237,7 @@ EOT;
|
||||
{
|
||||
$this->printVersionString();
|
||||
|
||||
print 'Available test suite(s):' . PHP_EOL;
|
||||
print 'Available test suite(s):' . \PHP_EOL;
|
||||
|
||||
$configuration = Configuration::getInstance(
|
||||
$this->arguments['configuration']
|
||||
@@ -1250,7 +1247,7 @@ EOT;
|
||||
|
||||
foreach ($suiteNames as $suiteName) {
|
||||
\printf(
|
||||
' - %s' . PHP_EOL,
|
||||
' - %s' . \PHP_EOL,
|
||||
$suiteName
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\TextUI;
|
||||
|
||||
use PHPUnit\Framework\AssertionFailedError;
|
||||
@@ -31,13 +30,19 @@ use SebastianBergmann\Timer\Timer;
|
||||
class ResultPrinter extends Printer implements TestListener
|
||||
{
|
||||
public const EVENT_TEST_START = 0;
|
||||
|
||||
public const EVENT_TEST_END = 1;
|
||||
|
||||
public const EVENT_TESTSUITE_START = 2;
|
||||
|
||||
public const EVENT_TESTSUITE_END = 3;
|
||||
|
||||
public const COLOR_NEVER = 'never';
|
||||
|
||||
public const COLOR_AUTO = 'auto';
|
||||
|
||||
public const COLOR_ALWAYS = 'always';
|
||||
|
||||
public const COLOR_DEFAULT = self::COLOR_NEVER;
|
||||
|
||||
private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS];
|
||||
@@ -133,12 +138,9 @@ class ResultPrinter extends Printer implements TestListener
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param mixed $out
|
||||
* @param bool $verbose
|
||||
* @param string $colors
|
||||
* @param bool $debug
|
||||
* @param int|string $numberOfColumns
|
||||
* @param bool $reverse
|
||||
* @param null|mixed $out
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\TextUI;
|
||||
|
||||
use PHPUnit\Framework\Error\Deprecated;
|
||||
@@ -59,7 +58,9 @@ use SebastianBergmann\Environment\Runtime;
|
||||
class TestRunner extends BaseTestRunner
|
||||
{
|
||||
public const SUCCESS_EXIT = 0;
|
||||
|
||||
public const FAILURE_EXIT = 1;
|
||||
|
||||
public const EXCEPTION_EXIT = 2;
|
||||
|
||||
/**
|
||||
@@ -99,7 +100,6 @@ class TestRunner extends BaseTestRunner
|
||||
|
||||
/**
|
||||
* @param ReflectionClass|Test $test
|
||||
* @param array $arguments
|
||||
* @param bool $exit
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
@@ -751,14 +751,14 @@ class TestRunner extends BaseTestRunner
|
||||
*/
|
||||
protected function runFailed(string $message): void
|
||||
{
|
||||
$this->write($message . PHP_EOL);
|
||||
$this->write($message . \PHP_EOL);
|
||||
|
||||
exit(self::FAILURE_EXIT);
|
||||
}
|
||||
|
||||
protected function write(string $buffer): void
|
||||
{
|
||||
if (PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg') {
|
||||
if (\PHP_SAPI != 'cli' && \PHP_SAPI != 'phpdbg') {
|
||||
$buffer = \htmlspecialchars($buffer);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Util;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
@@ -118,7 +117,7 @@ final class Blacklist
|
||||
}
|
||||
|
||||
// Hide process isolation workaround on Windows.
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
if (\DIRECTORY_SEPARATOR === '\\') {
|
||||
// tempnam() prefix is limited to first 3 chars.
|
||||
// @see https://php.net/manual/en/function.tempnam.php
|
||||
self::$directories[] = \sys_get_temp_dir() . '\\PHP';
|
||||
|
||||
@@ -532,8 +532,8 @@ final class Configuration
|
||||
if (!empty($configuration['include_path'])) {
|
||||
\ini_set(
|
||||
'include_path',
|
||||
\implode(PATH_SEPARATOR, $configuration['include_path']) .
|
||||
PATH_SEPARATOR .
|
||||
\implode(\PATH_SEPARATOR, $configuration['include_path']) .
|
||||
\PATH_SEPARATOR .
|
||||
\ini_get('include_path')
|
||||
);
|
||||
}
|
||||
@@ -590,6 +590,8 @@ final class Configuration
|
||||
\putenv("{$name}={$value}");
|
||||
}
|
||||
|
||||
$value = \getenv($name);
|
||||
|
||||
if (!isset($_ENV[$name])) {
|
||||
$_ENV[$name] = $value;
|
||||
}
|
||||
@@ -1066,7 +1068,7 @@ final class Configuration
|
||||
continue;
|
||||
}
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$phpVersion = \PHP_VERSION;
|
||||
$phpVersionOperator = '>=';
|
||||
$prefix = '';
|
||||
$suffix = 'Test.php';
|
||||
@@ -1079,7 +1081,7 @@ final class Configuration
|
||||
$phpVersionOperator = (string) $directoryNode->getAttribute('phpVersionOperator');
|
||||
}
|
||||
|
||||
if (!\version_compare(PHP_VERSION, $phpVersion, $phpVersionOperator)) {
|
||||
if (!\version_compare(\PHP_VERSION, $phpVersion, $phpVersionOperator)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1122,7 +1124,7 @@ final class Configuration
|
||||
}
|
||||
|
||||
$file = $file[0];
|
||||
$phpVersion = PHP_VERSION;
|
||||
$phpVersion = \PHP_VERSION;
|
||||
$phpVersionOperator = '>=';
|
||||
|
||||
if ($fileNode->hasAttribute('phpVersion')) {
|
||||
@@ -1133,7 +1135,7 @@ final class Configuration
|
||||
$phpVersionOperator = (string) $fileNode->getAttribute('phpVersionOperator');
|
||||
}
|
||||
|
||||
if (!\version_compare(PHP_VERSION, $phpVersion, $phpVersionOperator)) {
|
||||
if (!\version_compare(\PHP_VERSION, $phpVersion, $phpVersionOperator)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1148,7 +1150,6 @@ final class Configuration
|
||||
* Otherwise, returns $default, which may be a string in rare cases.
|
||||
* See PHPUnit\Util\ConfigurationTest::testPHPConfigurationIsReadCorrectly
|
||||
*
|
||||
* @param string $value
|
||||
* @param bool|string $default
|
||||
*
|
||||
* @return bool|string
|
||||
@@ -1257,7 +1258,7 @@ final class Configuration
|
||||
return $path;
|
||||
}
|
||||
|
||||
$file = \dirname($this->filename) . DIRECTORY_SEPARATOR . $path;
|
||||
$file = \dirname($this->filename) . \DIRECTORY_SEPARATOR . $path;
|
||||
|
||||
if ($useIncludePath && !\file_exists($file)) {
|
||||
$includePathFile = \stream_resolve_include_path($path);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Util;
|
||||
|
||||
final class ConfigurationGenerator
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Util;
|
||||
|
||||
use PHPUnit\Framework\Error\Deprecated;
|
||||
@@ -47,19 +46,19 @@ final class ErrorHandler
|
||||
}
|
||||
}
|
||||
|
||||
if ($errorNumber === E_NOTICE || $errorNumber === E_USER_NOTICE || $errorNumber === E_STRICT) {
|
||||
if ($errorNumber === \E_NOTICE || $errorNumber === \E_USER_NOTICE || $errorNumber === \E_STRICT) {
|
||||
if (Notice::$enabled !== true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$exception = Notice::class;
|
||||
} elseif ($errorNumber === E_WARNING || $errorNumber === E_USER_WARNING) {
|
||||
} elseif ($errorNumber === \E_WARNING || $errorNumber === \E_USER_WARNING) {
|
||||
if (Warning::$enabled !== true) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$exception = Warning::class;
|
||||
} elseif ($errorNumber === E_DEPRECATED || $errorNumber === E_USER_DEPRECATED) {
|
||||
} elseif ($errorNumber === \E_DEPRECATED || $errorNumber === \E_USER_DEPRECATED) {
|
||||
if (Deprecated::$enabled !== true) {
|
||||
return false;
|
||||
}
|
||||
@@ -80,7 +79,7 @@ final class ErrorHandler
|
||||
*
|
||||
* @throws \Exception if event of specified severity is emitted
|
||||
*/
|
||||
public static function handleErrorOnce($severity = E_WARNING): callable
|
||||
public static function handleErrorOnce($severity = \E_WARNING): callable
|
||||
{
|
||||
$terminator = function () {
|
||||
static $expired = false;
|
||||
|
||||
@@ -29,7 +29,7 @@ final class FileLoader
|
||||
public static function checkAndLoad(string $filename): string
|
||||
{
|
||||
$includePathFilename = \stream_resolve_include_path($filename);
|
||||
$localFile = __DIR__ . DIRECTORY_SEPARATOR . $filename;
|
||||
$localFile = __DIR__ . \DIRECTORY_SEPARATOR . $filename;
|
||||
|
||||
/**
|
||||
* @see https://github.com/sebastianbergmann/phpunit/pull/2751
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Util;
|
||||
|
||||
/**
|
||||
@@ -24,7 +23,7 @@ final class Filesystem
|
||||
{
|
||||
return \str_replace(
|
||||
['_', '\\'],
|
||||
DIRECTORY_SEPARATOR,
|
||||
\DIRECTORY_SEPARATOR,
|
||||
$className
|
||||
) . '.php';
|
||||
}
|
||||
|
||||
3
vendor/phpunit/phpunit/src/Util/Json.php
vendored
3
vendor/phpunit/phpunit/src/Util/Json.php
vendored
@@ -7,7 +7,6 @@
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Util;
|
||||
|
||||
use PHPUnit\Framework\Exception;
|
||||
@@ -29,7 +28,7 @@ final class Json
|
||||
);
|
||||
}
|
||||
|
||||
return \json_encode($decodedJson, JSON_PRETTY_PRINT);
|
||||
return \json_encode($decodedJson, \JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -101,8 +101,7 @@ class JUnit extends Printer implements TestListener
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param mixed $out
|
||||
* @param bool $reportUselessTests
|
||||
* @param null|mixed $out
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
@@ -364,8 +363,6 @@ class JUnit extends Printer implements TestListener
|
||||
*
|
||||
* This is a "hack" needed for the integration of
|
||||
* PHPUnit with Phing.
|
||||
*
|
||||
* @param mixed $flag
|
||||
*/
|
||||
public function setWriteDocument($flag): ?string
|
||||
{
|
||||
@@ -377,8 +374,6 @@ class JUnit extends Printer implements TestListener
|
||||
/**
|
||||
* Method which generalizes addError() and addFailure()
|
||||
*
|
||||
* @param mixed $type
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function doAddFault(Test $test, \Throwable $t, float $time, $type): void
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user