init
This commit is contained in:
8
vendor/phpunit/phpunit/.editorconfig
vendored
Normal file
8
vendor/phpunit/phpunit/.editorconfig
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
charset = utf-8
|
||||
4
vendor/phpunit/phpunit/.gitattributes
vendored
Normal file
4
vendor/phpunit/phpunit/.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/build export-ignore
|
||||
|
||||
*.php diff=php
|
||||
|
||||
28
vendor/phpunit/phpunit/.github/CODE_OF_CONDUCT.md
vendored
Normal file
28
vendor/phpunit/phpunit/.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing other's private information, such as physical or electronic
|
||||
addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainer at sebastian@phpunit.de. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.3.0, available at [http://contributor-covenant.org/version/1/3/0/][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/3/0/
|
||||
69
vendor/phpunit/phpunit/.github/CONTRIBUTING.md
vendored
Normal file
69
vendor/phpunit/phpunit/.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
# Contributing to PHPUnit
|
||||
|
||||
## Contributor Code of Conduct
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||
|
||||
## Workflow
|
||||
|
||||
* Fork the project.
|
||||
* Make your bug fix or feature addition.
|
||||
* Add tests for it. This is important so we don't break it in a future version unintentionally.
|
||||
* Send a pull request. Bonus points for topic branches.
|
||||
|
||||
Please make sure that you have [set up your user name and email address](http://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for use with Git. Strings such as `silly nick name <root@localhost>` look really stupid in the commit history of a project.
|
||||
|
||||
Pull requests for bug fixes must be based on the current stable branch whereas pull requests for new features must be based on the `master` branch.
|
||||
|
||||
We are trying to keep backwards compatibility breaks in PHPUnit to an absolute minimum. Please take this into account when proposing changes.
|
||||
|
||||
Due to time constraints, we are not always able to respond as quickly as we would like. Please do not take delays personal and feel free to remind us if you feel that we forgot to respond.
|
||||
|
||||
## Coding Guidelines
|
||||
|
||||
This project comes with a configuration file and an executable for [php-cs-fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) (`.php_cs`) that you can use to (re)format your sourcecode for compliance with this project's coding guidelines:
|
||||
|
||||
```bash
|
||||
$ ./build/tools/php-cs-fixer fix
|
||||
```
|
||||
|
||||
## Using PHPUnit from a Git checkout
|
||||
|
||||
The following commands can be used to perform the initial checkout of PHPUnit:
|
||||
|
||||
```bash
|
||||
$ git clone git://github.com/sebastianbergmann/phpunit.git
|
||||
|
||||
$ cd phpunit
|
||||
```
|
||||
|
||||
Retrieve PHPUnit's dependencies using [Composer](https://getcomposer.org/):
|
||||
|
||||
```bash
|
||||
$ composer install
|
||||
```
|
||||
|
||||
The `phpunit` script can be used to invoke the PHPUnit test runner:
|
||||
|
||||
```bash
|
||||
$ ./phpunit --version
|
||||
```
|
||||
|
||||
## Running PHPUnit's own test suite
|
||||
|
||||
After following the steps shown above, PHPUnit's own test suite is run like this:
|
||||
|
||||
```bash
|
||||
$ ./phpunit
|
||||
```
|
||||
|
||||
## Reporting issues
|
||||
|
||||
Please use the most specific issue tracker to search for existing tickets and to open new tickets:
|
||||
|
||||
* [General problems](https://github.com/sebastianbergmann/phpunit/issues)
|
||||
* [Code Coverage](https://github.com/sebastianbergmann/php-code-coverage/issues)
|
||||
* [Stub and Mock Objects](https://github.com/sebastianbergmann/phpunit-mock-objects/issues)
|
||||
* [Documentation](https://github.com/sebastianbergmann/phpunit-documentation/issues)
|
||||
* [Website](https://github.com/sebastianbergmann/phpunit-website/issues)
|
||||
|
||||
15
vendor/phpunit/phpunit/.github/ISSUE_TEMPLATE.md
vendored
Normal file
15
vendor/phpunit/phpunit/.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
| Q | A
|
||||
| --------------------| ---------------
|
||||
| PHPUnit version | x.y.z
|
||||
| PHP version | x.y.z
|
||||
| Installation Method | Composer / PHAR
|
||||
|
||||
<!--
|
||||
- Please fill in this template according to your issue.
|
||||
- Please keep the table shown above at the top of your issue.
|
||||
- Please include the output of "composer info | sort" if you installed PHPUnit using Composer.
|
||||
- Please post code as text (using proper markup). Do not post screenshots of code.
|
||||
- Visit https://phpunit.de/support.html if you are looking for support.
|
||||
- Otherwise, replace this comment by the description of your issue.
|
||||
-->
|
||||
|
||||
21
vendor/phpunit/phpunit/.gitignore
vendored
Normal file
21
vendor/phpunit/phpunit/.gitignore
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/.ant_targets
|
||||
/.idea
|
||||
/.php_cs
|
||||
/.php_cs.cache
|
||||
/.phpunit.result.cache
|
||||
/build/documentation
|
||||
/build/logfiles
|
||||
/build/phar
|
||||
/build/phpdox
|
||||
/build/*.phar
|
||||
/build/*.phar.asc
|
||||
/build/binary-phar-autoload.php
|
||||
/cache.properties
|
||||
/composer.lock
|
||||
/tests/TextUI/*.diff
|
||||
/tests/TextUI/*.exp
|
||||
/tests/TextUI/*.log
|
||||
/tests/TextUI/*.out
|
||||
/tests/TextUI/*.php
|
||||
/vendor
|
||||
|
||||
91
vendor/phpunit/phpunit/.php_cs.dist
vendored
Normal file
91
vendor/phpunit/phpunit/.php_cs.dist
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
$header = <<<'EOF'
|
||||
This file is part of PHPUnit.
|
||||
|
||||
(c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
|
||||
For the full copyright and license information, please view the LICENSE
|
||||
file that was distributed with this source code.
|
||||
EOF;
|
||||
|
||||
return PhpCsFixer\Config::create()
|
||||
->setRiskyAllowed(true)
|
||||
->setRules(
|
||||
[
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'binary_operator_spaces' => [
|
||||
'align_double_arrow' => true,
|
||||
'align_equals' => true
|
||||
],
|
||||
'blank_line_after_namespace' => true,
|
||||
'blank_line_before_statement' => [
|
||||
'statements' => [
|
||||
'break',
|
||||
'continue',
|
||||
'return',
|
||||
'throw',
|
||||
'try',
|
||||
],
|
||||
],
|
||||
'braces' => true,
|
||||
'cast_spaces' => true,
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'elseif' => true,
|
||||
'encoding' => true,
|
||||
'full_opening_tag' => true,
|
||||
'function_declaration' => true,
|
||||
'header_comment' => ['header' => $header, 'separate' => 'none'],
|
||||
'indentation_type' => true,
|
||||
'line_ending' => true,
|
||||
'lowercase_constants' => true,
|
||||
'lowercase_keywords' => true,
|
||||
'method_argument_space' => true,
|
||||
'native_function_invocation' => true,
|
||||
'no_alias_functions' => true,
|
||||
'no_blank_lines_after_class_opening' => true,
|
||||
'no_blank_lines_after_phpdoc' => true,
|
||||
'no_closing_tag' => true,
|
||||
'no_empty_phpdoc' => true,
|
||||
'no_empty_statement' => true,
|
||||
'no_extra_consecutive_blank_lines' => true,
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
'no_singleline_whitespace_before_semicolons' => true,
|
||||
'no_spaces_after_function_name' => true,
|
||||
'no_spaces_inside_parenthesis' => true,
|
||||
'no_trailing_comma_in_list_call' => true,
|
||||
'no_trailing_whitespace' => true,
|
||||
'no_unused_imports' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'ordered_imports' => true,
|
||||
'phpdoc_align' => true,
|
||||
'phpdoc_indent' => true,
|
||||
'phpdoc_no_access' => true,
|
||||
'phpdoc_no_empty_return' => true,
|
||||
'phpdoc_no_package' => true,
|
||||
'phpdoc_scalar' => true,
|
||||
'phpdoc_separation' => true,
|
||||
'phpdoc_to_comment' => true,
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_types' => true,
|
||||
'phpdoc_var_without_name' => true,
|
||||
'self_accessor' => true,
|
||||
'simplified_null_return' => true,
|
||||
'single_blank_line_at_eof' => true,
|
||||
'single_import_per_statement' => true,
|
||||
'single_line_after_imports' => true,
|
||||
'single_quote' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
'trim_array_spaces' => true,
|
||||
'visibility_required' => true,
|
||||
]
|
||||
)
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
->files()
|
||||
->in(__DIR__ . '/build')
|
||||
->in(__DIR__ . '/src')
|
||||
->in(__DIR__ . '/tests/Framework')
|
||||
->in(__DIR__ . '/tests/Runner')
|
||||
->in(__DIR__ . '/tests/Util')
|
||||
->name('*.php')
|
||||
);
|
||||
53
vendor/phpunit/phpunit/.travis.yml
vendored
Normal file
53
vendor/phpunit/phpunit/.travis.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
language: php
|
||||
|
||||
sudo: false
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libxml2-utils
|
||||
|
||||
php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 7.2
|
||||
- master
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: master
|
||||
fast_finish: true
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- DEPENDENCIES="high"
|
||||
- DEPENDENCIES="low"
|
||||
global:
|
||||
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"
|
||||
|
||||
before_install:
|
||||
- composer self-update
|
||||
- composer clear-cache
|
||||
|
||||
install:
|
||||
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi
|
||||
- if [[ "$DEPENDENCIES" = 'low' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi
|
||||
|
||||
before_script:
|
||||
- echo 'zend.assertions=1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||
- echo 'assert.exception=On' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||
|
||||
script:
|
||||
- ./phpunit --coverage-clover=coverage.xml
|
||||
- ./phpunit --configuration ./build/travis-ci-fail.xml > /dev/null; if [ $? -eq 0 ]; then echo "SHOULD FAIL"; false; else echo "fail checked"; fi;
|
||||
- xmllint --noout --schema phpunit.xsd phpunit.xml
|
||||
- xmllint --noout --schema phpunit.xsd tests/_files/configuration.xml
|
||||
- xmllint --noout --schema phpunit.xsd tests/_files/configuration_empty.xml
|
||||
- xmllint --noout --schema phpunit.xsd tests/_files/configuration_xinclude.xml -xinclude
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
242
vendor/phpunit/phpunit/ChangeLog-5.7.md
vendored
Normal file
242
vendor/phpunit/phpunit/ChangeLog-5.7.md
vendored
Normal file
@@ -0,0 +1,242 @@
|
||||
# Changes in PHPUnit 5.7
|
||||
|
||||
All notable changes of the PHPUnit 5.7 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
|
||||
|
||||
## [5.7.27] - 2018-02-01
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2236](https://github.com/sebastianbergmann/phpunit/issues/2236): Exceptions in `tearDown()` do not affect `getStatus()`
|
||||
* Fixed [#2950](https://github.com/sebastianbergmann/phpunit/issues/2950): Class extending `PHPUnit\Framework\TestSuite` does not extend `PHPUnit\FrameworkTestCase`
|
||||
* Fixed [#2972](https://github.com/sebastianbergmann/phpunit/issues/2972): PHPUnit crashes when test suite contains both `.phpt` files and unconventionally named tests
|
||||
|
||||
## [5.7.26] - 2017-12-17
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2472](https://github.com/sebastianbergmann/phpunit/issues/2472): `PHPUnit\Util\Getopt` uses deprecated `each()` function
|
||||
* Fixed [#2833](https://github.com/sebastianbergmann/phpunit/issues/2833): Test class loaded during data provider execution is not discovered
|
||||
* Fixed [#2922](https://github.com/sebastianbergmann/phpunit/issues/2922): Test class is not discovered when there is a test class with `@group` and provider throwing exception in it, tests are run with `--exclude-group` for that group, there is another class called later (after the class from above), and the name of that another class does not match its filename
|
||||
|
||||
## [5.7.25] - 2017-11-14
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2859](https://github.com/sebastianbergmann/phpunit/issues/2859): Regression caused by fix for [#2833](https://github.com/sebastianbergmann/phpunit/issues/2833)
|
||||
|
||||
## [5.7.24] - 2017-11-14
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2833](https://github.com/sebastianbergmann/phpunit/issues/2833): Test class loaded during data provider execution is not discovered
|
||||
|
||||
## [5.7.23] - 2017-10-15
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2731](https://github.com/sebastianbergmann/phpunit/issues/2731): Empty exception message cannot be expected
|
||||
|
||||
## [5.7.22] - 2017-09-24
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2769](https://github.com/sebastianbergmann/phpunit/issues/2769): Usage of `setUseErrorHandler()` produces `Undefined variable` error
|
||||
|
||||
## [5.7.21] - 2017-06-21
|
||||
|
||||
### Added
|
||||
|
||||
* Added `PHPUnit\Framework\AssertionFailedError`, `PHPUnit\Framework\Test`, and `PHPUnit\Framework\TestSuite` to the forward compatibility layer for PHPUnit 6
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2705](https://github.com/sebastianbergmann/phpunit/issues/2705): `stderr` parameter in `phpunit.xml` always considered `true`
|
||||
|
||||
## [5.7.20] - 2017-05-22
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2563](https://github.com/sebastianbergmann/phpunit/pull/2563): `phpunit --version` does not display version when running unsupported PHP
|
||||
|
||||
## [5.7.19] - 2017-04-03
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2638](https://github.com/sebastianbergmann/phpunit/pull/2638): Regression in `PHPUnit\Framework\TestCase:registerMockObjectsFromTestArguments()`
|
||||
|
||||
## [5.7.18] - 2017-04-02
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2145](https://github.com/sebastianbergmann/phpunit/issues/2145): `--stop-on-failure` fails to stop on PHP 7
|
||||
* Fixed [#2572](https://github.com/sebastianbergmann/phpunit/issues/2572): `PHPUnit\Framework\TestCase:registerMockObjectsFromTestArguments()` does not correctly handle arrays that reference themselves
|
||||
|
||||
## [5.7.17] - 2017-03-19
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2016](https://github.com/sebastianbergmann/phpunit/issues/2016): `prophesize()` does not work when static attributes are backed up
|
||||
* Fixed [#2568](https://github.com/sebastianbergmann/phpunit/issues/2568): `ArraySubsetConstraint` uses invalid cast to array
|
||||
* Fixed [#2573](https://github.com/sebastianbergmann/phpunit/issues/2573): `getMockFromWsdl()` does not handle URLs with query parameters
|
||||
* `PHPUnit\Util\Test::getDataFromTestWithAnnotation()` raises notice when docblock contains Windows line endings
|
||||
|
||||
## [5.7.16] - 2017-03-15
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2547](https://github.com/sebastianbergmann/phpunit/issues/2547): Code Coverage data is collected for test annotated with `@coversNothing`
|
||||
* Fixed [#2558](https://github.com/sebastianbergmann/phpunit/issues/2558): `countOf()` function is missing
|
||||
|
||||
## [5.7.15] - 2017-03-02
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#1999](https://github.com/sebastianbergmann/phpunit/issues/1999): Handler is inherited from previous custom option with handler
|
||||
* Fixed [#2149](https://github.com/sebastianbergmann/phpunit/issues/2149): `assertCount()` does not handle generators properly
|
||||
* Fixed [#2478](https://github.com/sebastianbergmann/phpunit/issues/2478): Tests that take too long are not reported as risky test
|
||||
|
||||
## [5.7.14] - 2017-02-19
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2489](https://github.com/sebastianbergmann/phpunit/issues/2489): `processUncoveredFilesFromWhitelist` is not handled correctly
|
||||
* Fixed default values for `addUncoveredFilesFromWhitelist` and `processUncoveredFilesFromWhitelist` in `phpunit.xsd`
|
||||
|
||||
## [5.7.13] - 2017-02-10
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2493](https://github.com/sebastianbergmann/phpunit/issues/2493): Fix for [#2475](https://github.com/sebastianbergmann/phpunit/pull/2475) does not apply to PHPUnit 5.7
|
||||
|
||||
## [5.7.12] - 2017-02-08
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2475](https://github.com/sebastianbergmann/phpunit/pull/2475): Defining a test suite with only one file does not work
|
||||
|
||||
## [5.7.11] - 2017-02-05
|
||||
|
||||
### Fixed
|
||||
|
||||
* Deprecation errors when used with PHP 7.2
|
||||
|
||||
## [5.7.10] - 2017-02-04
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2462](https://github.com/sebastianbergmann/phpunit/issues/2462): Code Coverage whitelist is filled even if no code coverage data is to be collected
|
||||
|
||||
## [5.7.9] - 2017-01-28
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2447](https://github.com/sebastianbergmann/phpunit/issues/2447): Reverted backwards incompatible change to handling of boolean environment variable values specified in XML
|
||||
|
||||
## [5.7.8] - 2017-01-26
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2446](https://github.com/sebastianbergmann/phpunit/issues/2446): Reverted backwards incompatible change to exit code in case of warnings
|
||||
|
||||
## [5.7.7] - 2017-01-25
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#1896](https://github.com/sebastianbergmann/phpunit/issues/1896): Wrong test location when `@depends` and `@dataProvider` are combined
|
||||
* Fixed [#1983](https://github.com/sebastianbergmann/phpunit/pull/1983): Tests with `@expectedException` annotation cannot be skipped
|
||||
* Fixed [#2137](https://github.com/sebastianbergmann/phpunit/issues/2137): Warnings for invalid data providers are suppressed when test execution is filtered
|
||||
* Fixed [#2275](https://github.com/sebastianbergmann/phpunit/pull/2275): Invalid UTF-8 characters can lead to missing output
|
||||
* Fixed [#2299](https://github.com/sebastianbergmann/phpunit/issues/2299): `expectExceptionMessage()` and `expectExceptionCode()` do not work without `expectException()`
|
||||
* Fixed [#2328](https://github.com/sebastianbergmann/phpunit/issues/2328): `TestListener` callbacks `startTest()` and `endTest()` are not called when test is skipped due to `@depends`
|
||||
* Fixed [#2331](https://github.com/sebastianbergmann/phpunit/issues/2331): Boolean environment variable values specified in XML get mangled
|
||||
* Fixed [#2333](https://github.com/sebastianbergmann/phpunit/issues/2333): `assertContains()` and `assertNotContains()` do not handle UTF-8 strings correctly
|
||||
* Fixed [#2340](https://github.com/sebastianbergmann/phpunit/pull/2340): Data providers that use `yield` or implement `Iterator` cannot be combined
|
||||
* Fixed [#2349](https://github.com/sebastianbergmann/phpunit/pull/2349): `PHPUnit_TextUI_Command` does not `exit()` when it should
|
||||
* Fixed [#2392](https://github.com/sebastianbergmann/phpunit/issues/2392): Empty (but valid) data provider should skip the test
|
||||
* Fixed [#2431](https://github.com/sebastianbergmann/phpunit/issues/2431): `assertArraySubset()` does not support `ArrayAccess`
|
||||
* Fixed [#2435](https://github.com/sebastianbergmann/phpunit/issues/2435): Empty `@group` annotation causes error on PHP 7.2+
|
||||
|
||||
## [5.7.6] - 2017-01-22
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2424](https://github.com/sebastianbergmann/phpunit/issues/2424): `TestCase::getStatus()` returns `STATUS_PASSED` instead of `STATUS_RISKY` for risky test
|
||||
* Fixed [#2427](https://github.com/sebastianbergmann/phpunit/issues/2427): TestDox group configuration is not handled
|
||||
* Fixed [#2428](https://github.com/sebastianbergmann/phpunit/pull/2428): Nested arrays specificied in XML configuration file are not handled correctly
|
||||
|
||||
## [5.7.5] - 2016-12-28
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2404](https://github.com/sebastianbergmann/phpunit/pull/2404): `assertDirectoryNotIsWriteable()` calls itself
|
||||
|
||||
## [5.7.4] - 2016-12-13
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2394](https://github.com/sebastianbergmann/phpunit/issues/2394): Do not treat `AssertionError` as assertion failure on PHP 5
|
||||
|
||||
## [5.7.3] - 2016-12-09
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2384](https://github.com/sebastianbergmann/phpunit/pull/2384): Handle `PHPUnit_Framework_Exception` correctly when expecting exceptions
|
||||
|
||||
## [5.7.2] - 2016-12-03
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2382](https://github.com/sebastianbergmann/phpunit/issues/2382): Uncloneable test doubles passed via data provider do not work
|
||||
|
||||
## [5.7.1] - 2016-12-02
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2380](https://github.com/sebastianbergmann/phpunit/issues/2380): Data Providers cannot be generators anymore
|
||||
|
||||
## [5.7.0] - 2016-12-02
|
||||
|
||||
### Added
|
||||
|
||||
* Merged [#2223](https://github.com/sebastianbergmann/phpunit/pull/2223): Add support for multiple data providers
|
||||
* Added `extensionsDirectory` configuration directive to configure a directory from which all `.phar` files are loaded as PHPUnit extensions
|
||||
* Added `--no-extensions` commandline option to suppress loading of extensions (from configured extension directory)
|
||||
* Added `PHPUnit\Framework\Assert` as an alias for `PHPUnit_Framework_Assert` for forward compatibility
|
||||
* Added `PHPUnit\Framework\BaseTestListener` as an alias for `PHPUnit_Framework_BaseTestListener` for forward compatibility
|
||||
* Added `PHPUnit\Framework\TestListener` as an alias for `PHPUnit_Framework_TestListener` for forward compatibility
|
||||
|
||||
### Changed
|
||||
|
||||
* The `--log-json` commandline option has been deprecated
|
||||
* The `--tap` and `--log-tap` commandline options have been deprecated
|
||||
* The `--self-update` and `--self-upgrade` commandline options have been deprecated (PHAR binary only)
|
||||
|
||||
[5.7.27]: https://github.com/sebastianbergmann/phpunit/compare/5.7.26...5.7.27
|
||||
[5.7.26]: https://github.com/sebastianbergmann/phpunit/compare/5.7.25...5.7.26
|
||||
[5.7.25]: https://github.com/sebastianbergmann/phpunit/compare/5.7.24...5.7.25
|
||||
[5.7.24]: https://github.com/sebastianbergmann/phpunit/compare/5.7.23...5.7.24
|
||||
[5.7.23]: https://github.com/sebastianbergmann/phpunit/compare/5.7.22...5.7.23
|
||||
[5.7.22]: https://github.com/sebastianbergmann/phpunit/compare/5.7.21...5.7.22
|
||||
[5.7.21]: https://github.com/sebastianbergmann/phpunit/compare/5.7.20...5.7.21
|
||||
[5.7.20]: https://github.com/sebastianbergmann/phpunit/compare/5.7.19...5.7.20
|
||||
[5.7.19]: https://github.com/sebastianbergmann/phpunit/compare/5.7.18...5.7.19
|
||||
[5.7.18]: https://github.com/sebastianbergmann/phpunit/compare/5.7.17...5.7.18
|
||||
[5.7.17]: https://github.com/sebastianbergmann/phpunit/compare/5.7.16...5.7.17
|
||||
[5.7.16]: https://github.com/sebastianbergmann/phpunit/compare/5.7.15...5.7.16
|
||||
[5.7.15]: https://github.com/sebastianbergmann/phpunit/compare/5.7.14...5.7.15
|
||||
[5.7.14]: https://github.com/sebastianbergmann/phpunit/compare/5.7.13...5.7.14
|
||||
[5.7.13]: https://github.com/sebastianbergmann/phpunit/compare/5.7.12...5.7.13
|
||||
[5.7.12]: https://github.com/sebastianbergmann/phpunit/compare/5.7.11...5.7.12
|
||||
[5.7.11]: https://github.com/sebastianbergmann/phpunit/compare/5.7.10...5.7.11
|
||||
[5.7.10]: https://github.com/sebastianbergmann/phpunit/compare/5.7.9...5.7.10
|
||||
[5.7.9]: https://github.com/sebastianbergmann/phpunit/compare/5.7.8...5.7.9
|
||||
[5.7.8]: https://github.com/sebastianbergmann/phpunit/compare/5.7.7...5.7.8
|
||||
[5.7.7]: https://github.com/sebastianbergmann/phpunit/compare/5.7.6...5.7.7
|
||||
[5.7.6]: https://github.com/sebastianbergmann/phpunit/compare/5.7.5...5.7.6
|
||||
[5.7.5]: https://github.com/sebastianbergmann/phpunit/compare/5.7.4...5.7.5
|
||||
[5.7.4]: https://github.com/sebastianbergmann/phpunit/compare/5.7.3...5.7.4
|
||||
[5.7.3]: https://github.com/sebastianbergmann/phpunit/compare/5.7.2...5.7.3
|
||||
[5.7.2]: https://github.com/sebastianbergmann/phpunit/compare/5.7.1...5.7.2
|
||||
[5.7.1]: https://github.com/sebastianbergmann/phpunit/compare/5.7.0...5.7.1
|
||||
[5.7.0]: https://github.com/sebastianbergmann/phpunit/compare/5.6...5.7.0
|
||||
|
||||
95
vendor/phpunit/phpunit/ChangeLog-6.5.md
vendored
Normal file
95
vendor/phpunit/phpunit/ChangeLog-6.5.md
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
# Changes in PHPUnit 6.5
|
||||
|
||||
All notable changes of the PHPUnit 6.5 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
|
||||
|
||||
## [6.5.11] - 2018-08-07
|
||||
|
||||
* Fixed [#3219](https://github.com/sebastianbergmann/phpunit/issues/3219): `getMockFromWsdl()` generates invalid PHP code when WSDL filename contains special characters
|
||||
|
||||
## [6.5.10] - 2018-08-03
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#3209](https://github.com/sebastianbergmann/phpunit/issues/3209): `Test::run()` and `TestCase::run()` interface contradiction
|
||||
* Fixed [#3218](https://github.com/sebastianbergmann/phpunit/issues/3218): `prefix` attribute for `directory` node missing from `phpunit.xml` XSD
|
||||
* Fixed [#3225](https://github.com/sebastianbergmann/phpunit/issues/3225): `coverage-php` missing from `phpunit.xsd`
|
||||
|
||||
## [6.5.9] - 2018-07-03
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#3142](https://github.com/sebastianbergmann/phpunit/issues/3142): Method-level annotations (`@backupGlobals`, `@backupStaticAttributes`, `@errorHandler`, `@preserveGlobalState`) do not override class-level annotations
|
||||
|
||||
## [6.5.8] - 2018-04-10
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2830](https://github.com/sebastianbergmann/phpunit/issues/2830): `@runClassInSeparateProcess` does not work for tests that use `@dataProvider`
|
||||
|
||||
## [6.5.7] - 2018-02-26
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2974](https://github.com/sebastianbergmann/phpunit/issues/2974): JUnit XML logfile contains invalid characters when test output contains binary data
|
||||
|
||||
## [6.5.6] - 2018-02-01
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2236](https://github.com/sebastianbergmann/phpunit/issues/2236): Exceptions in `tearDown()` do not affect `getStatus()`
|
||||
* Fixed [#2950](https://github.com/sebastianbergmann/phpunit/issues/2950): Class extending `PHPUnit\Framework\TestSuite` does not extend `PHPUnit\FrameworkTestCase`
|
||||
* Fixed [#2972](https://github.com/sebastianbergmann/phpunit/issues/2972): PHPUnit crashes when test suite contains both `.phpt` files and unconventionally named tests
|
||||
|
||||
## [6.5.5] - 2017-12-17
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2922](https://github.com/sebastianbergmann/phpunit/issues/2922): Test class is not discovered when there is a test class with `@group` and provider throwing exception in it, tests are run with `--exclude-group` for that group, there is another class called later (after the class from above), and the name of that another class does not match its filename
|
||||
|
||||
## [6.5.4] - 2017-12-10
|
||||
|
||||
### Changed
|
||||
|
||||
* Require version 5.0.5 of `phpunit/phpunit-mock-objects` for [phpunit-mock-objects#394](https://github.com/sebastianbergmann/phpunit-mock-objects/issues/394)
|
||||
|
||||
## [6.5.3] - 2017-12-06
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed an issue with PHPT tests when `forceCoversAnnotation="true"` is configured
|
||||
|
||||
## [6.5.2] - 2017-12-02
|
||||
|
||||
### Changed
|
||||
|
||||
* Require version 5.0.4 of `phpunit/phpunit-mock-objects` for [phpunit-mock-objects#388](https://github.com/sebastianbergmann/phpunit-mock-objects/issues/388)
|
||||
|
||||
## [6.5.1] - 2017-12-01
|
||||
|
||||
* Fixed [#2886](https://github.com/sebastianbergmann/phpunit/pull/2886): Forced environment variables do not affect `getenv()`
|
||||
|
||||
## [6.5.0] - 2017-12-01
|
||||
|
||||
### Added
|
||||
|
||||
* Implemented [#2286](https://github.com/sebastianbergmann/phpunit/issues/2286): Optional `$exit` parameter for `PHPUnit\TextUI\TestRunner::run()`
|
||||
* Implemented [#2496](https://github.com/sebastianbergmann/phpunit/issues/2496): Allow shallow copy of dependencies
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixed [#2654](https://github.com/sebastianbergmann/phpunit/issues/2654): Problems with `assertJsonStringEqualsJsonString()`
|
||||
* Fixed [#2810](https://github.com/sebastianbergmann/phpunit/pull/2810): Code Coverage for PHPT tests does not work
|
||||
|
||||
[6.5.11]: https://github.com/sebastianbergmann/phpunit/compare/6.5.10...6.5.11
|
||||
[6.5.10]: https://github.com/sebastianbergmann/phpunit/compare/6.5.9...6.5.10
|
||||
[6.5.9]: https://github.com/sebastianbergmann/phpunit/compare/6.5.8...6.5.9
|
||||
[6.5.8]: https://github.com/sebastianbergmann/phpunit/compare/6.5.7...6.5.8
|
||||
[6.5.7]: https://github.com/sebastianbergmann/phpunit/compare/6.5.6...6.5.7
|
||||
[6.5.6]: https://github.com/sebastianbergmann/phpunit/compare/6.5.5...6.5.6
|
||||
[6.5.5]: https://github.com/sebastianbergmann/phpunit/compare/6.5.4...6.5.5
|
||||
[6.5.4]: https://github.com/sebastianbergmann/phpunit/compare/6.5.3...6.5.4
|
||||
[6.5.3]: https://github.com/sebastianbergmann/phpunit/compare/6.5.2...6.5.3
|
||||
[6.5.2]: https://github.com/sebastianbergmann/phpunit/compare/6.5.1...6.5.2
|
||||
[6.5.1]: https://github.com/sebastianbergmann/phpunit/compare/6.5.0...6.5.1
|
||||
[6.5.0]: https://github.com/sebastianbergmann/phpunit/compare/6.4...6.5.0
|
||||
|
||||
33
vendor/phpunit/phpunit/LICENSE
vendored
Normal file
33
vendor/phpunit/phpunit/LICENSE
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
PHPUnit
|
||||
|
||||
Copyright (c) 2001-2018, Sebastian Bergmann <sebastian@phpunit.de>.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
* Neither the name of Sebastian Bergmann nor the names of his
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
41
vendor/phpunit/phpunit/README.md
vendored
Normal file
41
vendor/phpunit/phpunit/README.md
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# PHPUnit
|
||||
|
||||
PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.
|
||||
|
||||
[](https://packagist.org/packages/phpunit/phpunit)
|
||||
[](https://php.net/)
|
||||
[](https://phpunit.de/build-status.html)
|
||||
|
||||
## Installation
|
||||
|
||||
We distribute a [PHP Archive (PHAR)](https://php.net/phar) that has all required (as well as some optional) dependencies of PHPUnit 6.5 bundled in a single file:
|
||||
|
||||
```bash
|
||||
$ wget https://phar.phpunit.de/phpunit-6.5.phar
|
||||
|
||||
$ php phpunit-6.5.phar --version
|
||||
```
|
||||
|
||||
Alternatively, you may use [Composer](https://getcomposer.org/) to download and install PHPUnit as well as its dependencies. Please refer to the "[Getting Started](https://phpunit.de/getting-started-with-phpunit.html)" guide for details on how to install PHPUnit.
|
||||
|
||||
## Contribute
|
||||
|
||||
Please refer to [CONTRIBUTING.md](https://github.com/sebastianbergmann/phpunit/blob/master/.github/CONTRIBUTING.md) for information on how to contribute to PHPUnit and its related projects.
|
||||
|
||||
## List of Contributors
|
||||
|
||||
Thanks to everyone who has contributed to PHPUnit! You can find a detailed list of contributors on every PHPUnit related package on GitHub. This list shows only the major components:
|
||||
|
||||
* [PHPUnit](https://github.com/sebastianbergmann/phpunit/graphs/contributors)
|
||||
* [php-code-coverage](https://github.com/sebastianbergmann/php-code-coverage/graphs/contributors)
|
||||
* [phpunit-mock-objects](https://github.com/sebastianbergmann/phpunit-mock-objects/graphs/contributors)
|
||||
|
||||
A very special thanks to everyone who has contributed to the documentation and helps maintain the translations:
|
||||
|
||||
* [English](https://github.com/sebastianbergmann/phpunit-documentation-english/graphs/contributors)
|
||||
* [Spanish](https://github.com/sebastianbergmann/phpunit-documentation-spanish/graphs/contributors)
|
||||
* [French](https://github.com/sebastianbergmann/phpunit-documentation-french/graphs/contributors)
|
||||
* [Japanese](https://github.com/sebastianbergmann/phpunit-documentation-japanese/graphs/contributors)
|
||||
* [Brazilian Portuguese](https://github.com/sebastianbergmann/phpunit-documentation-brazilian-portuguese/graphs/contributors)
|
||||
* [Simplified Chinese](https://github.com/sebastianbergmann/phpunit-documentation-chinese/graphs/contributors)
|
||||
|
||||
65
vendor/phpunit/phpunit/appveyor.yml
vendored
Normal file
65
vendor/phpunit/phpunit/appveyor.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
build: false
|
||||
clone_folder: c:\phpunit
|
||||
max_jobs: 3
|
||||
platform: x86
|
||||
pull_requests:
|
||||
do_not_increment_build_number: true
|
||||
version: '{build}.{branch}'
|
||||
|
||||
environment:
|
||||
COMPOSER_ROOT_VERSION: '6.5.x-dev'
|
||||
|
||||
matrix:
|
||||
- PHP_VERSION: '7.0.25'
|
||||
XDEBUG_VERSION: '2.5.5-7.0'
|
||||
DEPENDENCIES: '--prefer-lowest'
|
||||
- PHP_VERSION: '7.0.25'
|
||||
XDEBUG_VERSION: '2.5.5-7.0'
|
||||
DEPENDENCIES: ''
|
||||
- PHP_VERSION: '7.1.11'
|
||||
XDEBUG_VERSION: '2.5.5-7.1'
|
||||
DEPENDENCIES: '--prefer-lowest'
|
||||
- PHP_VERSION: '7.1.11'
|
||||
XDEBUG_VERSION: '2.5.5-7.1'
|
||||
DEPENDENCIES: ''
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
|
||||
cache:
|
||||
- c:\php -> appveyor.yml
|
||||
- '%LOCALAPPDATA%\Composer\files'
|
||||
|
||||
init:
|
||||
- SET PATH=c:\php\%PHP_VERSION%;%PATH%
|
||||
|
||||
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 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
|
||||
- IF NOT EXIST php-installed.txt echo date.timezone="UTC" >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo extension_dir=ext >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo extension=php_curl.dll >> php.ini
|
||||
- IF NOT EXIST php-installed.txt echo extension=php_openssl.dll >> php.ini
|
||||
- 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_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 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%
|
||||
|
||||
test_script:
|
||||
- cd c:\phpunit
|
||||
- php phpunit
|
||||
421
vendor/phpunit/phpunit/build.xml
vendored
Normal file
421
vendor/phpunit/phpunit/build.xml
vendored
Normal file
@@ -0,0 +1,421 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="phpunit" default="setup">
|
||||
<target name="setup" depends="clean,install-dependencies"/>
|
||||
<target name="validate" depends="php-syntax-check,validate-composer-json,validate-phpunit-xsd"/>
|
||||
|
||||
<target name="clean" unless="clean.done" description="Cleanup build artifacts">
|
||||
<delete dir="${basedir}/bin"/>
|
||||
<delete dir="${basedir}/vendor"/>
|
||||
<delete file="${basedir}/composer.lock"/>
|
||||
<delete dir="${basedir}/build/documentation"/>
|
||||
<delete dir="${basedir}/build/logfiles"/>
|
||||
<delete dir="${basedir}/build/phar"/>
|
||||
<delete>
|
||||
<fileset dir="${basedir}/build">
|
||||
<include name="**/phpunit*.phar"/>
|
||||
<include name="**/phpunit*.phar.asc"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
<property name="clean.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="prepare" unless="prepare.done" depends="clean" description="Prepare for build">
|
||||
<mkdir dir="${basedir}/build/documentation"/>
|
||||
<mkdir dir="${basedir}/build/logfiles"/>
|
||||
<property name="prepare.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="validate-composer-json" unless="validate-composer-json.done" description="Validate composer.json">
|
||||
<exec executable="${basedir}/build/tools/composer" failonerror="true" taskname="composer">
|
||||
<arg value="validate"/>
|
||||
<arg value="--no-check-lock"/>
|
||||
<arg value="--strict"/>
|
||||
<arg value="${basedir}/composer.json"/>
|
||||
</exec>
|
||||
|
||||
<property name="validate-composer-json.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="-dependencies-installed">
|
||||
<available file="${basedir}/composer.lock" property="dependencies-installed"/>
|
||||
</target>
|
||||
|
||||
<target name="install-dependencies" unless="dependencies-installed" depends="-dependencies-installed,validate-composer-json" description="Install dependencies with Composer">
|
||||
<exec executable="${basedir}/build/tools/composer" taskname="composer">
|
||||
<arg value="update"/>
|
||||
<arg value="--no-interaction"/>
|
||||
<arg value="--no-progress"/>
|
||||
<arg value="--no-ansi"/>
|
||||
<arg value="--no-suggest"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="php-syntax-check" unless="php-syntax-check.done" description="Perform syntax check on PHP files">
|
||||
<apply executable="php" failonerror="true" taskname="lint">
|
||||
<arg value="-l"/>
|
||||
|
||||
<fileset dir="${basedir}/src">
|
||||
<include name="**/*.php"/>
|
||||
<modified/>
|
||||
</fileset>
|
||||
|
||||
<fileset dir="${basedir}/tests">
|
||||
<include name="**/*.php"/>
|
||||
<modified/>
|
||||
</fileset>
|
||||
</apply>
|
||||
|
||||
<property name="php-syntax-check.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="validate-phpunit-xsd" unless="validate-phpunit-xsd.done" description="Validate phpunit.xsd">
|
||||
<exec executable="xmllint" failonerror="true" taskname="xmllint">
|
||||
<arg value="--noout"/>
|
||||
<arg path="${basedir}/phpunit.xsd"/>
|
||||
</exec>
|
||||
|
||||
<property name="validate-phpunit-xsd.done" value="true"/>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="validate,install-dependencies" description="Run tests">
|
||||
<exec executable="${basedir}/phpunit" taskname="phpunit"/>
|
||||
</target>
|
||||
|
||||
<target name="signed-phar" depends="phar" description="Create signed PHAR archive of PHPUnit and all its dependencies">
|
||||
<exec executable="gpg" failonerror="true">
|
||||
<arg value="--local-user"/>
|
||||
<arg value="sb@sebastian-bergmann.de"/>
|
||||
<arg value="--armor"/>
|
||||
<arg value="--detach-sign"/>
|
||||
<arg path="${basedir}/build/phpunit-library-${version}.phar"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="gpg" failonerror="true">
|
||||
<arg value="--local-user"/>
|
||||
<arg value="sb@sebastian-bergmann.de"/>
|
||||
<arg value="--armor"/>
|
||||
<arg value="--detach-sign"/>
|
||||
<arg path="${basedir}/build/phpunit-${version}.phar"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="phar" depends="-phar-determine-version,-phar-prepare" description="Create PHAR archive of PHPUnit and all its dependencies">
|
||||
<antcall target="-phar-build">
|
||||
<param name="type" value="release"/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="phar-nightly" depends="-phar-prepare" description="Create PHAR archive of PHPUnit and all its dependencies (nightly)">
|
||||
<antcall target="-phar-build">
|
||||
<param name="type" value="nightly"/>
|
||||
</antcall>
|
||||
</target>
|
||||
|
||||
<target name="-phar-prepare" depends="clean,install-dependencies">
|
||||
<mkdir dir="${basedir}/build/phar"/>
|
||||
<copy file="${basedir}/composer.json" tofile="${basedir}/composer.json.bak"/>
|
||||
|
||||
<exec executable="${basedir}/build/tools/composer">
|
||||
<arg value="require"/>
|
||||
<arg value="phpunit/php-invoker:~1.1"/>
|
||||
</exec>
|
||||
|
||||
<move file="${basedir}/composer.json.bak" tofile="${basedir}/composer.json"/>
|
||||
|
||||
<exec executable="${basedir}/build/phar-manifest.php" output="${basedir}/build/phar/manifest.txt"/>
|
||||
|
||||
<copy file="${basedir}/vendor/phpunit/php-code-coverage/LICENSE" tofile="${basedir}/build/phar/php-code-coverage/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/php-code-coverage">
|
||||
<fileset dir="${basedir}/vendor/phpunit/php-code-coverage/src">
|
||||
<include name="**/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpunit/php-file-iterator/LICENSE" tofile="${basedir}/build/phar/php-file-iterator/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/php-file-iterator">
|
||||
<fileset dir="${basedir}/vendor/phpunit/php-file-iterator/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpunit/php-text-template/LICENSE" tofile="${basedir}/build/phar/php-text-template/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/php-text-template">
|
||||
<fileset dir="${basedir}/vendor/phpunit/php-text-template/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpunit/php-timer/LICENSE" tofile="${basedir}/build/phar/php-timer/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/php-timer">
|
||||
<fileset dir="${basedir}/vendor/phpunit/php-timer/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpunit/php-token-stream/LICENSE" tofile="${basedir}/build/phar/php-token-stream/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/php-token-stream">
|
||||
<fileset dir="${basedir}/vendor/phpunit/php-token-stream/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpunit/phpunit-mock-objects/LICENSE" tofile="${basedir}/build/phar/phpunit-mock-objects/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/phpunit-mock-objects">
|
||||
<fileset dir="${basedir}/vendor/phpunit/phpunit-mock-objects/src">
|
||||
<include name="**/*" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/code-unit-reverse-lookup/LICENSE" tofile="${basedir}/build/phar/sebastian-code-unit-reverse-lookup/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-code-unit-reverse-lookup">
|
||||
<fileset dir="${basedir}/vendor/sebastian/code-unit-reverse-lookup/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/comparator/LICENSE" tofile="${basedir}/build/phar/sebastian-comparator/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-comparator">
|
||||
<fileset dir="${basedir}/vendor/sebastian/comparator/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/diff/LICENSE" tofile="${basedir}/build/phar/sebastian-diff/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-diff">
|
||||
<fileset dir="${basedir}/vendor/sebastian/diff/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/environment/LICENSE" tofile="${basedir}/build/phar/sebastian-environment/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-environment">
|
||||
<fileset dir="${basedir}/vendor/sebastian/environment/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/exporter/LICENSE" tofile="${basedir}/build/phar/sebastian-exporter/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-exporter">
|
||||
<fileset dir="${basedir}/vendor/sebastian/exporter/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/recursion-context/LICENSE" tofile="${basedir}/build/phar/sebastian-recursion-context/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-recursion-context">
|
||||
<fileset dir="${basedir}/vendor/sebastian/recursion-context/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/resource-operations/LICENSE" tofile="${basedir}/build/phar/sebastian-resource-operations/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-resource-operations">
|
||||
<fileset dir="${basedir}/vendor/sebastian/resource-operations/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/global-state/LICENSE" tofile="${basedir}/build/phar/sebastian-global-state/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-global-state">
|
||||
<fileset dir="${basedir}/vendor/sebastian/global-state/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/object-enumerator/LICENSE" tofile="${basedir}/build/phar/object-enumerator/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-object-enumerator">
|
||||
<fileset dir="${basedir}/vendor/sebastian/object-enumerator/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/object-reflector/LICENSE" tofile="${basedir}/build/phar/object-reflector/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-object-reflector">
|
||||
<fileset dir="${basedir}/vendor/sebastian/object-reflector/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/sebastian/version/LICENSE" tofile="${basedir}/build/phar/sebastian-version/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/sebastian-version">
|
||||
<fileset dir="${basedir}/vendor/sebastian/version/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/doctrine/instantiator/LICENSE" tofile="${basedir}/build/phar/doctrine-instantiator/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/doctrine-instantiator">
|
||||
<fileset dir="${basedir}/vendor/doctrine/instantiator/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${basedir}/build/phar/php-invoker">
|
||||
<fileset dir="${basedir}/vendor/phpunit/php-invoker/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpdocumentor/reflection-common/LICENSE" tofile="${basedir}/build/phar/phpdocumentor-reflection-common/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/phpdocumentor-reflection-common">
|
||||
<fileset dir="${basedir}/vendor/phpdocumentor/reflection-common/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpdocumentor/reflection-docblock/LICENSE" tofile="${basedir}/build/phar/phpdocumentor-reflection-docblock/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/phpdocumentor-reflection-docblock">
|
||||
<fileset dir="${basedir}/vendor/phpdocumentor/reflection-docblock/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpdocumentor/type-resolver/LICENSE" tofile="${basedir}/build/phar/phpdocumentor-type-resolver/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/phpdocumentor-type-resolver">
|
||||
<fileset dir="${basedir}/vendor/phpdocumentor/type-resolver/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phpspec/prophecy/LICENSE" tofile="${basedir}/build/phar/phpspec-prophecy/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/phpspec-prophecy">
|
||||
<fileset dir="${basedir}/vendor/phpspec/prophecy/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/myclabs/deep-copy/LICENSE" tofile="${basedir}/build/phar/myclabs-deep-copy/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/myclabs-deep-copy">
|
||||
<fileset dir="${basedir}/vendor/myclabs/deep-copy/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/webmozart/assert/LICENSE" tofile="${basedir}/build/phar/webmozart-assert/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/webmozart-assert">
|
||||
<fileset dir="${basedir}/vendor/webmozart/assert/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phar-io/manifest/LICENSE" tofile="${basedir}/build/phar/phar-io-manifest/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/phar-io-manifest">
|
||||
<fileset dir="${basedir}/vendor/phar-io/manifest/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/phar-io/version/LICENSE" tofile="${basedir}/build/phar/phar-io-version/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/phar-io-version">
|
||||
<fileset dir="${basedir}/vendor/phar-io/version/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy file="${basedir}/vendor/theseer/tokenizer/LICENSE" tofile="${basedir}/build/phar/theseer-tokenizer/LICENSE"/>
|
||||
<copy todir="${basedir}/build/phar/theseer-tokenizer">
|
||||
<fileset dir="${basedir}/vendor/theseer/tokenizer/src">
|
||||
<include name="**/*.php" />
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="-phar-build" depends="-phar-determine-version">
|
||||
<copy todir="${basedir}/build/phar/phpunit">
|
||||
<fileset dir="${basedir}/src">
|
||||
<include name="**/*.php"/>
|
||||
<include name="**/*.tpl*"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<exec executable="${basedir}/build/phar-version.php" outputproperty="_version">
|
||||
<arg value="${version}"/>
|
||||
<arg value="${type}"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="${basedir}/build/tools/phpab" taskname="phpab">
|
||||
<arg value="--all" />
|
||||
<arg value="--static" />
|
||||
<arg value="--once" />
|
||||
<arg value="--phar" />
|
||||
<arg value="--hash" />
|
||||
<arg value="SHA-1" />
|
||||
<arg value="--output" />
|
||||
<arg path="${basedir}/build/phpunit-library-${_version}.phar" />
|
||||
<arg value="--template" />
|
||||
<arg path="${basedir}/build/library-phar-autoload.php.in" />
|
||||
<arg path="${basedir}/build/phar" />
|
||||
</exec>
|
||||
|
||||
<copy file="${basedir}/build/binary-phar-autoload.php.in" tofile="${basedir}/build/binary-phar-autoload.php"/>
|
||||
<replace file="${basedir}/build/binary-phar-autoload.php" token="X.Y.Z" value="${_version}"/>
|
||||
|
||||
<exec executable="${basedir}/build/tools/phpab" taskname="phpab">
|
||||
<arg value="--all" />
|
||||
<arg value="--nolower" />
|
||||
<arg value="--static" />
|
||||
<arg value="--phar" />
|
||||
<arg value="--hash" />
|
||||
<arg value="SHA-1" />
|
||||
<arg value="--output" />
|
||||
<arg path="${basedir}/build/phpunit-${_version}.phar" />
|
||||
<arg value="--template" />
|
||||
<arg path="${basedir}/build/binary-phar-autoload.php" />
|
||||
<arg path="${basedir}/build/phar" />
|
||||
</exec>
|
||||
|
||||
<chmod file="${basedir}/build/phpunit-${_version}.phar" perm="ugo+rx"/>
|
||||
|
||||
<delete dir="${basedir}/build/phar"/>
|
||||
<delete file="${basedir}/build/binary-phar-autoload.php"/>
|
||||
</target>
|
||||
|
||||
<target name="-phar-determine-version">
|
||||
<exec executable="${basedir}/build/version.php" outputproperty="version" />
|
||||
</target>
|
||||
|
||||
<target name="generate-project-documentation" depends="-phploc,-checkstyle,-phpunit">
|
||||
<exec executable="${basedir}/build/tools/phpdox" dir="${basedir}/build" taskname="phpdox"/>
|
||||
</target>
|
||||
|
||||
<target name="update-tools">
|
||||
<exec executable="phive">
|
||||
<arg value="--no-progress"/>
|
||||
<arg value="update"/>
|
||||
</exec>
|
||||
|
||||
<exec executable="${basedir}/build/tools/composer">
|
||||
<arg value="self-update"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="-phploc" depends="prepare">
|
||||
<exec executable="${basedir}/build/tools/phploc" output="/dev/null" taskname="phploc">
|
||||
<arg value="--count-tests"/>
|
||||
<arg value="--log-xml"/>
|
||||
<arg path="${basedir}/build/logfiles/phploc.xml"/>
|
||||
<arg path="${basedir}/src"/>
|
||||
<arg path="${basedir}/tests"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="-checkstyle" depends="prepare">
|
||||
<exec executable="${basedir}/build/tools/php-cs-fixer" output="${basedir}/build/logfiles/checkstyle.xml" error="/dev/null" taskname="php-cs-fixer">
|
||||
<arg value="--diff"/>
|
||||
<arg value="--dry-run"/>
|
||||
<arg value="fix"/>
|
||||
<arg value="--format=checkstyle"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
<target name="-phpunit" depends="setup">
|
||||
<exec executable="${basedir}/phpunit" taskname="phpunit">
|
||||
<arg value="--coverage-xml"/>
|
||||
<arg path="${basedir}/build/logfiles/coverage"/>
|
||||
<arg value="--log-junit"/>
|
||||
<arg path="${basedir}/build/logfiles/junit.xml"/>
|
||||
</exec>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
88
vendor/phpunit/phpunit/composer.json
vendored
Normal file
88
vendor/phpunit/phpunit/composer.json
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"description": "The PHP Unit Testing framework.",
|
||||
"type": "library",
|
||||
"keywords": [
|
||||
"phpunit",
|
||||
"xunit",
|
||||
"testing"
|
||||
],
|
||||
"homepage": "https://phpunit.de/",
|
||||
"license": "BSD-3-Clause",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sebastian@phpunit.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues"
|
||||
},
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": "^7.0",
|
||||
"ext-dom": "*",
|
||||
"ext-json": "*",
|
||||
"ext-libxml": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-xml": "*",
|
||||
"myclabs/deep-copy": "^1.6.1",
|
||||
"phar-io/manifest": "^1.0.1",
|
||||
"phar-io/version": "^1.0",
|
||||
"phpspec/prophecy": "^1.7",
|
||||
"phpunit/php-code-coverage": "^5.3",
|
||||
"phpunit/php-file-iterator": "^1.4.3",
|
||||
"phpunit/php-text-template": "^1.2.1",
|
||||
"phpunit/php-timer": "^1.0.9",
|
||||
"phpunit/phpunit-mock-objects": "^5.0.9",
|
||||
"sebastian/comparator": "^2.1",
|
||||
"sebastian/diff": "^2.0",
|
||||
"sebastian/environment": "^3.1",
|
||||
"sebastian/exporter": "^3.1",
|
||||
"sebastian/global-state": "^2.0",
|
||||
"sebastian/object-enumerator": "^3.0.3",
|
||||
"sebastian/resource-operations": "^1.0",
|
||||
"sebastian/version": "^2.0.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-PDO": "*"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/dbunit": "<3.0",
|
||||
"phpdocumentor/reflection-docblock": "3.0.2"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.0.0"
|
||||
},
|
||||
"optimize-autoloader": true,
|
||||
"sort-packages": true
|
||||
},
|
||||
"suggest": {
|
||||
"phpunit/php-invoker": "^1.1",
|
||||
"ext-xdebug": "*"
|
||||
},
|
||||
"bin": [
|
||||
"phpunit"
|
||||
],
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [
|
||||
"tests/"
|
||||
],
|
||||
"files": [
|
||||
"src/Framework/Assert/Functions.php",
|
||||
"tests/_files/CoveredFunction.php"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "6.5.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
vendor/phpunit/phpunit/phive.xml
vendored
Normal file
7
vendor/phpunit/phpunit/phive.xml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phive xmlns="https://phar.io/phive">
|
||||
<phar name="phpab" version="^1.24.1" installed="1.25.0" location="./build/tools/phpab" copy="true"/>
|
||||
<phar name="php-cs-fixer" version="^2.12.0" installed="2.12.2" 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>
|
||||
53
vendor/phpunit/phpunit/phpunit
vendored
Normal file
53
vendor/phpunit/phpunit/phpunit
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (version_compare('7.0.0', PHP_VERSION, '>')) {
|
||||
fwrite(
|
||||
STDERR,
|
||||
sprintf(
|
||||
'This version of PHPUnit is supported on PHP 7.0 and PHP 7.1.' . PHP_EOL .
|
||||
'You are using PHP %s (%s).' . PHP_EOL,
|
||||
PHP_VERSION,
|
||||
PHP_BINARY
|
||||
)
|
||||
);
|
||||
|
||||
die(1);
|
||||
}
|
||||
|
||||
if (!ini_get('date.timezone')) {
|
||||
ini_set('date.timezone', 'UTC');
|
||||
}
|
||||
|
||||
foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
|
||||
if (file_exists($file)) {
|
||||
define('PHPUNIT_COMPOSER_INSTALL', $file);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
unset($file);
|
||||
|
||||
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
|
||||
fwrite(
|
||||
STDERR,
|
||||
'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
|
||||
' composer install' . PHP_EOL . PHP_EOL .
|
||||
'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
|
||||
);
|
||||
|
||||
die(1);
|
||||
}
|
||||
|
||||
require PHPUNIT_COMPOSER_INSTALL;
|
||||
|
||||
PHPUnit\TextUI\Command::main();
|
||||
32
vendor/phpunit/phpunit/phpunit.xml
vendored
Normal file
32
vendor/phpunit/phpunit/phpunit.xml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="phpunit.xsd"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
verbose="true">
|
||||
<testsuites>
|
||||
<testsuite name="small">
|
||||
<directory suffix="Test.php">tests/Framework</directory>
|
||||
<directory suffix="Test.php">tests/Runner</directory>
|
||||
<directory suffix="Test.php">tests/Util</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="large">
|
||||
<directory suffix=".phpt">tests/TextUI</directory>
|
||||
<directory suffix=".phpt">tests/Regression</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||
<directory suffix=".php">src</directory>
|
||||
<exclude>
|
||||
<file>src/Framework/Assert/Functions.php</file>
|
||||
<file>src/Util/PHP/eval-stdin.php</file>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
<php>
|
||||
<const name="PHPUNIT_TESTSUITE" value="true"/>
|
||||
</php>
|
||||
</phpunit>
|
||||
272
vendor/phpunit/phpunit/phpunit.xsd
vendored
Normal file
272
vendor/phpunit/phpunit/phpunit.xsd
vendored
Normal file
@@ -0,0 +1,272 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<xs:annotation>
|
||||
<xs:documentation source="https://phpunit.de/manual/6.5/en/appendixes.configuration.html">
|
||||
This Schema file defines the rules by which the XML configuration file of PHPUnit 6.5 may be structured.
|
||||
</xs:documentation>
|
||||
<xs:appinfo source="https://phpunit.de/manual/6.5/en/appendixes.configuration.html"/>
|
||||
</xs:annotation>
|
||||
<xs:element name="phpunit" type="phpUnitType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Root Element</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:complexType name="filtersType">
|
||||
<xs:sequence>
|
||||
<xs:element name="whitelist" type="whiteListType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="filterType">
|
||||
<xs:sequence>
|
||||
<xs:group ref="pathGroup"/>
|
||||
<xs:element name="exclude" maxOccurs="unbounded" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:group ref="pathGroup"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="whiteListType">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="filterType">
|
||||
<xs:attribute name="addUncoveredFilesFromWhitelist" default="true" type="xs:boolean"/>
|
||||
<xs:attribute name="processUncoveredFilesFromWhitelist" default="false" type="xs:boolean"/>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="groupsType">
|
||||
<xs:choice>
|
||||
<xs:sequence>
|
||||
<xs:element name="include" type="groupType"/>
|
||||
<xs:element name="exclude" type="groupType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
<xs:sequence>
|
||||
<xs:element name="exclude" type="groupType"/>
|
||||
</xs:sequence>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="groupType">
|
||||
<xs:sequence>
|
||||
<xs:element name="group" type="xs:string" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="listenersType">
|
||||
<xs:sequence>
|
||||
<xs:element name="listener" type="objectType" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="objectType">
|
||||
<xs:sequence>
|
||||
<xs:element name="arguments" minOccurs="0">
|
||||
<xs:complexType>
|
||||
<xs:group ref="argumentsGroup"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="class" type="xs:string" use="required"/>
|
||||
<xs:attribute name="file" type="xs:anyURI"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="arrayType">
|
||||
<xs:sequence>
|
||||
<xs:element name="element" type="argumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="argumentType">
|
||||
<xs:group ref="argumentChoice"/>
|
||||
<xs:attribute name="key" use="required"/>
|
||||
</xs:complexType>
|
||||
<xs:group name="argumentsGroup">
|
||||
<xs:sequence>
|
||||
<xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="null" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:group>
|
||||
<xs:group name="argumentChoice">
|
||||
<xs:choice>
|
||||
<xs:element name="array" type="arrayType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="integer" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="string" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="double" type="xs:double" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="null" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="object" type="objectType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="file" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="directory" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
</xs:group>
|
||||
<xs:simpleType name="columnsType">
|
||||
<xs:union>
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer"/>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="max"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:union>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="loggersType">
|
||||
<xs:sequence>
|
||||
<xs:element name="log" type="loggerType" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="loggerType">
|
||||
<xs:attribute name="type">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="coverage-html"/>
|
||||
<xs:enumeration value="coverage-text"/>
|
||||
<xs:enumeration value="coverage-clover"/>
|
||||
<xs:enumeration value="coverage-crap4j"/>
|
||||
<xs:enumeration value="coverage-xml"/>
|
||||
<xs:enumeration value="coverage-php"/>
|
||||
<xs:enumeration value="json"/>
|
||||
<xs:enumeration value="plain"/>
|
||||
<xs:enumeration value="tap"/>
|
||||
<xs:enumeration value="teamcity"/>
|
||||
<xs:enumeration value="junit"/>
|
||||
<xs:enumeration value="testdox-html"/>
|
||||
<xs:enumeration value="testdox-text"/>
|
||||
<xs:enumeration value="testdox-xml"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="target" type="xs:anyURI"/>
|
||||
<xs:attribute name="lowUpperBound" type="xs:nonNegativeInteger" default="35"/>
|
||||
<xs:attribute name="highLowerBound" type="xs:nonNegativeInteger" default="70"/>
|
||||
<xs:attribute name="showUncoveredFiles" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="showOnlySummary" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="threshold" type="xs:nonNegativeInteger" default="30"/>
|
||||
</xs:complexType>
|
||||
<xs:group name="pathGroup">
|
||||
<xs:sequence>
|
||||
<xs:element name="directory" type="directoryFilterType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="file" type="fileFilterType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:group>
|
||||
<xs:complexType name="directoryFilterType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attribute type="xs:string" name="prefix" default=""/>
|
||||
<xs:attribute type="xs:string" name="suffix" default="Test.php"/>
|
||||
<xs:attributeGroup ref="phpVersionGroup"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="fileFilterType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:anyURI">
|
||||
<xs:attributeGroup ref="phpVersionGroup"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:attributeGroup name="phpVersionGroup">
|
||||
<xs:attribute name="phpVersion" type="xs:string" default="5.3.0"/>
|
||||
<xs:attribute name="phpVersionOperator" type="xs:string" default=">="/>
|
||||
</xs:attributeGroup>
|
||||
<xs:complexType name="phpType">
|
||||
<xs:sequence>
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="includePath" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ini" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="const" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="var" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="env" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="post" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="get" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="cookie" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="server" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="files" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="request" type="namedValueType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:choice>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="namedValueType">
|
||||
<xs:attribute name="name" use="required" type="xs:string"/>
|
||||
<xs:attribute name="value" use="required" type="xs:anySimpleType"/>
|
||||
<xs:attribute name="verbatim" use="optional" type="xs:boolean"/>
|
||||
<xs:attribute name="force" use="optional" type="xs:boolean"/>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="phpUnitType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>The main type specifying the document structure</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:group ref="configGroup"/>
|
||||
<xs:attributeGroup ref="configAttributeGroup"/>
|
||||
</xs:complexType>
|
||||
<xs:attributeGroup name="configAttributeGroup">
|
||||
<xs:attribute name="backupGlobals" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="backupStaticAttributes" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="bootstrap" type="xs:anyURI"/>
|
||||
<xs:attribute name="cacheTokens" type="xs:boolean"/>
|
||||
<xs:attribute name="colors" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="columns" type="columnsType" default="80"/>
|
||||
<xs:attribute name="convertDeprecationsToExceptions" type="xs:boolean" default="true"/>
|
||||
<xs:attribute name="convertErrorsToExceptions" type="xs:boolean" default="true"/>
|
||||
<xs:attribute name="convertNoticesToExceptions" type="xs:boolean" default="true"/>
|
||||
<xs:attribute name="convertWarningsToExceptions" type="xs:boolean" default="true"/>
|
||||
<xs:attribute name="forceCoversAnnotation" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="printerClass" type="xs:string" default="PHPUnit_TextUI_ResultPrinter"/>
|
||||
<xs:attribute name="printerFile" type="xs:anyURI"/>
|
||||
<xs:attribute name="processIsolation" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stopOnError" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stopOnFailure" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stopOnWarning" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stopOnIncomplete" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stopOnRisky" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stopOnSkipped" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="failOnRisky" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="failOnWarning" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="beStrictAboutChangesToGlobalState" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="beStrictAboutOutputDuringTests" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="beStrictAboutResourceUsageDuringSmallTests" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="beStrictAboutTestsThatDoNotTestAnything" type="xs:boolean" default="true"/>
|
||||
<xs:attribute name="beStrictAboutTodoAnnotatedTests" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="beStrictAboutCoversAnnotation" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="enforceTimeLimit" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="ignoreDeprecatedCodeUnitsFromCodeCoverage" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="timeoutForSmallTests" type="xs:integer" default="1"/>
|
||||
<xs:attribute name="timeoutForMediumTests" type="xs:integer" default="10"/>
|
||||
<xs:attribute name="timeoutForLargeTests" type="xs:integer" default="60"/>
|
||||
<xs:attribute name="testSuiteLoaderClass" type="xs:string" default="PHPUnit_Runner_StandardTestSuiteLoader"/>
|
||||
<xs:attribute name="testSuiteLoaderFile" type="xs:anyURI"/>
|
||||
<xs:attribute name="defaultTestSuite" type="xs:string" default=""/>
|
||||
<xs:attribute name="verbose" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="stderr" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="reverseDefectList" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="registerMockObjectsFromTestArgumentsRecursively" type="xs:boolean" default="false"/>
|
||||
<xs:attribute name="extensionsDirectory" type="xs:string"/>
|
||||
</xs:attributeGroup>
|
||||
<xs:group name="configGroup">
|
||||
<xs:all>
|
||||
<xs:element ref="testSuiteFacet" minOccurs="0"/>
|
||||
<xs:element name="groups" type="groupsType" minOccurs="0"/>
|
||||
<xs:element name="testdoxGroups" type="groupsType" minOccurs="0"/>
|
||||
<xs:element name="filter" type="filtersType" minOccurs="0"/>
|
||||
<xs:element name="logging" type="loggersType" minOccurs="0"/>
|
||||
<xs:element name="listeners" type="listenersType" minOccurs="0"/>
|
||||
<xs:element name="php" type="phpType" minOccurs="0"/>
|
||||
</xs:all>
|
||||
</xs:group>
|
||||
<xs:element name="testSuiteFacet" abstract="true"/>
|
||||
<xs:element name="testsuite" type="testSuiteType" substitutionGroup="testSuiteFacet"/>
|
||||
<xs:element name="testsuites" type="testSuitesType" substitutionGroup="testSuiteFacet"/>
|
||||
<xs:complexType name="testSuitesType">
|
||||
<xs:sequence>
|
||||
<xs:element name="testsuite" type="testSuiteType" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="testSuiteType">
|
||||
<xs:sequence>
|
||||
<xs:group ref="pathGroup"/>
|
||||
<xs:element name="exclude" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required"/>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
18
vendor/phpunit/phpunit/src/Exception.php
vendored
Normal file
18
vendor/phpunit/phpunit/src/Exception.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit;
|
||||
|
||||
/**
|
||||
* Marker interface for PHPUnit exceptions.
|
||||
*/
|
||||
interface Exception
|
||||
{
|
||||
}
|
||||
2920
vendor/phpunit/phpunit/src/Framework/Assert.php
vendored
Normal file
2920
vendor/phpunit/phpunit/src/Framework/Assert.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1843
vendor/phpunit/phpunit/src/Framework/Assert/Functions.php
vendored
Normal file
1843
vendor/phpunit/phpunit/src/Framework/Assert/Functions.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
27
vendor/phpunit/phpunit/src/Framework/AssertionFailedError.php
vendored
Normal file
27
vendor/phpunit/phpunit/src/Framework/AssertionFailedError.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* Thrown when an assertion failed.
|
||||
*/
|
||||
class AssertionFailedError extends Exception implements SelfDescribing
|
||||
{
|
||||
/**
|
||||
* Wrapper for getMessage() which is declared as final.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return $this->getMessage();
|
||||
}
|
||||
}
|
||||
20
vendor/phpunit/phpunit/src/Framework/BaseTestListener.php
vendored
Normal file
20
vendor/phpunit/phpunit/src/Framework/BaseTestListener.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* Implementation of the TestListener interface that does not do anything.
|
||||
*
|
||||
* @deprecated Use TestListenerDefaultImplementation trait instead
|
||||
*/
|
||||
abstract class BaseTestListener implements TestListener
|
||||
{
|
||||
use TestListenerDefaultImplementation;
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/CodeCoverageException.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/CodeCoverageException.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class CodeCoverageException extends Exception
|
||||
{
|
||||
}
|
||||
83
vendor/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php
vendored
Normal file
83
vendor/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use ArrayAccess;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the array it is evaluated for has a given key.
|
||||
*
|
||||
* Uses array_key_exists() to check if the key is found in the input array, if
|
||||
* not found the evaluation fails.
|
||||
*
|
||||
* The array key is passed in the constructor.
|
||||
*/
|
||||
class ArrayHasKey extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
protected $key;
|
||||
|
||||
/**
|
||||
* @param int|string $key
|
||||
*/
|
||||
public function __construct($key)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
if (\is_array($other)) {
|
||||
return \array_key_exists($this->key, $other);
|
||||
}
|
||||
|
||||
if ($other instanceof ArrayAccess) {
|
||||
return $other->offsetExists($this->key);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'has the key ' . $this->exporter->export($this->key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return 'an array ' . $this->toString();
|
||||
}
|
||||
}
|
||||
141
vendor/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php
vendored
Normal file
141
vendor/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use SebastianBergmann\Comparator\ComparisonFailure;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the array it is evaluated for has a specified subset.
|
||||
*
|
||||
* Uses array_replace_recursive() to check if a key value subset is part of the
|
||||
* subject array.
|
||||
*/
|
||||
class ArraySubset extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var array|\Traversable
|
||||
*/
|
||||
protected $subset;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $strict;
|
||||
|
||||
/**
|
||||
* @param array|\Traversable $subset
|
||||
* @param bool $strict Check for object identity
|
||||
*/
|
||||
public function __construct($subset, $strict = false)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->strict = $strict;
|
||||
$this->subset = $subset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
//type cast $other & $this->subset as an array to allow
|
||||
//support in standard array functions.
|
||||
$other = $this->toArray($other);
|
||||
$this->subset = $this->toArray($this->subset);
|
||||
|
||||
$patched = \array_replace_recursive($other, $this->subset);
|
||||
|
||||
if ($this->strict) {
|
||||
$result = $other === $patched;
|
||||
} else {
|
||||
$result = $other == $patched;
|
||||
}
|
||||
|
||||
if ($returnResult) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
$f = new ComparisonFailure(
|
||||
$patched,
|
||||
$other,
|
||||
\print_r($patched, true),
|
||||
\print_r($other, true)
|
||||
);
|
||||
|
||||
$this->fail($other, $description, $f);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'has the subset ' . $this->exporter->export($this->subset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return 'an array ' . $this->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|\Traversable $other
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function toArray($other)
|
||||
{
|
||||
if (\is_array($other)) {
|
||||
return $other;
|
||||
}
|
||||
|
||||
if ($other instanceof \ArrayObject) {
|
||||
return $other->getArrayCopy();
|
||||
}
|
||||
|
||||
if ($other instanceof \Traversable) {
|
||||
return \iterator_to_array($other);
|
||||
}
|
||||
|
||||
// Keep BC even if we know that array would not be the expected one
|
||||
return (array) $other;
|
||||
}
|
||||
}
|
||||
88
vendor/phpunit/phpunit/src/Framework/Constraint/Attribute.php
vendored
Normal file
88
vendor/phpunit/phpunit/src/Framework/Constraint/Attribute.php
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\Assert;
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
class Attribute extends Composite
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $attributeName;
|
||||
|
||||
/**
|
||||
* @param Constraint $constraint
|
||||
* @param string $attributeName
|
||||
*/
|
||||
public function __construct(Constraint $constraint, $attributeName)
|
||||
{
|
||||
parent::__construct($constraint);
|
||||
|
||||
$this->attributeName = $attributeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
return parent::evaluate(
|
||||
Assert::readAttribute(
|
||||
$other,
|
||||
$this->attributeName
|
||||
),
|
||||
$description,
|
||||
$returnResult
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'attribute "' . $this->attributeName . '" ' .
|
||||
$this->innerConstraint->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return $this->toString();
|
||||
}
|
||||
}
|
||||
62
vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php
vendored
Normal file
62
vendor/phpunit/phpunit/src/Framework/Constraint/Callback.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Util\InvalidArgumentHelper;
|
||||
|
||||
/**
|
||||
* Constraint that evaluates against a specified closure.
|
||||
*/
|
||||
class Callback extends Constraint
|
||||
{
|
||||
private $callback;
|
||||
|
||||
/**
|
||||
* @param callable $callback
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function __construct($callback)
|
||||
{
|
||||
if (!\is_callable($callback)) {
|
||||
throw InvalidArgumentHelper::factory(
|
||||
1,
|
||||
'callable'
|
||||
);
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->callback = $callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $value. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \call_user_func($this->callback, $other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is accepted by specified callback';
|
||||
}
|
||||
}
|
||||
83
vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php
vendored
Normal file
83
vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the class it is evaluated for has a given
|
||||
* attribute.
|
||||
*
|
||||
* The attribute name is passed in the constructor.
|
||||
*/
|
||||
class ClassHasAttribute extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $attributeName;
|
||||
|
||||
/**
|
||||
* @param string $attributeName
|
||||
*/
|
||||
public function __construct($attributeName)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->attributeName = $attributeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
$class = new ReflectionClass($other);
|
||||
|
||||
return $class->hasProperty($this->attributeName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'has attribute "%s"',
|
||||
$this->attributeName
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'%sclass "%s" %s',
|
||||
\is_object($other) ? 'object of ' : '',
|
||||
\is_object($other) ? \get_class($other) : $other,
|
||||
$this->toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
55
vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php
vendored
Normal file
55
vendor/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use ReflectionClass;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the class it is evaluated for has a given
|
||||
* static attribute.
|
||||
*
|
||||
* The attribute name is passed in the constructor.
|
||||
*/
|
||||
class ClassHasStaticAttribute extends ClassHasAttribute
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
$class = new ReflectionClass($other);
|
||||
|
||||
if ($class->hasProperty($this->attributeName)) {
|
||||
$attribute = $class->getProperty($this->attributeName);
|
||||
|
||||
return $attribute->isStatic();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'has static attribute "%s"',
|
||||
$this->attributeName
|
||||
);
|
||||
}
|
||||
}
|
||||
70
vendor/phpunit/phpunit/src/Framework/Constraint/Composite.php
vendored
Normal file
70
vendor/phpunit/phpunit/src/Framework/Constraint/Composite.php
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
abstract class Composite extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var Constraint
|
||||
*/
|
||||
protected $innerConstraint;
|
||||
|
||||
/**
|
||||
* @param Constraint $innerConstraint
|
||||
*/
|
||||
public function __construct(Constraint $innerConstraint)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->innerConstraint = $innerConstraint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
try {
|
||||
return $this->innerConstraint->evaluate(
|
||||
$other,
|
||||
$description,
|
||||
$returnResult
|
||||
);
|
||||
} catch (ExpectationFailedException $e) {
|
||||
$this->fail($other, $description, $e->getComparisonFailure());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of constraint elements.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return \count($this->innerConstraint);
|
||||
}
|
||||
}
|
||||
155
vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php
vendored
Normal file
155
vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use Countable;
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use PHPUnit\Framework\SelfDescribing;
|
||||
use SebastianBergmann\Comparator\ComparisonFailure;
|
||||
use SebastianBergmann\Exporter\Exporter;
|
||||
|
||||
/**
|
||||
* Abstract base class for constraints which can be applied to any value.
|
||||
*/
|
||||
abstract class Constraint implements Countable, SelfDescribing
|
||||
{
|
||||
protected $exporter;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->exporter = new Exporter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
$success = false;
|
||||
|
||||
if ($this->matches($other)) {
|
||||
$success = true;
|
||||
}
|
||||
|
||||
if ($returnResult) {
|
||||
return $success;
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$this->fail($other, $description);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* This method can be overridden to implement the evaluation algorithm.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of constraint elements.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an exception for the given compared value and test description
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
* @param string $description Additional information about the test
|
||||
* @param ComparisonFailure $comparisonFailure
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null)
|
||||
{
|
||||
$failureDescription = \sprintf(
|
||||
'Failed asserting that %s.',
|
||||
$this->failureDescription($other)
|
||||
);
|
||||
|
||||
$additionalFailureDescription = $this->additionalFailureDescription($other);
|
||||
|
||||
if ($additionalFailureDescription) {
|
||||
$failureDescription .= "\n" . $additionalFailureDescription;
|
||||
}
|
||||
|
||||
if (!empty($description)) {
|
||||
$failureDescription = $description . "\n" . $failureDescription;
|
||||
}
|
||||
|
||||
throw new ExpectationFailedException(
|
||||
$failureDescription,
|
||||
$comparisonFailure
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return additional failure description where needed
|
||||
*
|
||||
* The function can be overridden to provide additional failure
|
||||
* information like a diff
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function additionalFailureDescription($other)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* To provide additional failure information additionalFailureDescription
|
||||
* can be used.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return $this->exporter->export($other) . ' ' . $this->toString();
|
||||
}
|
||||
}
|
||||
135
vendor/phpunit/phpunit/src/Framework/Constraint/Count.php
vendored
Normal file
135
vendor/phpunit/phpunit/src/Framework/Constraint/Count.php
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use Countable;
|
||||
use Generator;
|
||||
use Iterator;
|
||||
use IteratorAggregate;
|
||||
use Traversable;
|
||||
|
||||
class Count extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $expectedCount = 0;
|
||||
|
||||
/**
|
||||
* @param int $expected
|
||||
*/
|
||||
public function __construct($expected)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->expectedCount = $expected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return $this->expectedCount === $this->getCountOf($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Countable|\Traversable|array $other
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
protected function getCountOf($other)
|
||||
{
|
||||
if ($other instanceof Countable || \is_array($other)) {
|
||||
return \count($other);
|
||||
}
|
||||
|
||||
if ($other instanceof Traversable) {
|
||||
while ($other instanceof IteratorAggregate) {
|
||||
$other = $other->getIterator();
|
||||
}
|
||||
|
||||
$iterator = $other;
|
||||
|
||||
if ($iterator instanceof Generator) {
|
||||
return $this->getCountOfGenerator($iterator);
|
||||
}
|
||||
|
||||
if (!$iterator instanceof Iterator) {
|
||||
return \iterator_count($iterator);
|
||||
}
|
||||
|
||||
$key = $iterator->key();
|
||||
$count = \iterator_count($iterator);
|
||||
|
||||
// Manually rewind $iterator to previous key, since iterator_count
|
||||
// moves pointer.
|
||||
if ($key !== null) {
|
||||
$iterator->rewind();
|
||||
while ($iterator->valid() && $key !== $iterator->key()) {
|
||||
$iterator->next();
|
||||
}
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total number of iterations from a generator.
|
||||
* This will fully exhaust the generator.
|
||||
*
|
||||
* @param Generator $generator
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function getCountOfGenerator(Generator $generator)
|
||||
{
|
||||
for ($count = 0; $generator->valid(); $generator->next()) {
|
||||
++$count;
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure.
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'actual size %d matches expected size %d',
|
||||
$this->getCountOf($other),
|
||||
$this->expectedCount
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'count matches %d',
|
||||
$this->expectedCount
|
||||
);
|
||||
}
|
||||
}
|
||||
59
vendor/phpunit/phpunit/src/Framework/Constraint/DirectoryExists.php
vendored
Normal file
59
vendor/phpunit/phpunit/src/Framework/Constraint/DirectoryExists.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that checks if the directory(name) that it is evaluated for exists.
|
||||
*
|
||||
* The file path to check is passed as $other in evaluate().
|
||||
*/
|
||||
class DirectoryExists extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \is_dir($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'directory "%s" exists',
|
||||
$other
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'directory exists';
|
||||
}
|
||||
}
|
||||
89
vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php
vendored
Normal file
89
vendor/phpunit/phpunit/src/Framework/Constraint/Exception.php
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Util\Filter;
|
||||
use Throwable;
|
||||
|
||||
class Exception extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $className;
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
*/
|
||||
public function __construct($className)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->className = $className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return $other instanceof $this->className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
if ($other !== null) {
|
||||
$message = '';
|
||||
if ($other instanceof Throwable) {
|
||||
$message = '. Message was: "' . $other->getMessage() . '" at'
|
||||
. "\n" . Filter::getFilteredStacktrace($other);
|
||||
}
|
||||
|
||||
return \sprintf(
|
||||
'exception of type "%s" matches expected exception "%s"%s',
|
||||
\get_class($other),
|
||||
$this->className,
|
||||
$message
|
||||
);
|
||||
}
|
||||
|
||||
return \sprintf(
|
||||
'exception of type "%s" is thrown',
|
||||
$this->className
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'exception of type "%s"',
|
||||
$this->className
|
||||
);
|
||||
}
|
||||
}
|
||||
68
vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php
vendored
Normal file
68
vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
class ExceptionCode extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $expectedCode;
|
||||
|
||||
/**
|
||||
* @param int $expected
|
||||
*/
|
||||
public function __construct($expected)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->expectedCode = $expected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param \Throwable $other
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return (string) $other->getCode() == (string) $this->expectedCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'%s is equal to expected exception code %s',
|
||||
$this->exporter->export($other->getCode()),
|
||||
$this->exporter->export($this->expectedCode)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'exception code is ';
|
||||
}
|
||||
}
|
||||
83
vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php
vendored
Normal file
83
vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
class ExceptionMessage extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $expectedMessage;
|
||||
|
||||
/**
|
||||
* @param string $expected
|
||||
*/
|
||||
public function __construct($expected)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->expectedMessage = $expected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param \Throwable $other
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
if ($this->expectedMessage === '') {
|
||||
return $other->getMessage() === '';
|
||||
}
|
||||
|
||||
return \strpos($other->getMessage(), $this->expectedMessage) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
if ($this->expectedMessage === '') {
|
||||
return \sprintf(
|
||||
"exception message is empty but is '%s'",
|
||||
$other->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
return \sprintf(
|
||||
"exception message '%s' contains '%s'",
|
||||
$other->getMessage(),
|
||||
$this->expectedMessage
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
if ($this->expectedMessage === '') {
|
||||
return 'exception message is empty';
|
||||
}
|
||||
|
||||
return 'exception message contains ';
|
||||
}
|
||||
}
|
||||
77
vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegularExpression.php
vendored
Normal file
77
vendor/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegularExpression.php
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Util\RegularExpression as RegularExpressionUtil;
|
||||
|
||||
class ExceptionMessageRegularExpression extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $expectedMessageRegExp;
|
||||
|
||||
/**
|
||||
* @param string $expected
|
||||
*/
|
||||
public function __construct($expected)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->expectedMessageRegExp = $expected;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param \PHPUnit\Framework\Exception $other
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
$match = RegularExpressionUtil::safeMatch($this->expectedMessageRegExp, $other->getMessage());
|
||||
|
||||
if (false === $match) {
|
||||
throw new \PHPUnit\Framework\Exception(
|
||||
"Invalid expected exception message regex given: '{$this->expectedMessageRegExp}'"
|
||||
);
|
||||
}
|
||||
|
||||
return 1 === $match;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
"exception message '%s' matches '%s'",
|
||||
$other->getMessage(),
|
||||
$this->expectedMessageRegExp
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'exception message matches ';
|
||||
}
|
||||
}
|
||||
59
vendor/phpunit/phpunit/src/Framework/Constraint/FileExists.php
vendored
Normal file
59
vendor/phpunit/phpunit/src/Framework/Constraint/FileExists.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that checks if the file(name) that it is evaluated for exists.
|
||||
*
|
||||
* The file path to check is passed as $other in evaluate().
|
||||
*/
|
||||
class FileExists extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \file_exists($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'file "%s" exists',
|
||||
$other
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'file exists';
|
||||
}
|
||||
}
|
||||
55
vendor/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php
vendored
Normal file
55
vendor/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the value it is evaluated for is greater
|
||||
* than a given value.
|
||||
*/
|
||||
class GreaterThan extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var int|float
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @param int|float $value
|
||||
*/
|
||||
public function __construct($value)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return $this->value < $other;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is greater than ' . $this->exporter->export($this->value);
|
||||
}
|
||||
}
|
||||
61
vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php
vendored
Normal file
61
vendor/phpunit/phpunit/src/Framework/Constraint/IsAnything.php
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
/**
|
||||
* Constraint that accepts any input value.
|
||||
*/
|
||||
class IsAnything extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
return $returnResult ? true : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is anything';
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of constraint elements.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
67
vendor/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php
vendored
Normal file
67
vendor/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use Countable;
|
||||
|
||||
/**
|
||||
* Constraint that checks whether a variable is empty().
|
||||
*/
|
||||
class IsEmpty extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
if ($other instanceof Countable) {
|
||||
return \count($other) === 0;
|
||||
}
|
||||
|
||||
return empty($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is empty';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
$type = \gettype($other);
|
||||
|
||||
return \sprintf(
|
||||
'%s %s %s',
|
||||
$type[0] == 'a' || $type[0] == 'o' ? 'an' : 'a',
|
||||
$type,
|
||||
$this->toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
178
vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php
vendored
Normal file
178
vendor/phpunit/phpunit/src/Framework/Constraint/IsEqual.php
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use PHPUnit\Util\InvalidArgumentHelper;
|
||||
use SebastianBergmann\Comparator\ComparisonFailure;
|
||||
use SebastianBergmann\Comparator\Factory as ComparatorFactory;
|
||||
|
||||
/**
|
||||
* Constraint that checks if one value is equal to another.
|
||||
*
|
||||
* Equality is checked with PHP's == operator, the operator is explained in
|
||||
* detail at {@url http://www.php.net/manual/en/types.comparisons.php}.
|
||||
* Two values are equal if they have the same value disregarding type.
|
||||
*
|
||||
* The expected value is passed in the constructor.
|
||||
*/
|
||||
class IsEqual extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
protected $delta = 0.0;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $maxDepth = 10;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $canonicalize = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $ignoreCase = false;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @param float $delta
|
||||
* @param int $maxDepth
|
||||
* @param bool $canonicalize
|
||||
* @param bool $ignoreCase
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function __construct($value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!\is_numeric($delta)) {
|
||||
throw InvalidArgumentHelper::factory(2, 'numeric');
|
||||
}
|
||||
|
||||
if (!\is_int($maxDepth)) {
|
||||
throw InvalidArgumentHelper::factory(3, 'integer');
|
||||
}
|
||||
|
||||
if (!\is_bool($canonicalize)) {
|
||||
throw InvalidArgumentHelper::factory(4, 'boolean');
|
||||
}
|
||||
|
||||
if (!\is_bool($ignoreCase)) {
|
||||
throw InvalidArgumentHelper::factory(5, 'boolean');
|
||||
}
|
||||
|
||||
$this->value = $value;
|
||||
$this->delta = $delta;
|
||||
$this->maxDepth = $maxDepth;
|
||||
$this->canonicalize = $canonicalize;
|
||||
$this->ignoreCase = $ignoreCase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
// If $this->value and $other are identical, they are also equal.
|
||||
// This is the most common path and will allow us to skip
|
||||
// initialization of all the comparators.
|
||||
if ($this->value === $other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$comparatorFactory = ComparatorFactory::getInstance();
|
||||
|
||||
try {
|
||||
$comparator = $comparatorFactory->getComparatorFor(
|
||||
$this->value,
|
||||
$other
|
||||
);
|
||||
|
||||
$comparator->assertEquals(
|
||||
$this->value,
|
||||
$other,
|
||||
$this->delta,
|
||||
$this->canonicalize,
|
||||
$this->ignoreCase
|
||||
);
|
||||
} catch (ComparisonFailure $f) {
|
||||
if ($returnResult) {
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new ExpectationFailedException(
|
||||
\trim($description . "\n" . $f->getMessage()),
|
||||
$f
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
$delta = '';
|
||||
|
||||
if (\is_string($this->value)) {
|
||||
if (\strpos($this->value, "\n") !== false) {
|
||||
return 'is equal to <text>';
|
||||
}
|
||||
|
||||
return \sprintf(
|
||||
'is equal to "%s"',
|
||||
$this->value
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->delta != 0) {
|
||||
$delta = \sprintf(
|
||||
' with delta <%F>',
|
||||
$this->delta
|
||||
);
|
||||
}
|
||||
|
||||
return \sprintf(
|
||||
'is equal to %s%s',
|
||||
$this->exporter->export($this->value),
|
||||
$delta
|
||||
);
|
||||
}
|
||||
}
|
||||
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsFalse.php
vendored
Normal file
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsFalse.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that accepts false.
|
||||
*/
|
||||
class IsFalse extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return $other === false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is false';
|
||||
}
|
||||
}
|
||||
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsFinite.php
vendored
Normal file
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsFinite.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that accepts finite.
|
||||
*/
|
||||
class IsFinite extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \is_finite($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is finite';
|
||||
}
|
||||
}
|
||||
133
vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php
vendored
Normal file
133
vendor/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use SebastianBergmann\Comparator\ComparisonFailure;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that one value is identical to another.
|
||||
*
|
||||
* Identical check is performed with PHP's === operator, the operator is
|
||||
* explained in detail at
|
||||
* {@url http://www.php.net/manual/en/types.comparisons.php}.
|
||||
* Two values are identical if they have the same value and are of the same
|
||||
* type.
|
||||
*
|
||||
* The expected value is passed in the constructor.
|
||||
*/
|
||||
class IsIdentical extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
const EPSILON = 0.0000000001;
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function __construct($value)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
if (\is_float($this->value) && \is_float($other) &&
|
||||
!\is_infinite($this->value) && !\is_infinite($other) &&
|
||||
!\is_nan($this->value) && !\is_nan($other)) {
|
||||
$success = \abs($this->value - $other) < self::EPSILON;
|
||||
} else {
|
||||
$success = $this->value === $other;
|
||||
}
|
||||
|
||||
if ($returnResult) {
|
||||
return $success;
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$f = null;
|
||||
|
||||
// if both values are strings, make sure a diff is generated
|
||||
if (\is_string($this->value) && \is_string($other)) {
|
||||
$f = new ComparisonFailure(
|
||||
$this->value,
|
||||
$other,
|
||||
\sprintf("'%s'", $this->value),
|
||||
\sprintf("'%s'", $other)
|
||||
);
|
||||
}
|
||||
|
||||
$this->fail($other, $description, $f);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
if (\is_object($this->value) && \is_object($other)) {
|
||||
return 'two variables reference the same object';
|
||||
}
|
||||
|
||||
if (\is_string($this->value) && \is_string($other)) {
|
||||
return 'two strings are identical';
|
||||
}
|
||||
|
||||
return parent::failureDescription($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
if (\is_object($this->value)) {
|
||||
return 'is identical to an object of class "' .
|
||||
\get_class($this->value) . '"';
|
||||
}
|
||||
|
||||
return 'is identical to ' . $this->exporter->export($this->value);
|
||||
}
|
||||
}
|
||||
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsInfinite.php
vendored
Normal file
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsInfinite.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that accepts infinite.
|
||||
*/
|
||||
class IsInfinite extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \is_infinite($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is infinite';
|
||||
}
|
||||
}
|
||||
96
vendor/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php
vendored
Normal file
96
vendor/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the object it is evaluated for is an instance
|
||||
* of a given class.
|
||||
*
|
||||
* The expected class name is passed in the constructor.
|
||||
*/
|
||||
class IsInstanceOf extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $className;
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
*/
|
||||
public function __construct($className)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->className = $className;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return ($other instanceof $this->className);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'%s is an instance of %s "%s"',
|
||||
$this->exporter->shortenedExport($other),
|
||||
$this->getType(),
|
||||
$this->className
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'is instance of %s "%s"',
|
||||
$this->getType(),
|
||||
$this->className
|
||||
);
|
||||
}
|
||||
|
||||
private function getType()
|
||||
{
|
||||
try {
|
||||
$reflection = new ReflectionClass($this->className);
|
||||
if ($reflection->isInterface()) {
|
||||
return 'interface';
|
||||
}
|
||||
} catch (ReflectionException $e) {
|
||||
}
|
||||
|
||||
return 'class';
|
||||
}
|
||||
}
|
||||
76
vendor/phpunit/phpunit/src/Framework/Constraint/IsJson.php
vendored
Normal file
76
vendor/phpunit/phpunit/src/Framework/Constraint/IsJson.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that a string is valid JSON.
|
||||
*/
|
||||
class IsJson extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
if ($other === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
\json_decode($other);
|
||||
if (\json_last_error()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
if ($other === '') {
|
||||
return 'an empty string is valid JSON';
|
||||
}
|
||||
|
||||
\json_decode($other);
|
||||
$error = JsonMatchesErrorMessageProvider::determineJsonError(
|
||||
\json_last_error()
|
||||
);
|
||||
|
||||
return \sprintf(
|
||||
'%s is valid JSON (%s)',
|
||||
$this->exporter->shortenedExport($other),
|
||||
$error
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is valid JSON';
|
||||
}
|
||||
}
|
||||
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsNan.php
vendored
Normal file
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsNan.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that accepts nan.
|
||||
*/
|
||||
class IsNan extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \is_nan($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is nan';
|
||||
}
|
||||
}
|
||||
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsNull.php
vendored
Normal file
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsNull.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that accepts null.
|
||||
*/
|
||||
class IsNull extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return $other === null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is null';
|
||||
}
|
||||
}
|
||||
59
vendor/phpunit/phpunit/src/Framework/Constraint/IsReadable.php
vendored
Normal file
59
vendor/phpunit/phpunit/src/Framework/Constraint/IsReadable.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that checks if the file/dir(name) that it is evaluated for is readable.
|
||||
*
|
||||
* The file path to check is passed as $other in evaluate().
|
||||
*/
|
||||
class IsReadable extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \is_readable($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'"%s" is readable',
|
||||
$other
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is readable';
|
||||
}
|
||||
}
|
||||
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsTrue.php
vendored
Normal file
39
vendor/phpunit/phpunit/src/Framework/Constraint/IsTrue.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that accepts true.
|
||||
*/
|
||||
class IsTrue extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return $other === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is true';
|
||||
}
|
||||
}
|
||||
142
vendor/phpunit/phpunit/src/Framework/Constraint/IsType.php
vendored
Normal file
142
vendor/phpunit/phpunit/src/Framework/Constraint/IsType.php
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the value it is evaluated for is of a
|
||||
* specified type.
|
||||
*
|
||||
* The expected value is passed in the constructor.
|
||||
*/
|
||||
class IsType extends Constraint
|
||||
{
|
||||
const TYPE_ARRAY = 'array';
|
||||
const TYPE_BOOL = 'bool';
|
||||
const TYPE_FLOAT = 'float';
|
||||
const TYPE_INT = 'int';
|
||||
const TYPE_NULL = 'null';
|
||||
const TYPE_NUMERIC = 'numeric';
|
||||
const TYPE_OBJECT = 'object';
|
||||
const TYPE_RESOURCE = 'resource';
|
||||
const TYPE_STRING = 'string';
|
||||
const TYPE_SCALAR = 'scalar';
|
||||
const TYPE_CALLABLE = 'callable';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $types = [
|
||||
'array' => true,
|
||||
'boolean' => true,
|
||||
'bool' => true,
|
||||
'double' => true,
|
||||
'float' => true,
|
||||
'integer' => true,
|
||||
'int' => true,
|
||||
'null' => true,
|
||||
'numeric' => true,
|
||||
'object' => true,
|
||||
'real' => true,
|
||||
'resource' => true,
|
||||
'string' => true,
|
||||
'scalar' => true,
|
||||
'callable' => true
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function __construct($type)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!isset($this->types[$type])) {
|
||||
throw new \PHPUnit\Framework\Exception(
|
||||
\sprintf(
|
||||
'Type specified for PHPUnit\Framework\Constraint\IsType <%s> ' .
|
||||
'is not a valid type.',
|
||||
$type
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
switch ($this->type) {
|
||||
case 'numeric':
|
||||
return \is_numeric($other);
|
||||
|
||||
case 'integer':
|
||||
case 'int':
|
||||
return \is_int($other);
|
||||
|
||||
case 'double':
|
||||
case 'float':
|
||||
case 'real':
|
||||
return \is_float($other);
|
||||
|
||||
case 'string':
|
||||
return \is_string($other);
|
||||
|
||||
case 'boolean':
|
||||
case 'bool':
|
||||
return \is_bool($other);
|
||||
|
||||
case 'null':
|
||||
return null === $other;
|
||||
|
||||
case 'array':
|
||||
return \is_array($other);
|
||||
|
||||
case 'object':
|
||||
return \is_object($other);
|
||||
|
||||
case 'resource':
|
||||
return \is_resource($other) || \is_string(@\get_resource_type($other));
|
||||
|
||||
case 'scalar':
|
||||
return \is_scalar($other);
|
||||
|
||||
case 'callable':
|
||||
return \is_callable($other);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'is of type "%s"',
|
||||
$this->type
|
||||
);
|
||||
}
|
||||
}
|
||||
59
vendor/phpunit/phpunit/src/Framework/Constraint/IsWritable.php
vendored
Normal file
59
vendor/phpunit/phpunit/src/Framework/Constraint/IsWritable.php
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that checks if the file/dir(name) that it is evaluated for is writable.
|
||||
*
|
||||
* The file path to check is passed as $other in evaluate().
|
||||
*/
|
||||
class IsWritable extends Constraint
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \is_writable($other);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'"%s" is writable',
|
||||
$other
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is writable';
|
||||
}
|
||||
}
|
||||
113
vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php
vendored
Normal file
113
vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
use PHPUnit\Util\Json;
|
||||
use SebastianBergmann\Comparator\ComparisonFailure;
|
||||
|
||||
/**
|
||||
* Asserts whether or not two JSON objects are equal.
|
||||
*/
|
||||
class JsonMatches extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* Creates a new constraint.
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public function __construct($value)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* This method can be overridden to implement the evaluation algorithm.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
list($error, $recodedOther) = Json::canonicalize($other);
|
||||
if ($error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
list($error, $recodedValue) = Json::canonicalize($this->value);
|
||||
if ($error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $recodedOther == $recodedValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an exception for the given compared value and test description
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
* @param string $description Additional information about the test
|
||||
* @param ComparisonFailure $comparisonFailure
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
protected function fail($other, $description, ComparisonFailure $comparisonFailure = null)
|
||||
{
|
||||
if ($comparisonFailure === null) {
|
||||
list($error) = Json::canonicalize($other);
|
||||
if ($error) {
|
||||
parent::fail($other, $description);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
list($error) = Json::canonicalize($this->value);
|
||||
if ($error) {
|
||||
parent::fail($other, $description);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$comparisonFailure = new ComparisonFailure(
|
||||
\json_decode($this->value),
|
||||
\json_decode($other),
|
||||
Json::prettify($this->value),
|
||||
Json::prettify($other),
|
||||
false,
|
||||
'Failed asserting that two json values are equal.'
|
||||
);
|
||||
}
|
||||
|
||||
parent::fail($other, $description, $comparisonFailure);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'matches JSON string "%s"',
|
||||
$this->value
|
||||
);
|
||||
}
|
||||
}
|
||||
72
vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php
vendored
Normal file
72
vendor/phpunit/phpunit/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Provides human readable messages for each JSON error.
|
||||
*/
|
||||
class JsonMatchesErrorMessageProvider
|
||||
{
|
||||
/**
|
||||
* Translates JSON error to a human readable string.
|
||||
*
|
||||
* @param string $error
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function determineJsonError($error, $prefix = '')
|
||||
{
|
||||
switch ($error) {
|
||||
case JSON_ERROR_NONE:
|
||||
return;
|
||||
case JSON_ERROR_DEPTH:
|
||||
return $prefix . 'Maximum stack depth exceeded';
|
||||
case JSON_ERROR_STATE_MISMATCH:
|
||||
return $prefix . 'Underflow or the modes mismatch';
|
||||
case JSON_ERROR_CTRL_CHAR:
|
||||
return $prefix . 'Unexpected control character found';
|
||||
case JSON_ERROR_SYNTAX:
|
||||
return $prefix . 'Syntax error, malformed JSON';
|
||||
case JSON_ERROR_UTF8:
|
||||
return $prefix . 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
||||
default:
|
||||
return $prefix . 'Unknown error';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates a given type to a human readable message prefix.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function translateTypeToPrefix($type)
|
||||
{
|
||||
switch (\strtolower($type)) {
|
||||
case 'expected':
|
||||
$prefix = 'Expected value JSON decode error - ';
|
||||
|
||||
break;
|
||||
case 'actual':
|
||||
$prefix = 'Actual value JSON decode error - ';
|
||||
|
||||
break;
|
||||
default:
|
||||
$prefix = '';
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return $prefix;
|
||||
}
|
||||
}
|
||||
55
vendor/phpunit/phpunit/src/Framework/Constraint/LessThan.php
vendored
Normal file
55
vendor/phpunit/phpunit/src/Framework/Constraint/LessThan.php
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the value it is evaluated for is less than
|
||||
* a given value.
|
||||
*/
|
||||
class LessThan extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var int|float
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @param int|float $value
|
||||
*/
|
||||
public function __construct($value)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return $this->value > $other;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'is less than ' . $this->exporter->export($this->value);
|
||||
}
|
||||
}
|
||||
134
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalAnd.php
vendored
Normal file
134
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalAnd.php
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
/**
|
||||
* Logical AND.
|
||||
*/
|
||||
class LogicalAnd extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var Constraint[]
|
||||
*/
|
||||
protected $constraints = [];
|
||||
|
||||
/**
|
||||
* @var Constraint
|
||||
*/
|
||||
protected $lastConstraint;
|
||||
|
||||
public static function fromConstraints(Constraint ...$constraints): self
|
||||
{
|
||||
$constraint = new self;
|
||||
|
||||
$constraint->constraints = \array_values($constraints);
|
||||
|
||||
return $constraint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Constraint[] $constraints
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function setConstraints(array $constraints)
|
||||
{
|
||||
$this->constraints = [];
|
||||
|
||||
foreach ($constraints as $constraint) {
|
||||
if (!($constraint instanceof Constraint)) {
|
||||
throw new \PHPUnit\Framework\Exception(
|
||||
'All parameters to ' . __CLASS__ .
|
||||
' must be a constraint object.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->constraints[] = $constraint;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
$success = true;
|
||||
$constraint = null;
|
||||
|
||||
foreach ($this->constraints as $constraint) {
|
||||
if (!$constraint->evaluate($other, $description, true)) {
|
||||
$success = false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($returnResult) {
|
||||
return $success;
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$this->fail($other, $description);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
$text = '';
|
||||
|
||||
foreach ($this->constraints as $key => $constraint) {
|
||||
if ($key > 0) {
|
||||
$text .= ' and ';
|
||||
}
|
||||
|
||||
$text .= $constraint->toString();
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of constraint elements.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->constraints as $constraint) {
|
||||
$count += \count($constraint);
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
181
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalNot.php
vendored
Normal file
181
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalNot.php
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
/**
|
||||
* Logical NOT.
|
||||
*/
|
||||
class LogicalNot extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var Constraint
|
||||
*/
|
||||
protected $constraint;
|
||||
|
||||
/**
|
||||
* @param Constraint $constraint
|
||||
*/
|
||||
public function __construct($constraint)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!($constraint instanceof Constraint)) {
|
||||
$constraint = new IsEqual($constraint);
|
||||
}
|
||||
|
||||
$this->constraint = $constraint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function negate($string)
|
||||
{
|
||||
$positives = [
|
||||
'contains ',
|
||||
'exists',
|
||||
'has ',
|
||||
'is ',
|
||||
'are ',
|
||||
'matches ',
|
||||
'starts with ',
|
||||
'ends with ',
|
||||
'reference ',
|
||||
'not not '
|
||||
];
|
||||
|
||||
$negatives = [
|
||||
'does not contain ',
|
||||
'does not exist',
|
||||
'does not have ',
|
||||
'is not ',
|
||||
'are not ',
|
||||
'does not match ',
|
||||
'starts not with ',
|
||||
'ends not with ',
|
||||
'don\'t reference ',
|
||||
'not '
|
||||
];
|
||||
|
||||
\preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches);
|
||||
|
||||
if (\count($matches) > 0) {
|
||||
$nonInput = $matches[2];
|
||||
|
||||
$negatedString = \str_replace(
|
||||
$nonInput,
|
||||
\str_replace(
|
||||
$positives,
|
||||
$negatives,
|
||||
$nonInput
|
||||
),
|
||||
$string
|
||||
);
|
||||
} else {
|
||||
$negatedString = \str_replace(
|
||||
$positives,
|
||||
$negatives,
|
||||
$string
|
||||
);
|
||||
}
|
||||
|
||||
return $negatedString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
$success = !$this->constraint->evaluate($other, $description, true);
|
||||
|
||||
if ($returnResult) {
|
||||
return $success;
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$this->fail($other, $description);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
switch (\get_class($this->constraint)) {
|
||||
case LogicalAnd::class:
|
||||
case self::class:
|
||||
case LogicalOr::class:
|
||||
return 'not( ' . $this->constraint->failureDescription($other) . ' )';
|
||||
|
||||
default:
|
||||
return self::negate(
|
||||
$this->constraint->failureDescription($other)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
switch (\get_class($this->constraint)) {
|
||||
case LogicalAnd::class:
|
||||
case self::class:
|
||||
case LogicalOr::class:
|
||||
return 'not( ' . $this->constraint->toString() . ' )';
|
||||
|
||||
default:
|
||||
return self::negate(
|
||||
$this->constraint->toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of constraint elements.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return \count($this->constraint);
|
||||
}
|
||||
}
|
||||
126
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalOr.php
vendored
Normal file
126
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalOr.php
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
/**
|
||||
* Logical OR.
|
||||
*/
|
||||
class LogicalOr extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var Constraint[]
|
||||
*/
|
||||
protected $constraints = [];
|
||||
|
||||
public static function fromConstraints(Constraint ...$constraints): self
|
||||
{
|
||||
$constraint = new self;
|
||||
|
||||
$constraint->constraints = \array_values($constraints);
|
||||
|
||||
return $constraint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Constraint[] $constraints
|
||||
*/
|
||||
public function setConstraints(array $constraints)
|
||||
{
|
||||
$this->constraints = [];
|
||||
|
||||
foreach ($constraints as $constraint) {
|
||||
if (!($constraint instanceof Constraint)) {
|
||||
$constraint = new IsEqual(
|
||||
$constraint
|
||||
);
|
||||
}
|
||||
|
||||
$this->constraints[] = $constraint;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
$success = false;
|
||||
$constraint = null;
|
||||
|
||||
foreach ($this->constraints as $constraint) {
|
||||
if ($constraint->evaluate($other, $description, true)) {
|
||||
$success = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($returnResult) {
|
||||
return $success;
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$this->fail($other, $description);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
$text = '';
|
||||
|
||||
foreach ($this->constraints as $key => $constraint) {
|
||||
if ($key > 0) {
|
||||
$text .= ' or ';
|
||||
}
|
||||
|
||||
$text .= $constraint->toString();
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of constraint elements.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->constraints as $constraint) {
|
||||
$count += \count($constraint);
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
131
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalXor.php
vendored
Normal file
131
vendor/phpunit/phpunit/src/Framework/Constraint/LogicalXor.php
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
/**
|
||||
* Logical XOR.
|
||||
*/
|
||||
class LogicalXor extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var Constraint[]
|
||||
*/
|
||||
protected $constraints = [];
|
||||
|
||||
public static function fromConstraints(Constraint ...$constraints): self
|
||||
{
|
||||
$constraint = new self;
|
||||
|
||||
$constraint->constraints = \array_values($constraints);
|
||||
|
||||
return $constraint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Constraint[] $constraints
|
||||
*/
|
||||
public function setConstraints(array $constraints)
|
||||
{
|
||||
$this->constraints = [];
|
||||
|
||||
foreach ($constraints as $constraint) {
|
||||
if (!($constraint instanceof Constraint)) {
|
||||
$constraint = new IsEqual(
|
||||
$constraint
|
||||
);
|
||||
}
|
||||
|
||||
$this->constraints[] = $constraint;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
$success = true;
|
||||
$lastResult = null;
|
||||
$constraint = null;
|
||||
|
||||
foreach ($this->constraints as $constraint) {
|
||||
$result = $constraint->evaluate($other, $description, true);
|
||||
|
||||
if ($result === $lastResult) {
|
||||
$success = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$lastResult = $result;
|
||||
}
|
||||
|
||||
if ($returnResult) {
|
||||
return $success;
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$this->fail($other, $description);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
$text = '';
|
||||
|
||||
foreach ($this->constraints as $key => $constraint) {
|
||||
if ($key > 0) {
|
||||
$text .= ' xor ';
|
||||
}
|
||||
|
||||
$text .= $constraint->toString();
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Counts the number of constraint elements.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->constraints as $constraint) {
|
||||
$count += \count($constraint);
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
36
vendor/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php
vendored
Normal file
36
vendor/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use ReflectionObject;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the object it is evaluated for has a given
|
||||
* attribute.
|
||||
*
|
||||
* The attribute name is passed in the constructor.
|
||||
*/
|
||||
class ObjectHasAttribute extends ClassHasAttribute
|
||||
{
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
$object = new ReflectionObject($other);
|
||||
|
||||
return $object->hasProperty($this->attributeName);
|
||||
}
|
||||
}
|
||||
62
vendor/phpunit/phpunit/src/Framework/Constraint/RegularExpression.php
vendored
Normal file
62
vendor/phpunit/phpunit/src/Framework/Constraint/RegularExpression.php
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the string it is evaluated for matches
|
||||
* a regular expression.
|
||||
*
|
||||
* Checks a given value using the Perl Compatible Regular Expression extension
|
||||
* in PHP. The pattern is matched by executing preg_match().
|
||||
*
|
||||
* The pattern string passed in the constructor.
|
||||
*/
|
||||
class RegularExpression extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $pattern;
|
||||
|
||||
/**
|
||||
* @param string $pattern
|
||||
*/
|
||||
public function __construct($pattern)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->pattern = $pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \preg_match($this->pattern, $other) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'matches PCRE pattern "%s"',
|
||||
$this->pattern
|
||||
);
|
||||
}
|
||||
}
|
||||
26
vendor/phpunit/phpunit/src/Framework/Constraint/SameSize.php
vendored
Normal file
26
vendor/phpunit/phpunit/src/Framework/Constraint/SameSize.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
class SameSize extends Count
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $expectedCount;
|
||||
|
||||
/**
|
||||
* @param \Countable|\Traversable|array $expected
|
||||
*/
|
||||
public function __construct($expected)
|
||||
{
|
||||
parent::__construct($this->getCountOf($expected));
|
||||
}
|
||||
}
|
||||
84
vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php
vendored
Normal file
84
vendor/phpunit/phpunit/src/Framework/Constraint/StringContains.php
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the string it is evaluated for contains
|
||||
* a given string.
|
||||
*
|
||||
* Uses mb_strpos() to find the position of the string in the input, if not
|
||||
* found the evaluation fails.
|
||||
*
|
||||
* The sub-string is passed in the constructor.
|
||||
*/
|
||||
class StringContains extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $string;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $ignoreCase;
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
* @param bool $ignoreCase
|
||||
*/
|
||||
public function __construct($string, $ignoreCase = false)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->string = $string;
|
||||
$this->ignoreCase = $ignoreCase;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
if ('' === $this->string) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->ignoreCase) {
|
||||
return \mb_stripos($other, $this->string) !== false;
|
||||
}
|
||||
|
||||
return \mb_strpos($other, $this->string) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
if ($this->ignoreCase) {
|
||||
$string = \mb_strtolower($this->string);
|
||||
} else {
|
||||
$string = $this->string;
|
||||
}
|
||||
|
||||
return \sprintf(
|
||||
'contains "%s"',
|
||||
$string
|
||||
);
|
||||
}
|
||||
}
|
||||
54
vendor/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php
vendored
Normal file
54
vendor/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the string it is evaluated for ends with a given
|
||||
* suffix.
|
||||
*/
|
||||
class StringEndsWith extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $suffix;
|
||||
|
||||
/**
|
||||
* @param string $suffix
|
||||
*/
|
||||
public function __construct($suffix)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->suffix = $suffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \substr($other, 0 - \strlen($this->suffix)) == $this->suffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'ends with "' . $this->suffix . '"';
|
||||
}
|
||||
}
|
||||
101
vendor/phpunit/phpunit/src/Framework/Constraint/StringMatchesFormatDescription.php
vendored
Normal file
101
vendor/phpunit/phpunit/src/Framework/Constraint/StringMatchesFormatDescription.php
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use SebastianBergmann\Diff\Differ;
|
||||
|
||||
/**
|
||||
* ...
|
||||
*/
|
||||
class StringMatchesFormatDescription extends RegularExpression
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $string;
|
||||
|
||||
/**
|
||||
* @param string $string
|
||||
*/
|
||||
public function __construct($string)
|
||||
{
|
||||
parent::__construct($string);
|
||||
|
||||
$this->pattern = $this->createPatternFromFormat(
|
||||
\preg_replace('/\r\n/', "\n", $string)
|
||||
);
|
||||
|
||||
$this->string = $string;
|
||||
}
|
||||
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return 'string matches format description';
|
||||
}
|
||||
|
||||
protected function additionalFailureDescription($other)
|
||||
{
|
||||
$from = \preg_split('(\r\n|\r|\n)', $this->string);
|
||||
$to = \preg_split('(\r\n|\r|\n)', $other);
|
||||
|
||||
foreach ($from as $index => $line) {
|
||||
if (isset($to[$index]) && $line !== $to[$index]) {
|
||||
$line = $this->createPatternFromFormat($line);
|
||||
|
||||
if (\preg_match($line, $to[$index]) > 0) {
|
||||
$from[$index] = $to[$index];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->string = \implode("\n", $from);
|
||||
$other = \implode("\n", $to);
|
||||
|
||||
$differ = new Differ("--- Expected\n+++ Actual\n");
|
||||
|
||||
return $differ->diff($this->string, $other);
|
||||
}
|
||||
|
||||
protected function createPatternFromFormat($string)
|
||||
{
|
||||
$string = \str_replace(
|
||||
[
|
||||
'%e',
|
||||
'%s',
|
||||
'%S',
|
||||
'%a',
|
||||
'%A',
|
||||
'%w',
|
||||
'%i',
|
||||
'%d',
|
||||
'%x',
|
||||
'%f',
|
||||
'%c'
|
||||
],
|
||||
[
|
||||
'\\' . DIRECTORY_SEPARATOR,
|
||||
'[^\r\n]+',
|
||||
'[^\r\n]*',
|
||||
'.+',
|
||||
'.*',
|
||||
'\s*',
|
||||
'[+-]?\d+',
|
||||
'\d+',
|
||||
'[0-9a-fA-F]+',
|
||||
'[+-]?\.?\d+\.?\d*(?:[Ee][+-]?\d+)?',
|
||||
'.'
|
||||
],
|
||||
\preg_quote($string, '/')
|
||||
);
|
||||
|
||||
return '/^' . $string . '$/s';
|
||||
}
|
||||
}
|
||||
54
vendor/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php
vendored
Normal file
54
vendor/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the string it is evaluated for begins with a
|
||||
* given prefix.
|
||||
*/
|
||||
class StringStartsWith extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $prefix;
|
||||
|
||||
/**
|
||||
* @param string $prefix
|
||||
*/
|
||||
public function __construct($prefix)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->prefix = $prefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
return \strpos($other, $this->prefix) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'starts with "' . $this->prefix . '"';
|
||||
}
|
||||
}
|
||||
131
vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php
vendored
Normal file
131
vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Util\InvalidArgumentHelper;
|
||||
use SplObjectStorage;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the Traversable it is applied to contains
|
||||
* a given value.
|
||||
*/
|
||||
class TraversableContains extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $checkForObjectIdentity;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $checkForNonObjectIdentity;
|
||||
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @param bool $checkForObjectIdentity
|
||||
* @param bool $checkForNonObjectIdentity
|
||||
*
|
||||
* @throws \PHPUnit\Framework\Exception
|
||||
*/
|
||||
public function __construct($value, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if (!\is_bool($checkForObjectIdentity)) {
|
||||
throw InvalidArgumentHelper::factory(2, 'boolean');
|
||||
}
|
||||
|
||||
if (!\is_bool($checkForNonObjectIdentity)) {
|
||||
throw InvalidArgumentHelper::factory(3, 'boolean');
|
||||
}
|
||||
|
||||
$this->checkForObjectIdentity = $checkForObjectIdentity;
|
||||
$this->checkForNonObjectIdentity = $checkForNonObjectIdentity;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other. Returns true if the
|
||||
* constraint is met, false otherwise.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matches($other)
|
||||
{
|
||||
if ($other instanceof SplObjectStorage) {
|
||||
return $other->contains($this->value);
|
||||
}
|
||||
|
||||
if (\is_object($this->value)) {
|
||||
foreach ($other as $element) {
|
||||
if ($this->checkForObjectIdentity && $element === $this->value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!$this->checkForObjectIdentity && $element == $this->value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($other as $element) {
|
||||
if ($this->checkForNonObjectIdentity && $element === $this->value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!$this->checkForNonObjectIdentity && $element == $this->value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
if (\is_string($this->value) && \strpos($this->value, "\n") !== false) {
|
||||
return 'contains "' . $this->value . '"';
|
||||
}
|
||||
|
||||
return 'contains ' . $this->exporter->export($this->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the description of the failure
|
||||
*
|
||||
* The beginning of failure messages is "Failed asserting that" in most
|
||||
* cases. This method should return the second part of that sentence.
|
||||
*
|
||||
* @param mixed $other Evaluated value or object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function failureDescription($other)
|
||||
{
|
||||
return \sprintf(
|
||||
'%s %s',
|
||||
\is_array($other) ? 'an array' : 'a traversable',
|
||||
$this->toString()
|
||||
);
|
||||
}
|
||||
}
|
||||
97
vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php
vendored
Normal file
97
vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Constraint;
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
/**
|
||||
* Constraint that asserts that the Traversable it is applied to contains
|
||||
* only values of a given type.
|
||||
*/
|
||||
class TraversableContainsOnly extends Constraint
|
||||
{
|
||||
/**
|
||||
* @var Constraint
|
||||
*/
|
||||
protected $constraint;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $type;
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param bool $isNativeType
|
||||
*/
|
||||
public function __construct($type, $isNativeType = true)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if ($isNativeType) {
|
||||
$this->constraint = new IsType($type);
|
||||
} else {
|
||||
$this->constraint = new IsInstanceOf(
|
||||
$type
|
||||
);
|
||||
}
|
||||
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluates the constraint for parameter $other
|
||||
*
|
||||
* If $returnResult is set to false (the default), an exception is thrown
|
||||
* in case of a failure. null is returned otherwise.
|
||||
*
|
||||
* If $returnResult is true, the result of the evaluation is returned as
|
||||
* a boolean value instead: true in case of success, false in case of a
|
||||
* failure.
|
||||
*
|
||||
* @param mixed $other Value or object to evaluate.
|
||||
* @param string $description Additional information about the test
|
||||
* @param bool $returnResult Whether to return a result or throw an exception
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @throws ExpectationFailedException
|
||||
*/
|
||||
public function evaluate($other, $description = '', $returnResult = false)
|
||||
{
|
||||
$success = true;
|
||||
|
||||
foreach ($other as $item) {
|
||||
if (!$this->constraint->evaluate($item, '', true)) {
|
||||
$success = false;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($returnResult) {
|
||||
return $success;
|
||||
}
|
||||
|
||||
if (!$success) {
|
||||
$this->fail($other, $description);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the constraint.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return 'contains only values of type "' . $this->type . '"';
|
||||
}
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/CoveredCodeNotExecutedException.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/CoveredCodeNotExecutedException.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class CoveredCodeNotExecutedException extends RiskyTestError
|
||||
{
|
||||
}
|
||||
25
vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php
vendored
Normal file
25
vendor/phpunit/phpunit/src/Framework/DataProviderTestSuite.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class DataProviderTestSuite extends TestSuite
|
||||
{
|
||||
/**
|
||||
* Sets the dependencies of a TestCase.
|
||||
*
|
||||
* @param string[] $dependencies
|
||||
*/
|
||||
public function setDependencies(array $dependencies)
|
||||
{
|
||||
foreach ($this->tests as $test) {
|
||||
$test->setDependencies($dependencies);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/Error/Deprecated.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Error;
|
||||
|
||||
class Deprecated extends Error
|
||||
{
|
||||
public static $enabled = true;
|
||||
}
|
||||
36
vendor/phpunit/phpunit/src/Framework/Error/Error.php
vendored
Normal file
36
vendor/phpunit/phpunit/src/Framework/Error/Error.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework\Error;
|
||||
|
||||
use PHPUnit\Framework\Exception;
|
||||
|
||||
/**
|
||||
* Wrapper for PHP errors.
|
||||
*/
|
||||
class Error extends Exception
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param string $file
|
||||
* @param int $line
|
||||
* @param \Exception $previous
|
||||
*/
|
||||
public function __construct($message, $code, $file, $line, \Exception $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
$this->file = $file;
|
||||
$this->line = $line;
|
||||
}
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/Error/Notice.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/Error/Notice.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Error;
|
||||
|
||||
class Notice extends Error
|
||||
{
|
||||
public static $enabled = true;
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/Error/Warning.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/Error/Warning.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework\Error;
|
||||
|
||||
class Warning extends Error
|
||||
{
|
||||
public static $enabled = true;
|
||||
}
|
||||
80
vendor/phpunit/phpunit/src/Framework/Exception.php
vendored
Normal file
80
vendor/phpunit/phpunit/src/Framework/Exception.php
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use PHPUnit\Util\Filter;
|
||||
|
||||
/**
|
||||
* Base class for all PHPUnit Framework exceptions.
|
||||
*
|
||||
* Ensures that exceptions thrown during a test run do not leave stray
|
||||
* references behind.
|
||||
*
|
||||
* Every Exception contains a stack trace. Each stack frame contains the 'args'
|
||||
* of the called function. The function arguments can contain references to
|
||||
* instantiated objects. The references prevent the objects from being
|
||||
* destructed (until test results are eventually printed), so memory cannot be
|
||||
* freed up.
|
||||
*
|
||||
* With enabled process isolation, test results are serialized in the child
|
||||
* process and unserialized in the parent process. The stack trace of Exceptions
|
||||
* may contain objects that cannot be serialized or unserialized (e.g., PDO
|
||||
* connections). Unserializing user-space objects from the child process into
|
||||
* the parent would break the intended encapsulation of process isolation.
|
||||
*
|
||||
* @see http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions
|
||||
*/
|
||||
class Exception extends \RuntimeException implements \PHPUnit\Exception
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $serializableTrace;
|
||||
|
||||
public function __construct($message = '', $code = 0, \Exception $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
$this->serializableTrace = $this->getTrace();
|
||||
|
||||
foreach ($this->serializableTrace as $i => $call) {
|
||||
unset($this->serializableTrace[$i]['args']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the serializable trace (without 'args').
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSerializableTrace()
|
||||
{
|
||||
return $this->serializableTrace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$string = TestFailure::exceptionToString($this);
|
||||
|
||||
if ($trace = Filter::getFilteredStacktrace($this)) {
|
||||
$string .= "\n" . $trace;
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return \array_keys(\get_object_vars($this));
|
||||
}
|
||||
}
|
||||
93
vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php
vendored
Normal file
93
vendor/phpunit/phpunit/src/Framework/ExceptionWrapper.php
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use PHPUnit\Util\Filter;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Wraps Exceptions thrown by code under test.
|
||||
*
|
||||
* Re-instantiates Exceptions thrown by user-space code to retain their original
|
||||
* class names, properties, and stack traces (but without arguments).
|
||||
*
|
||||
* Unlike PHPUnit\Framework_\Exception, the complete stack of previous Exceptions
|
||||
* is processed.
|
||||
*/
|
||||
class ExceptionWrapper extends Exception
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $className;
|
||||
|
||||
/**
|
||||
* @var ExceptionWrapper|null
|
||||
*/
|
||||
protected $previous;
|
||||
|
||||
/**
|
||||
* @param Throwable $t
|
||||
*/
|
||||
public function __construct(Throwable $t)
|
||||
{
|
||||
// PDOException::getCode() is a string.
|
||||
// @see http://php.net/manual/en/class.pdoexception.php#95812
|
||||
parent::__construct($t->getMessage(), (int) $t->getCode());
|
||||
|
||||
$this->className = \get_class($t);
|
||||
$this->file = $t->getFile();
|
||||
$this->line = $t->getLine();
|
||||
|
||||
$this->serializableTrace = $t->getTrace();
|
||||
|
||||
foreach ($this->serializableTrace as $i => $call) {
|
||||
unset($this->serializableTrace[$i]['args']);
|
||||
}
|
||||
|
||||
if ($t->getPrevious()) {
|
||||
$this->previous = new self($t->getPrevious());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getClassName()
|
||||
{
|
||||
return $this->className;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ExceptionWrapper
|
||||
*/
|
||||
public function getPreviousWrapped()
|
||||
{
|
||||
return $this->previous;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$string = TestFailure::exceptionToString($this);
|
||||
|
||||
if ($trace = Filter::getFilteredStacktrace($this)) {
|
||||
$string .= "\n" . $trace;
|
||||
}
|
||||
|
||||
if ($this->previous) {
|
||||
$string .= "\nCaused by\n" . $this->previous;
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
44
vendor/phpunit/phpunit/src/Framework/ExpectationFailedException.php
vendored
Normal file
44
vendor/phpunit/phpunit/src/Framework/ExpectationFailedException.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use SebastianBergmann\Comparator\ComparisonFailure;
|
||||
|
||||
/**
|
||||
* Exception for expectations which failed their check.
|
||||
*
|
||||
* The exception contains the error message and optionally a
|
||||
* SebastianBergmann\Comparator\ComparisonFailure which is used to
|
||||
* generate diff output of the failed expectations.
|
||||
*/
|
||||
class ExpectationFailedException extends AssertionFailedError
|
||||
{
|
||||
protected $comparisonFailure;
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param ComparisonFailure|null $comparisonFailure
|
||||
* @param \Exception|null $previous
|
||||
*/
|
||||
public function __construct($message, ComparisonFailure $comparisonFailure = null, \Exception $previous = null)
|
||||
{
|
||||
$this->comparisonFailure = $comparisonFailure;
|
||||
|
||||
parent::__construct($message, 0, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|ComparisonFailure
|
||||
*/
|
||||
public function getComparisonFailure()
|
||||
{
|
||||
return $this->comparisonFailure;
|
||||
}
|
||||
}
|
||||
19
vendor/phpunit/phpunit/src/Framework/IncompleteTest.php
vendored
Normal file
19
vendor/phpunit/phpunit/src/Framework/IncompleteTest.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* A marker interface for marking any exception/error as result of an unit
|
||||
* test as incomplete implementation or currently not implemented.
|
||||
*/
|
||||
interface IncompleteTest
|
||||
{
|
||||
}
|
||||
83
vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php
vendored
Normal file
83
vendor/phpunit/phpunit/src/Framework/IncompleteTestCase.php
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* An incomplete test case
|
||||
*/
|
||||
class IncompleteTestCase extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $message = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $backupGlobals = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $backupStaticAttributes = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $runTestInSeparateProcess = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useErrorHandler = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useOutputBuffering = false;
|
||||
|
||||
/**
|
||||
* @param string $className
|
||||
* @param string $methodName
|
||||
* @param string $message
|
||||
*/
|
||||
public function __construct($className, $methodName, $message = '')
|
||||
{
|
||||
$this->message = $message;
|
||||
parent::__construct($className . '::' . $methodName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function runTest()
|
||||
{
|
||||
$this->markTestIncomplete($this->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the test case.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return $this->getName();
|
||||
}
|
||||
}
|
||||
14
vendor/phpunit/phpunit/src/Framework/IncompleteTestError.php
vendored
Normal file
14
vendor/phpunit/phpunit/src/Framework/IncompleteTestError.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class IncompleteTestError extends AssertionFailedError implements IncompleteTest
|
||||
{
|
||||
}
|
||||
14
vendor/phpunit/phpunit/src/Framework/InvalidCoversTargetException.php
vendored
Normal file
14
vendor/phpunit/phpunit/src/Framework/InvalidCoversTargetException.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class InvalidCoversTargetException extends CodeCoverageException
|
||||
{
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/MissingCoversAnnotationException.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/MissingCoversAnnotationException.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class MissingCoversAnnotationException extends RiskyTestError
|
||||
{
|
||||
}
|
||||
14
vendor/phpunit/phpunit/src/Framework/OutputError.php
vendored
Normal file
14
vendor/phpunit/phpunit/src/Framework/OutputError.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class OutputError extends AssertionFailedError
|
||||
{
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/RiskyTest.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/RiskyTest.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
interface RiskyTest
|
||||
{
|
||||
}
|
||||
14
vendor/phpunit/phpunit/src/Framework/RiskyTestError.php
vendored
Normal file
14
vendor/phpunit/phpunit/src/Framework/RiskyTestError.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class RiskyTestError extends AssertionFailedError implements RiskyTest
|
||||
{
|
||||
}
|
||||
24
vendor/phpunit/phpunit/src/Framework/SelfDescribing.php
vendored
Normal file
24
vendor/phpunit/phpunit/src/Framework/SelfDescribing.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* Interface for classes that can return a description of itself.
|
||||
*/
|
||||
interface SelfDescribing
|
||||
{
|
||||
/**
|
||||
* Returns a string representation of the object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString();
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/SkippedTest.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/SkippedTest.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
interface SkippedTest
|
||||
{
|
||||
}
|
||||
81
vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php
vendored
Normal file
81
vendor/phpunit/phpunit/src/Framework/SkippedTestCase.php
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* A skipped test case
|
||||
*/
|
||||
class SkippedTestCase extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $message = '';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $backupGlobals = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $backupStaticAttributes = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $runTestInSeparateProcess = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useErrorHandler = false;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useOutputBuffering = false;
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*/
|
||||
public function __construct($className, $methodName, $message = '')
|
||||
{
|
||||
$this->message = $message;
|
||||
parent::__construct($className . '::' . $methodName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function runTest()
|
||||
{
|
||||
$this->markTestSkipped($this->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getMessage()
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the test case.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return $this->getName();
|
||||
}
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/SkippedTestError.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/SkippedTestError.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class SkippedTestError extends AssertionFailedError implements SkippedTest
|
||||
{
|
||||
}
|
||||
15
vendor/phpunit/phpunit/src/Framework/SkippedTestSuiteError.php
vendored
Normal file
15
vendor/phpunit/phpunit/src/Framework/SkippedTestSuiteError.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
class SkippedTestSuiteError extends AssertionFailedError implements SkippedTest
|
||||
{
|
||||
}
|
||||
80
vendor/phpunit/phpunit/src/Framework/SyntheticError.php
vendored
Normal file
80
vendor/phpunit/phpunit/src/Framework/SyntheticError.php
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* Creates a synthetic failed assertion.
|
||||
*/
|
||||
class SyntheticError extends AssertionFailedError
|
||||
{
|
||||
/**
|
||||
* The synthetic file.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $syntheticFile = '';
|
||||
|
||||
/**
|
||||
* The synthetic line number.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $syntheticLine = 0;
|
||||
|
||||
/**
|
||||
* The synthetic trace.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $syntheticTrace = [];
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param string $file
|
||||
* @param int $line
|
||||
* @param array $trace
|
||||
*/
|
||||
public function __construct($message, $code, $file, $line, $trace)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
|
||||
$this->syntheticFile = $file;
|
||||
$this->syntheticLine = $line;
|
||||
$this->syntheticTrace = $trace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSyntheticFile()
|
||||
{
|
||||
return $this->syntheticFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSyntheticLine()
|
||||
{
|
||||
return $this->syntheticLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getSyntheticTrace()
|
||||
{
|
||||
return $this->syntheticTrace;
|
||||
}
|
||||
}
|
||||
28
vendor/phpunit/phpunit/src/Framework/Test.php
vendored
Normal file
28
vendor/phpunit/phpunit/src/Framework/Test.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use Countable;
|
||||
|
||||
/**
|
||||
* A Test can be run and collect its results.
|
||||
*/
|
||||
interface Test extends Countable
|
||||
{
|
||||
/**
|
||||
* Runs a test and collects its result in a TestResult instance.
|
||||
*
|
||||
* @param TestResult $result
|
||||
*
|
||||
* @return TestResult
|
||||
*/
|
||||
public function run(TestResult $result = null);
|
||||
}
|
||||
2535
vendor/phpunit/phpunit/src/Framework/TestCase.php
vendored
Normal file
2535
vendor/phpunit/phpunit/src/Framework/TestCase.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
169
vendor/phpunit/phpunit/src/Framework/TestFailure.php
vendored
Normal file
169
vendor/phpunit/phpunit/src/Framework/TestFailure.php
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
use PHPUnit\Framework\Error\Error;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* A TestFailure collects a failed test together with the caught exception.
|
||||
*/
|
||||
class TestFailure
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $testName;
|
||||
|
||||
/**
|
||||
* @var Test|null
|
||||
*/
|
||||
protected $failedTest;
|
||||
|
||||
/**
|
||||
* @var Throwable
|
||||
*/
|
||||
protected $thrownException;
|
||||
|
||||
/**
|
||||
* Constructs a TestFailure with the given test and exception.
|
||||
*
|
||||
* @param Test $failedTest
|
||||
* @param Throwable $t
|
||||
*/
|
||||
public function __construct(Test $failedTest, $t)
|
||||
{
|
||||
if ($failedTest instanceof SelfDescribing) {
|
||||
$this->testName = $failedTest->toString();
|
||||
} else {
|
||||
$this->testName = \get_class($failedTest);
|
||||
}
|
||||
|
||||
if (!$failedTest instanceof TestCase || !$failedTest->isInIsolation()) {
|
||||
$this->failedTest = $failedTest;
|
||||
}
|
||||
|
||||
$this->thrownException = $t;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a short description of the failure.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
return \sprintf(
|
||||
'%s: %s',
|
||||
$this->testName,
|
||||
$this->thrownException->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a description for the thrown exception.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExceptionAsString()
|
||||
{
|
||||
return self::exceptionToString($this->thrownException);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a description for an exception.
|
||||
*
|
||||
* @param Throwable $e
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function exceptionToString(Throwable $e)
|
||||
{
|
||||
if ($e instanceof SelfDescribing) {
|
||||
$buffer = $e->toString();
|
||||
|
||||
if ($e instanceof ExpectationFailedException && $e->getComparisonFailure()) {
|
||||
$buffer .= $e->getComparisonFailure()->getDiff();
|
||||
}
|
||||
|
||||
if (!empty($buffer)) {
|
||||
$buffer = \trim($buffer) . "\n";
|
||||
}
|
||||
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
if ($e instanceof Error) {
|
||||
return $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
if ($e instanceof ExceptionWrapper) {
|
||||
return $e->getClassName() . ': ' . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
return \get_class($e) . ': ' . $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the failing test (including data set, if any).
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTestName()
|
||||
{
|
||||
return $this->testName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the failing test.
|
||||
*
|
||||
* Note: The test object is not set when the test is executed in process
|
||||
* isolation.
|
||||
*
|
||||
* @see Exception
|
||||
*
|
||||
* @return Test|null
|
||||
*/
|
||||
public function failedTest()
|
||||
{
|
||||
return $this->failedTest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the thrown exception.
|
||||
*
|
||||
* @return Throwable
|
||||
*/
|
||||
public function thrownException()
|
||||
{
|
||||
return $this->thrownException;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the exception's message.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function exceptionMessage()
|
||||
{
|
||||
return $this->thrownException()->getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the thrown exception
|
||||
* is of type AssertionFailedError.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isFailure()
|
||||
{
|
||||
return ($this->thrownException() instanceof AssertionFailedError);
|
||||
}
|
||||
}
|
||||
99
vendor/phpunit/phpunit/src/Framework/TestListener.php
vendored
Normal file
99
vendor/phpunit/phpunit/src/Framework/TestListener.php
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
/**
|
||||
* A Listener for test progress.
|
||||
*/
|
||||
interface TestListener
|
||||
{
|
||||
/**
|
||||
* An error occurred.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param \Exception $e
|
||||
* @param float $time
|
||||
*/
|
||||
public function addError(Test $test, \Exception $e, $time);
|
||||
|
||||
/**
|
||||
* A warning occurred.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param Warning $e
|
||||
* @param float $time
|
||||
*/
|
||||
public function addWarning(Test $test, Warning $e, $time);
|
||||
|
||||
/**
|
||||
* A failure occurred.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param AssertionFailedError $e
|
||||
* @param float $time
|
||||
*/
|
||||
public function addFailure(Test $test, AssertionFailedError $e, $time);
|
||||
|
||||
/**
|
||||
* Incomplete test.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param \Exception $e
|
||||
* @param float $time
|
||||
*/
|
||||
public function addIncompleteTest(Test $test, \Exception $e, $time);
|
||||
|
||||
/**
|
||||
* Risky test.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param \Exception $e
|
||||
* @param float $time
|
||||
*/
|
||||
public function addRiskyTest(Test $test, \Exception $e, $time);
|
||||
|
||||
/**
|
||||
* Skipped test.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param \Exception $e
|
||||
* @param float $time
|
||||
*/
|
||||
public function addSkippedTest(Test $test, \Exception $e, $time);
|
||||
|
||||
/**
|
||||
* A test suite started.
|
||||
*
|
||||
* @param TestSuite $suite
|
||||
*/
|
||||
public function startTestSuite(TestSuite $suite);
|
||||
|
||||
/**
|
||||
* A test suite ended.
|
||||
*
|
||||
* @param TestSuite $suite
|
||||
*/
|
||||
public function endTestSuite(TestSuite $suite);
|
||||
|
||||
/**
|
||||
* A test started.
|
||||
*
|
||||
* @param Test $test
|
||||
*/
|
||||
public function startTest(Test $test);
|
||||
|
||||
/**
|
||||
* A test ended.
|
||||
*
|
||||
* @param Test $test
|
||||
* @param float $time
|
||||
*/
|
||||
public function endTest(Test $test, $time);
|
||||
}
|
||||
53
vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php
vendored
Normal file
53
vendor/phpunit/phpunit/src/Framework/TestListenerDefaultImplementation.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*
|
||||
* This file is part of PHPUnit.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace PHPUnit\Framework;
|
||||
|
||||
trait TestListenerDefaultImplementation
|
||||
{
|
||||
public function addError(Test $test, \Exception $e, $time)
|
||||
{
|
||||
}
|
||||
|
||||
public function addWarning(Test $test, Warning $e, $time)
|
||||
{
|
||||
}
|
||||
|
||||
public function addFailure(Test $test, AssertionFailedError $e, $time)
|
||||
{
|
||||
}
|
||||
|
||||
public function addIncompleteTest(Test $test, \Exception $e, $time)
|
||||
{
|
||||
}
|
||||
|
||||
public function addRiskyTest(Test $test, \Exception $e, $time)
|
||||
{
|
||||
}
|
||||
|
||||
public function addSkippedTest(Test $test, \Exception $e, $time)
|
||||
{
|
||||
}
|
||||
|
||||
public function startTestSuite(TestSuite $suite)
|
||||
{
|
||||
}
|
||||
|
||||
public function endTestSuite(TestSuite $suite)
|
||||
{
|
||||
}
|
||||
|
||||
public function startTest(Test $test)
|
||||
{
|
||||
}
|
||||
|
||||
public function endTest(Test $test, $time)
|
||||
{
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user