Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0

This commit is contained in:
Pantheon Automation 2016-10-06 15:16:20 -07:00 committed by Greg Anderson
parent 2f563ab520
commit f1c8716f57
1732 changed files with 52334 additions and 11780 deletions

4
vendor/asm89/stack-cors/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
phpunit.xml
composer.lock
composer.phar
/vendor/

13
vendor/asm89/stack-cors/.travis.yml vendored Normal file
View file

@ -0,0 +1,13 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
before_script: composer install --dev
script: phpunit

59
vendor/asm89/stack-cors/README.md vendored Normal file
View file

@ -0,0 +1,59 @@
# Stack/Cors
Library and middleware enabling cross-origin resource sharing for your
http-{foundation,kernel} using application. It attempts to implement the
[W3C Candidate Recommendation] for cross-origin resource sharing.
[W3C Candidate Recommendation]: http://www.w3.org/TR/cors/
Master [![Build Status](https://secure.travis-ci.org/asm89/stack-cors.png?branch=master)](http://travis-ci.org/asm89/stack-cors)
Develop [![Build Status](https://secure.travis-ci.org/asm89/stack-cors.png?branch=develop)](http://travis-ci.org/asm89/stack-cors)
## Installation
Require `asm89/stack-cors` using composer.
## Usage
Stack middleware:
```php
<?php
use Asm89\Stack\Cors;
$app = new Cors($app, array(
// you can use array('*') to allow any headers
'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'),
// you can use array('*') to allow any methods
'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'),
// you can use array('*') to allow requests from any origin
'allowedOrigins' => array('localhost'),
'exposedHeaders' => false,
'maxAge' => false,
'supportsCredentials' => false,
));
```
Or use the library:
```php
<?php
use Asm89\Stack\CorsService;
$cors = new CorsService(array(
'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'),
'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'),
'allowedOrigins' => array('localhost'),
'exposedHeaders' => false,
'maxAge' => false,
'supportsCredentials' => false,
));
$cors->addActualRequestHeaders(Response $response, $origin);
$cors->handlePreflightRequest(Request $request);
$cors->isActualRequestAllowed(Request $request);
$cors->isCorsRequest(Request $request);
$cors->isPreflightRequest(Request $request);
```

22
vendor/asm89/stack-cors/composer.json vendored Normal file
View file

@ -0,0 +1,22 @@
{
"name": "asm89/stack-cors",
"description": "Cross-origin resource sharing library and stack middleware",
"keywords": ["stack", "cors"],
"homepage": "https://github.com/asm89/stack-cors",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Alexander",
"email": "iam.asm89@gmail.com"
}
],
"require": {
"php": ">=5.3.2",
"symfony/http-foundation": "~2.1|~3.0",
"symfony/http-kernel": "~2.1|~3.0"
},
"autoload": {
"psr-0": { "Asm89\\Stack": "src/" }
}
}

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="test/bootstrap.php"
>
<testsuites>
<testsuite name="Stack Cors Test Suite">
<directory>./test/Asm89/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
</whitelist>
</filter>
</phpunit>

View file

@ -0,0 +1,55 @@
<?php
namespace Asm89\Stack;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class Cors implements HttpKernelInterface
{
/**
* @var \Symfony\Component\HttpKernel\HttpKernelInterface
*/
private $app;
/**
* @var \Asm89\Stack\CorsService
*/
private $cors;
private $defaultOptions = array(
'allowedHeaders' => array(),
'allowedMethods' => array(),
'allowedOrigins' => array(),
'exposedHeaders' => false,
'maxAge' => false,
'supportsCredentials' => false,
);
public function __construct(HttpKernelInterface $app, array $options = array())
{
$this->app = $app;
$this->cors = new CorsService(array_merge($this->defaultOptions, $options));
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
if ( ! $this->cors->isCorsRequest($request)) {
return $this->app->handle($request, $type, $catch);
}
if ($this->cors->isPreflightRequest($request)) {
return $this->cors->handlePreflightRequest($request);
}
if ( ! $this->cors->isActualRequestAllowed($request)) {
return new Response('Not allowed.', 403);
}
$response = $this->app->handle($request, $type, $catch);
return $this->cors->addActualRequestHeaders($response, $request);
}
}

View file

@ -0,0 +1,178 @@
<?php
namespace Asm89\Stack;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class CorsService
{
private $options;
public function __construct(array $options = array())
{
$this->options = $this->normalizeOptions($options);
}
private function normalizeOptions(array $options = array())
{
$options += array(
'allowedOrigins' => array(),
'supportsCredentials' => false,
'allowedHeaders' => array(),
'exposedHeaders' => array(),
'allowedMethods' => array(),
'maxAge' => 0,
);
// normalize array('*') to true
if (in_array('*', $options['allowedOrigins'])) {
$options['allowedOrigins'] = true;
}
if (in_array('*', $options['allowedHeaders'])) {
$options['allowedHeaders'] = true;
} else {
$options['allowedHeaders'] = array_map('strtolower', $options['allowedHeaders']);
}
if (in_array('*', $options['allowedMethods'])) {
$options['allowedMethods'] = true;
} else {
$options['allowedMethods'] = array_map('strtoupper', $options['allowedMethods']);
}
return $options;
}
public function isActualRequestAllowed(Request $request)
{
return $this->checkOrigin($request);
}
public function isCorsRequest(Request $request)
{
return $request->headers->has('Origin');
}
public function isPreflightRequest(Request $request)
{
return $this->isCorsRequest($request)
&&$request->getMethod() === 'OPTIONS'
&& $request->headers->has('Access-Control-Request-Method');
}
public function addActualRequestHeaders(Response $response, Request $request)
{
if ( ! $this->checkOrigin($request)) {
return $response;
}
$response->headers->set('Access-Control-Allow-Origin', $request->headers->get('Origin'));
if ( ! $response->headers->has('Vary')) {
$response->headers->set('Vary', 'Origin');
} else {
$response->headers->set('Vary', $response->headers->get('Vary') . ', Origin');
}
if ($this->options['supportsCredentials']) {
$response->headers->set('Access-Control-Allow-Credentials', 'true');
}
if ($this->options['exposedHeaders']) {
$response->headers->set('Access-Control-Expose-Headers', implode(', ', $this->options['exposedHeaders']));
}
return $response;
}
public function handlePreflightRequest(Request $request)
{
if (true !== $check = $this->checkPreflightRequestConditions($request)) {
return $check;
}
return $this->buildPreflightCheckResponse($request);
}
private function buildPreflightCheckResponse(Request $request)
{
$response = new Response();
if ($this->options['supportsCredentials']) {
$response->headers->set('Access-Control-Allow-Credentials', 'true');
}
$response->headers->set('Access-Control-Allow-Origin', $request->headers->get('Origin'));
if ($this->options['maxAge']) {
$response->headers->set('Access-Control-Max-Age', $this->options['maxAge']);
}
$allowMethods = $this->options['allowedMethods'] === true
? strtoupper($request->headers->get('Access-Control-Request-Method'))
: implode(', ', $this->options['allowedMethods']);
$response->headers->set('Access-Control-Allow-Methods', $allowMethods);
$allowHeaders = $this->options['allowedHeaders'] === true
? strtoupper($request->headers->get('Access-Control-Request-Headers'))
: implode(', ', $this->options['allowedHeaders']);
$response->headers->set('Access-Control-Allow-Headers', $allowHeaders);
return $response;
}
private function checkPreflightRequestConditions(Request $request)
{
if ( ! $this->checkOrigin($request)) {
return $this->createBadRequestResponse(403, 'Origin not allowed');
}
if ( ! $this->checkMethod($request)) {
return $this->createBadRequestResponse(405, 'Method not allowed');
}
$requestHeaders = array();
// if allowedHeaders has been set to true ('*' allow all flag) just skip this check
if ($this->options['allowedHeaders'] !== true && $request->headers->has('Access-Control-Request-Headers')) {
$headers = strtolower($request->headers->get('Access-Control-Request-Headers'));
$requestHeaders = explode(',', $headers);
foreach ($requestHeaders as $header) {
if ( ! in_array(trim($header), $this->options['allowedHeaders'])) {
return $this->createBadRequestResponse(403, 'Header not allowed');
}
}
}
return true;
}
private function createBadRequestResponse($code, $reason = '')
{
return new Response($reason, $code);
}
private function checkOrigin(Request $request) {
if ($this->options['allowedOrigins'] === true) {
// allow all '*' flag
return true;
}
$origin = $request->headers->get('Origin');
return in_array($origin, $this->options['allowedOrigins']);
}
private function checkMethod(Request $request) {
if ($this->options['allowedMethods'] === true) {
// allow all '*' flag
return true;
}
$requestMethod = strtoupper($request->headers->get('Access-Control-Request-Method'));
return in_array($requestMethod, $this->options['allowedMethods']);
}
}

View file

@ -0,0 +1,395 @@
<?php
namespace Asm89\Stack;
use PHPUnit_Framework_TestCase;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class CorsTest extends PHPUnit_Framework_TestCase
{
/**
* @test
*/
public function it_does_not_modify_on_a_request_without_origin()
{
$app = $this->createStackedApp();
$unmodifiedResponse = new Response();
$response = $app->handle(new Request());
$this->assertEquals($unmodifiedResponse->headers, $response->headers);
}
/**
* @test
*/
public function it_returns_403_on_valid_actual_request_with_origin_not_allowed()
{
$app = $this->createStackedApp(array('allowedOrigins' => array('notlocalhost')));
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertEquals(403, $response->getStatusCode());
}
/**
* @test
*/
public function it_returns_allow_origin_header_on_valid_actual_request()
{
$app = $this->createStackedApp();
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Allow-Origin'));
$this->assertEquals('localhost', $response->headers->get('Access-Control-Allow-Origin'));
}
/**
* @test
*/
public function it_returns_allow_origin_header_on_allow_all_origin_request()
{
$app = $this->createStackedApp(array('allowedOrigins' => array('*')));
$request = new Request();
$request->headers->set('Origin', 'http://localhost');
$response = $app->handle($request);
$this->assertEquals(200, $response->getStatusCode());
$this->assertTrue($response->headers->has('Access-Control-Allow-Origin'));
$this->assertEquals('http://localhost', $response->headers->get('Access-Control-Allow-Origin'));
}
/**
* @test
*/
public function it_returns_allow_headers_header_on_allow_all_headers_request()
{
$app = $this->createStackedApp(array('allowedHeaders' => array('*')));
$request = $this->createValidPreflightRequest();
$request->headers->set('Access-Control-Request-Headers', 'Foo, BAR');
$response = $app->handle($request);
$this->assertEquals(200, $response->getStatusCode());
$this->assertEquals('FOO, BAR', $response->headers->get('Access-Control-Allow-Headers'));
}
/**
* @test
*/
public function it_does_not_return_allow_origin_header_on_valid_actual_request_with_origin_not_allowed()
{
$app = $this->createStackedApp(array('allowedOrigins' => array('notlocalhost')));
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertFalse($response->headers->has('Access-Control-Allow-Origin'));
}
/**
* @test
*/
public function it_sets_allow_credentials_header_when_flag_is_set_on_valid_actual_request()
{
$app = $this->createStackedApp(array('supportsCredentials' => true));
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Allow-Credentials'));
$this->assertEquals('true', $response->headers->get('Access-Control-Allow-Credentials'));
}
/**
* @test
*/
public function it_does_not_set_allow_credentials_header_when_flag_is_not_set_on_valid_actual_request()
{
$app = $this->createStackedApp();
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertFalse($response->headers->has('Access-Control-Allow-Credentials'));
}
/**
* @test
*/
public function it_sets_exposed_headers_when_configured_on_actual_request()
{
$app = $this->createStackedApp(array('exposedHeaders' => array('x-exposed-header', 'x-another-exposed-header')));
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Expose-Headers'));
$this->assertEquals('x-exposed-header, x-another-exposed-header', $response->headers->get('Access-Control-Expose-Headers'));
}
/**
* @test
* @see http://www.w3.org/TR/cors/index.html#resource-implementation
*/
public function it_adds_a_vary_header()
{
$app = $this->createStackedApp();
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Vary'));
$this->assertEquals('Origin', $response->headers->get('Vary'));
}
/**
* @test
* @see http://www.w3.org/TR/cors/index.html#resource-implementation
*/
public function it_appends_an_existing_vary_header()
{
$app = $this->createStackedApp(array(), array('Vary' => 'Content-Type'));
$request = $this->createValidActualRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Vary'));
$this->assertEquals('Content-Type, Origin', $response->headers->get('Vary'));
}
/**
* @test
*/
public function it_returns_access_control_headers_on_cors_request()
{
$app = $this->createStackedApp();
$request = new Request();
$request->headers->set('Origin', 'localhost');
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Allow-Origin'));
$this->assertEquals('localhost', $response->headers->get('Access-Control-Allow-Origin'));
}
/**
* @test
*/
public function it_returns_access_control_headers_on_valid_preflight_request()
{
$app = $this->createStackedApp();
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Allow-Origin'));
$this->assertEquals('localhost', $response->headers->get('Access-Control-Allow-Origin'));
}
/**
* @test
*/
public function it_returns_403_on_valid_preflight_request_with_origin_not_allowed()
{
$app = $this->createStackedApp(array('allowedOrigins' => array('notlocalhost')));
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertEquals(403, $response->getStatusCode());
}
/**
* @test
*/
public function it_does_not_modify_request_with_origin_not_allowed()
{
$passedOptions = array(
'allowedOrigins' => array('notlocalhost'),
);
$service = new CorsService($passedOptions);
$request = $this->createValidActualRequest();
$response = new Response();
$service->addActualRequestHeaders($response, $request);
$this->assertEquals($response, new Response());
}
/**
* @test
*/
public function it_returns_405_on_valid_preflight_request_with_method_not_allowed()
{
$app = $this->createStackedApp(array('allowedMethods' => array('put')));
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertEquals(405, $response->getStatusCode());
}
/**
* @test
*/
public function it_allow_methods_on_valid_preflight_request()
{
$app = $this->createStackedApp(array('allowedMethods' => array('get', 'put')));
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Allow-Methods'));
// it will uppercase the methods
$this->assertEquals('GET, PUT', $response->headers->get('Access-Control-Allow-Methods'));
}
/**
* @test
*/
public function it_returns_valid_preflight_request_with_allow_methods_all()
{
$app = $this->createStackedApp(array('allowedMethods' => array('*')));
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Allow-Methods'));
// it will return the Access-Control-Request-Method pass in the request
$this->assertEquals('GET', $response->headers->get('Access-Control-Allow-Methods'));
}
/**
* @test
*/
public function it_returns_403_on_valid_preflight_request_with_one_of_the_requested_headers_not_allowed()
{
$app = $this->createStackedApp();
$request = $this->createValidPreflightRequest();
$request->headers->set('Access-Control-Request-Headers', 'x-not-allowed-header');
$response = $app->handle($request);
$this->assertEquals(403, $response->getStatusCode());
}
/**
* @test
*/
public function it_returns_ok_on_valid_preflight_request_with_requested_headers_allowed()
{
$app = $this->createStackedApp();
$requestHeaders = 'X-Allowed-Header, x-other-allowed-header';
$request = $this->createValidPreflightRequest();
$request->headers->set('Access-Control-Request-Headers', $requestHeaders);
$response = $app->handle($request);
$this->assertEquals(200, $response->getStatusCode());
$this->assertTrue($response->headers->has('Access-Control-Allow-Headers'));
// the response will have the "allowedHeaders" value passed to Cors rather than the request one
$this->assertEquals('x-allowed-header, x-other-allowed-header', $response->headers->get('Access-Control-Allow-Headers'));
}
/**
* @test
*/
public function it_sets_allow_credentials_header_when_flag_is_set_on_valid_preflight_request()
{
$app = $this->createStackedApp(array('supportsCredentials' => true));
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Allow-Credentials'));
$this->assertEquals('true', $response->headers->get('Access-Control-Allow-Credentials'));
}
/**
* @test
*/
public function it_does_not_set_allow_credentials_header_when_flag_is_not_set_on_valid_preflight_request()
{
$app = $this->createStackedApp();
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertFalse($response->headers->has('Access-Control-Allow-Credentials'));
}
/**
* @test
*/
public function it_sets_max_age_when_set()
{
$app = $this->createStackedApp(array('maxAge' => 42));
$request = $this->createValidPreflightRequest();
$response = $app->handle($request);
$this->assertTrue($response->headers->has('Access-Control-Max-Age'));
$this->assertEquals(42, $response->headers->get('Access-Control-Max-Age'));
}
private function createValidActualRequest()
{
$request = new Request();
$request->headers->set('Origin', 'localhost');
return $request;
}
private function createValidPreflightRequest()
{
$request = new Request();
$request->headers->set('Origin', 'localhost');
$request->headers->set('Access-Control-Request-Method', 'get');
$request->setMethod('OPTIONS');
return $request;
}
private function createStackedApp(array $options = array(), array $responseHeaders = array())
{
$passedOptions = array_merge(array(
'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'),
'allowedMethods' => array('delete', 'get', 'post', 'put'),
'allowedOrigins' => array('localhost'),
'exposedHeaders' => false,
'maxAge' => false,
'supportsCredentials' => false,
),
$options
);
return new Cors(new MockApp($responseHeaders), $passedOptions);
}
}
class MockApp implements HttpKernelInterface
{
private $responseHeaders;
public function __construct(array $responseHeaders)
{
$this->responseHeaders = $responseHeaders;
}
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$response = new Response();
$response->headers->add($this->responseHeaders);
return $response;
}
}

View file

@ -0,0 +1,10 @@
<?php
if (file_exists($file = __DIR__.'/../vendor/autoload.php')) {
$loader = require_once $file;
$loader->add('Asm89\Stack', __DIR__);
$loader->add('Asm89\Stack', __DIR__ . '/../src');
} else {
throw new RuntimeException('Install dependencies to run test suite.');
}

View file

@ -21,4 +21,5 @@ return array(
'Doctrine\\Common\\Annotations\\' => array($vendorDir . '/doctrine/annotations/lib'),
'Doctrine\\Common\\' => array($vendorDir . '/doctrine/common/lib'),
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src'),
'Asm89\\Stack' => array($vendorDir . '/asm89/stack-cors/src'),
);

View file

@ -358,6 +358,13 @@ class ComposerStaticInitDrupal8
0 => __DIR__ . '/..' . '/composer/installers/src',
),
),
'A' =>
array (
'Asm89\\Stack' =>
array (
0 => __DIR__ . '/..' . '/asm89/stack-cors/src',
),
),
);
public static $classMap = array (

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,4 @@
/build export-ignore
*.php diff=php
composer.json merge=ours
src/Runner/Version.php merge=ours

View file

@ -1,22 +1,16 @@
build/api
build/code-browser
build/coverage
build/logs
build/pdepend
build/phar
build/phpdox
build/*.phar
build/*.phar.asc
tests/TextUI/*.diff
tests/TextUI/*.exp
tests/TextUI/*.log
tests/TextUI/*.out
tests/TextUI/*.php
/bin
/vendor
/.ant_targets
/.idea
/build/documentation
/build/logfiles
/build/phar
/build/phpdox
/build/*.phar
/build/*.phar.asc
/tests/TextUI/*.diff
/tests/TextUI/*.exp
/tests/TextUI/*.log
/tests/TextUI/*.out
/tests/TextUI/*.php
/cache.properties
/composer.lock
/composer.phar
phpunit.xml
cache.properties
.idea
.ant_targets
/vendor

View file

@ -11,33 +11,58 @@ return Symfony\CS\Config\Config::create()
->level(\Symfony\CS\FixerInterface::NONE_LEVEL)
->fixers(
array(
'align_double_arrow',
'align_equals',
'braces',
'concat_with_spaces',
'duplicate_semicolon',
'elseif',
'empty_return',
'encoding',
'eof_ending',
'extra_empty_lines',
'function_call_space',
'function_declaration',
'indentation',
'join_function',
'line_after_namespace',
'linefeed',
'list_commas',
'long_array_syntax',
'lowercase_constants',
'lowercase_keywords',
'method_argument_space',
'multiple_use',
'namespace_no_leading_whitespace',
'no_blank_lines_after_class_opening',
'no_empty_lines_after_phpdocs',
'parenthesis',
'php_closing_tag',
'phpdoc_indent',
'phpdoc_no_access',
'phpdoc_no_empty_return',
'phpdoc_no_package',
'phpdoc_params',
'phpdoc_scalar',
'phpdoc_separation',
'phpdoc_to_comment',
'phpdoc_trim',
'phpdoc_types',
'phpdoc_var_without_name',
'remove_lines_between_uses',
'return',
'self_accessor',
'short_tag',
'single_line_after_imports',
'single_quote',
'spaces_before_semicolon',
'spaces_cast',
'ternary_spaces',
'trailing_spaces',
'trim_array_spaces',
'unused_use',
'whitespacy_lines',
'align_double_arrow',
'align_equals',
'concat_with_spaces'
'visibility',
'whitespacy_lines'
)
)
->finder($finder);

View file

@ -7,11 +7,13 @@ php:
- 5.5
- 5.6
- 7.0
- nightly
- hhvm
matrix:
allow_failures:
- php: 7.0
- php: nightly
- php: hhvm
sudo: false
@ -25,7 +27,7 @@ install:
script:
- ./phpunit
- ./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.dist
- 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

View file

@ -1,14 +1,28 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
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, or religion.
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 sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
Examples of unacceptable behavior by participants include:
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. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
* 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
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
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.
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org/), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
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/

View file

@ -13,7 +13,7 @@ Please note that this project is released with a [Contributor Code of Conduct](C
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 current alpha branch (when `5.0` is the current stable branch, then `5.1` is the current beta branch and `5.2` is the current alpha branch).
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.

View file

@ -2,6 +2,117 @@
All notable changes of the PHPUnit 4.8 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
## [4.8.27] - 2016-07-21
### Fixed
* Fixed [#1968](https://github.com/sebastianbergmann/phpunit/issues/1968): Invalid data sets are not handled correctly for `@testWith` annotation
## [4.8.26] - 2016-05-17
### Fixed
* Fixed [phpunit-mock-objects/#301](https://github.com/sebastianbergmann/phpunit-mock-objects/issues/301): `PHPUnit_Framework_MockObject_MockBuilder::getMock()` calls `PHPUnit_Framework_TestCase::getMock()` with more arguments than accepted
## [4.8.25] - 2016-05-10
### Fixed
* Fixed [#2112](https://github.com/sebastianbergmann/phpunit/issues/2112): Output is html entity encoded when ran through `phpdbg`
* Fixed [#2158](https://github.com/sebastianbergmann/phpunit/issues/2158): Failure to run tests in separate processes if a file included into main process contains constant definition
## [4.8.24] - 2016-03-14
### Fixed
* Fixed [#1959](https://github.com/sebastianbergmann/phpunit/issues/1959): Prophecy errors are not handled correctly
* Fixed [#2039](https://github.com/sebastianbergmann/phpunit/issues/2039): TestDox does not handle snake_case test methods properly
* Fixed [#2109](https://github.com/sebastianbergmann/phpunit/issues/2109): Process isolation leaks global variable
## [4.8.23] - 2016-02-11
### Fixed
* Fixed [#2072](https://github.com/sebastianbergmann/phpunit/issues/2072): Paths in XML configuration file were not handled correctly when they have whitespace around them
## [4.8.22] - 2016-02-02
### Fixed
* Fixed [#2050](https://github.com/sebastianbergmann/phpunit/issues/2050): `PHPUnit_Util_XML::load()` raises exception with empty message when XML string is empty
* Fixed a bug in `PHPUnit_Runner_Version::series()`
## [4.8.21] - 2015-12-12
### Changed
* Reverted the changes introduced in PHPUnit 4.8.20 as the only thing the new version constraint in `composer.json` achieved was locking PHP 7 users to PHPUnit 4.8.19
## [4.8.20] - 2015-12-10
### Changed
* Changed PHP version constraint in `composer.json` to prevent installing PHPUnit 4.8 on PHP 7
* `phpunit.phar` will now refuse to work on PHP 7
## [4.8.19] - 2015-11-30
### Fixed
* Fixed [#1955](https://github.com/sebastianbergmann/phpunit/issues/1955): Process isolation fails when running tests with `phpdbg -qrr`
## [4.8.18] - 2015-11-11
### Changed
* DbUnit 1.4 is bundled again in the PHAR distribution
## [4.8.17] - 2015-11-10
### Fixed
* Fixed [#1935](https://github.com/sebastianbergmann/phpunit/issues/1935): `PHP_CodeCoverage_Exception` not handled properly
* Fixed [#1948](https://github.com/sebastianbergmann/phpunit/issues/1948): Unable to use PHAR due to unsupported signature error
### Changed
* DbUnit >= 2.0.2 is now bundled in the PHAR distribution
## [4.8.16] - 2015-10-23
### Added
* Implemented [#1925](https://github.com/sebastianbergmann/phpunit/issues/1925): Provide a library-only PHAR
## [4.8.15] - 2015-10-22
### Fixed
* The backup of global state is now properly restored when changes to global state are disallowed
* The `__PHPUNIT_PHAR__` constant is now properly set when the PHPUnit PHAR is used as a library
## [4.8.14] - 2015-10-17
### Fixed
* Fixed [#1892](https://github.com/sebastianbergmann/phpunit/issues/1892): `--coverage-text` does not honor color settings
## [4.8.13] - 2015-10-14
### Added
* Added the `--self-upgrade` commandline switch for upgrading a PHPUnit PHAR to the latest version
### Changed
* The `--self-update` commandline switch now updates a PHPUnit PHAR to the latest version within the same release series
## [4.8.12] - 2015-10-12
### Changed
* Merged [#1893](https://github.com/sebastianbergmann/phpunit/issues/1893): Removed workaround for phpab bug
## [4.8.11] - 2015-10-07
### Fixed
@ -85,6 +196,22 @@ New PHAR release due to updated dependencies
* Made the argument check of `assertContains()` and `assertNotContains()` more strict to prevent undefined behavior such as [#1808](https://github.com/sebastianbergmann/phpunit/issues/1808)
* Changed the name of the default group from `__nogroup__` to `default`
[4.8.27]: https://github.com/sebastianbergmann/phpunit/compare/4.8.26...4.8.27
[4.8.26]: https://github.com/sebastianbergmann/phpunit/compare/4.8.25...4.8.26
[4.8.25]: https://github.com/sebastianbergmann/phpunit/compare/4.8.24...4.8.25
[4.8.24]: https://github.com/sebastianbergmann/phpunit/compare/4.8.23...4.8.24
[4.8.23]: https://github.com/sebastianbergmann/phpunit/compare/4.8.22...4.8.23
[4.8.22]: https://github.com/sebastianbergmann/phpunit/compare/4.8.21...4.8.22
[4.8.21]: https://github.com/sebastianbergmann/phpunit/compare/4.8.20...4.8.21
[4.8.20]: https://github.com/sebastianbergmann/phpunit/compare/4.8.19...4.8.20
[4.8.19]: https://github.com/sebastianbergmann/phpunit/compare/4.8.18...4.8.19
[4.8.18]: https://github.com/sebastianbergmann/phpunit/compare/4.8.17...4.8.18
[4.8.17]: https://github.com/sebastianbergmann/phpunit/compare/4.8.16...4.8.17
[4.8.16]: https://github.com/sebastianbergmann/phpunit/compare/4.8.15...4.8.16
[4.8.15]: https://github.com/sebastianbergmann/phpunit/compare/4.8.14...4.8.15
[4.8.14]: https://github.com/sebastianbergmann/phpunit/compare/4.8.13...4.8.14
[4.8.13]: https://github.com/sebastianbergmann/phpunit/compare/4.8.12...4.8.13
[4.8.12]: https://github.com/sebastianbergmann/phpunit/compare/4.8.11...4.8.12
[4.8.11]: https://github.com/sebastianbergmann/phpunit/compare/4.8.10...4.8.11
[4.8.10]: https://github.com/sebastianbergmann/phpunit/compare/4.8.9...4.8.10
[4.8.9]: https://github.com/sebastianbergmann/phpunit/compare/4.8.8...4.8.9

View file

@ -1,6 +1,6 @@
PHPUnit
Copyright (c) 2001-2015, Sebastian Bergmann <sebastian@phpunit.de>.
Copyright (c) 2001-2016, Sebastian Bergmann <sebastian@phpunit.de>.
All rights reserved.
Redistribution and use in source and binary forms, with or without

View file

@ -1,89 +1,116 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="phpunit" default="setup">
<target name="setup" depends="clean,composer"/>
<target name="setup" depends="clean,install-dependencies"/>
<target name="validate" depends="php-syntax-check,validate-composer-json,validate-phpunit-xsd"/>
<target name="clean" description="Cleanup build artifacts">
<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="**/*.phar" />
<include name="**/*.phar.asc" />
<include name="**/phpunit*.phar"/>
<include name="**/phpunit*.phar.asc"/>
</fileset>
</delete>
<property name="clean.done" value="true"/>
</target>
<target name="composer" description="Install dependencies with Composer">
<tstamp>
<format property="thirty.days.ago" pattern="MM/dd/yyyy hh:mm aa" offset="-30" unit="day"/>
</tstamp>
<delete>
<fileset dir="${basedir}">
<include name="composer.phar" />
<date datetime="${thirty.days.ago}" when="before"/>
</fileset>
</delete>
<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>
<get src="https://getcomposer.org/composer.phar" dest="${basedir}/composer.phar" skipexisting="true"/>
<target name="validate-composer-json" unless="validate-composer-json.done" description="Validate composer.json">
<exec executable="${basedir}/build/tools/composer" failonerror="true" taskname="composer">
<env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
<arg value="validate"/>
<arg value="--no-check-lock"/>
<arg value="--strict"/>
<arg value="${basedir}/composer.json"/>
</exec>
<exec executable="php">
<arg value="composer.phar"/>
<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">
<env key="COMPOSER_DISABLE_XDEBUG_WARN" value="1"/>
<arg value="install"/>
</exec>
</target>
<target name="signed-phar"
description="Create signed PHAR archive of PHPUnit and all its dependencies (release)"
depends="phar">
<exec executable="bash" outputproperty="version">
<arg value="-c" />
<arg value="${basedir}/phpunit --version | awk 'BEGIN { ORS = &quot;&quot;; } {print $2}'" />
<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="--armor"/>
<arg value="--detach-sign"/>
<arg path="${basedir}/build/phpunit-library-${version}.phar"/>
</exec>
<exec executable="gpg" failonerror="true">
<arg value="--armor" />
<arg value="--detach-sign" />
<arg path="${basedir}/build/phpunit-${version}.phar" />
<arg value="--armor"/>
<arg value="--detach-sign"/>
<arg path="${basedir}/build/phpunit-${version}.phar"/>
</exec>
</target>
<target name="phar"
description="Create PHAR archive of PHPUnit and all its dependencies (release)"
depends="phar-prepare">
<exec executable="bash" outputproperty="version">
<arg value="-c" />
<arg value="${basedir}/phpunit --version | awk 'BEGIN { ORS = &quot;&quot;; } {print $2}'" />
</exec>
<antcall target="phar-build">
<param name="version" value="${version}"/>
<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-alpha"
description="Create PHAR archive of PHPUnit and all its dependencies (alpha)"
depends="phar-prepare">
<antcall target="phar-build">
<param name="version" value="alpha"/>
<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-beta"
description="Create PHAR archive of PHPUnit and all its dependencies (beta)"
depends="phar-prepare">
<antcall target="phar-build">
<param name="version" value="beta"/>
</antcall>
</target>
<target name="phar-prepare" depends="clean,composer">
<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="php">
<arg value="composer.phar"/>
<exec executable="${basedir}/build/tools/composer">
<arg value="require"/>
<arg value="phpunit/dbunit:~1.4"/>
<arg value="phpunit/phpunit-selenium:~1.4"/>
@ -93,173 +120,253 @@
<move file="${basedir}/composer.json.bak" tofile="${basedir}/composer.json"/>
<exec executable="${basedir}/build/phar-manifest.php" output="${basedir}/build/phar/manifest.txt"/>
<copy todir="${basedir}/build/phar" file="${basedir}/build/ca.pem" />
<copy todir="${basedir}/build/phar" file="${basedir}/build/ca.pem"/>
<copy file="${basedir}/vendor/phpunit/php-code-coverage/LICENSE" tofile="${basedir}/build/phar/php-code-coverage/LICENSE"/>
<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="**/*" />
<include name="**/*"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/phpunit/php-file-iterator/LICENSE" tofile="${basedir}/build/phar/php-file-iterator/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/phpunit/php-text-template/LICENSE" tofile="${basedir}/build/phar/php-text-template/LICENSE"/>
<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" />
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/phpunit/php-token-stream/LICENSE" tofile="${basedir}/build/phar/php-token-stream/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/phpunit/phpunit-mock-objects/LICENSE" tofile="${basedir}/build/phar/phpunit-mock-objects/LICENSE"/>
<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="**/*" />
<include name="**/*"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/sebastian/comparator/LICENSE" tofile="${basedir}/build/phar/sebastian-comparator/LICENSE"/>
<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" />
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/sebastian/environment/LICENSE" tofile="${basedir}/build/phar/sebastian-environment/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/sebastian/exporter/LICENSE" tofile="${basedir}/build/phar/sebastian-exporter/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/sebastian/recursion-context/LICENSE" tofile="${basedir}/build/phar/sebastian-recursion-context/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/sebastian/global-state/LICENSE" tofile="${basedir}/build/phar/sebastian-global-state/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/sebastian/version/LICENSE" tofile="${basedir}/build/phar/sebastian-version/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/doctrine/instantiator/LICENSE" tofile="${basedir}/build/phar/doctrine-instantiator/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/symfony/yaml/LICENSE" tofile="${basedir}/build/phar/symfony/LICENSE"/>
<copy file="${basedir}/vendor/symfony/yaml/Symfony/Component/Yaml/LICENSE"
tofile="${basedir}/build/phar/symfony/LICENSE"/>
<copy todir="${basedir}/build/phar/symfony">
<fileset dir="${basedir}/vendor/symfony">
<include name="**/*.php" />
<exclude name="**/Tests/**" />
<include name="**/*.php"/>
<exclude name="**/Tests/**"/>
</fileset>
</copy>
<copy todir="${basedir}/build/phar/dbunit">
<fileset dir="${basedir}/vendor/phpunit/dbunit/PHPUnit">
<include name="**/*.php" />
<exclude name="**/Autoload.*" />
<include name="**/*.php"/>
<exclude name="**/Autoload.*"/>
</fileset>
</copy>
<copy todir="${basedir}/build/phar/php-invoker">
<fileset dir="${basedir}/vendor/phpunit/php-invoker/src">
<include name="**/*.php" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy todir="${basedir}/build/phar/phpunit-selenium">
<fileset dir="${basedir}/vendor/phpunit/phpunit-selenium/PHPUnit">
<include name="**/*.php" />
<exclude name="**/Autoload.*" />
<include name="**/*.php"/>
<exclude name="**/Autoload.*"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/phpdocumentor/reflection-docblock/LICENSE" tofile="${basedir}/build/phar/phpdocumentor-reflection-docblock/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
<copy file="${basedir}/vendor/phpspec/prophecy/LICENSE" tofile="${basedir}/build/phar/phpspec-prophecy/LICENSE"/>
<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" />
<include name="**/*.php"/>
</fileset>
</copy>
</target>
<target name="phar-build">
<target name="-phar-build" depends="-phar-determine-version">
<copy todir="${basedir}/build/phar/phpunit">
<fileset dir="${basedir}/src">
<include name="**/*.php" />
<include name="**/*.tpl*" />
<include name="**/*.php"/>
<include name="**/*.tpl*"/>
</fileset>
</copy>
<exec executable="${basedir}/build/phar-version.php" outputproperty="_version">
<arg value="${version}" />
<arg value="${version}"/>
<arg value="${type}"/>
</exec>
<exec executable="phpab">
<arg value="--all" />
<arg value="--static" />
<arg value="--phar" />
<arg value="--output" />
<arg path="${basedir}/build/phpunit-${_version}.phar" />
<arg value="--template" />
<arg path="${basedir}/build/phar-autoload.php.in" />
<arg path="${basedir}/build/phar" />
<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>
<exec executable="${basedir}/build/tools/phpab" taskname="phpab">
<arg value="--all"/>
<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.in"/>
<arg path="${basedir}/build/phar"/>
</exec>
<chmod file="${basedir}/build/phpunit-${_version}.phar" perm="ugo+rx"/>
</target>
<target name="-phar-determine-version">
<exec executable="bash" outputproperty="version">
<arg value="-c"/>
<arg value="${basedir}/phpunit --version | awk 'BEGIN { ORS = &quot;&quot;; } {print $2}'"/>
</exec>
</target>
<target name="generate-project-documentation" depends="-phploc,-phpcs,-phpmd,-phpunit">
<exec executable="${basedir}/build/tools/phpdox" dir="${basedir}/build" taskname="phpdox"/>
</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="-phpcs" depends="prepare">
<exec executable="${basedir}/build/tools/phpcs" output="/dev/null" taskname="phpcs">
<arg value="--report=checkstyle"/>
<arg value="--report-file=${basedir}/build/logfiles/checkstyle.xml"/>
<arg value="--standard=PSR2"/>
<arg value="--extensions=php"/>
<arg path="${basedir}/src"/>
</exec>
</target>
<target name="-phpmd" depends="prepare">
<exec executable="${basedir}/build/tools/phpmd" taskname="phpmd">
<arg path="${basedir}/src"/>
<arg value="xml"/>
<arg path="${basedir}/build/phpmd.xml"/>
<arg value="--reportfile"/>
<arg path="${basedir}/build/logfiles/pmd.xml"/>
</exec>
</target>
<target name="-phpunit" depends="setup">
<exec executable="${basedir}/phpunit" taskname="phpunit">
<arg value="--configuration"/>
<arg path="${basedir}/build/phpunit.xml"/>
</exec>
</target>
</project>

View file

@ -1,25 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----

View file

@ -1,37 +0,0 @@
#!/usr/bin/env php
<?php
if (__FILE__ == realpath($GLOBALS['_SERVER']['SCRIPT_NAME'])) {
$phar = realpath($GLOBALS['_SERVER']['SCRIPT_NAME']);
$execute = true;
} else {
$files = get_included_files();
$phar = $files[0];
$execute = false;
}
define('__PHPUNIT_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', $phar));
define('__PHPUNIT_PHAR_ROOT__', 'phar://___PHAR___');
Phar::mapPhar('___PHAR___');
___FILELIST___
if ($execute) {
if (version_compare('5.3.3', PHP_VERSION, '>')) {
fwrite(
STDERR,
'This version of PHPUnit requires PHP 5.3.3; using the latest version of PHP is highly recommended.' . PHP_EOL
);
die(1);
}
if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--manifest') {
print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/phar/manifest.txt');
exit;
}
PHPUnit_TextUI_Command::main();
}
__HALT_COMPILER();

View file

@ -1,27 +0,0 @@
#!/usr/bin/env php
<?php
print 'phpunit/phpunit: ';
$tag = @exec('git describe --tags 2>&1');
if (strpos($tag, '-') === false && strpos($tag, 'No names found') === false) {
print $tag;
} else {
$branch = @exec('git rev-parse --abbrev-ref HEAD');
$hash = @exec('git log -1 --format="%H"');
print $branch . '@' . $hash;
}
print "\n";
$lock = json_decode(file_get_contents(__DIR__ . '/../composer.lock'));
foreach ($lock->packages as $package) {
print $package->name . ': ' . $package->version;
if (!preg_match('/^[v= ]*(([0-9]+)(\\.([0-9]+)(\\.([0-9]+)(-([0-9]+))?(-?([a-zA-Z-+][a-zA-Z0-9\\.\\-:]*)?)?)?)?)$/', $package->version)) {
print '@' . $package->source->reference;
}
print "\n";
}

View file

@ -1,22 +0,0 @@
#!/usr/bin/env php
<?php
if (!isset($argv[1])) {
exit(1);
}
if ($argv[1] == 'alpha' || $argv[1] == 'beta') {
$version = sprintf('%s-%s', $argv[1], date('Y-m-d'));
} else {
$version = $argv[1];
}
file_put_contents(
__DIR__ . '/phar/phpunit/Runner/Version.php',
str_replace(
'private static $pharVersion;',
'private static $pharVersion = "' . $version . '";',
file_get_contents(__DIR__ . '/phar/phpunit/Runner/Version.php')
)
);
print $version;

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.4/phpunit.xsd"
bootstrap="../tests/bootstrap.php"
backupGlobals="false"
verbose="true">
<testsuites>
<testsuite name="small">
<directory suffix=".phpt">../tests/Fail</directory>
</testsuite>
</testsuites>
<php>
<const name="PHPUNIT_TESTSUITE" value="true"/>
</php>
</phpunit>

View file

@ -17,15 +17,14 @@
}
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"irc": "irc://irc.freenode.net/phpunit"
"issues": "https://github.com/sebastianbergmann/phpunit/issues"
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2",
"phpunit/php-code-coverage": "~2.1",
"phpunit/php-timer": ">=1.0.6",
"phpunit/php-timer": "^1.0.6",
"phpunit/phpunit-mock-objects": "~2.3",
"phpspec/prophecy": "^1.3.1",
"symfony/yaml": "~2.1|~3.0",
@ -41,6 +40,11 @@
"ext-reflection": "*",
"ext-spl": "*"
},
"config": {
"platform": {
"php": "5.3.3"
}
},
"suggest": {
"phpunit/php-invoker": "~1.1"
},

View file

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpdox xmlns="http://xml.phpdox.net/config">
<project name="PHPUnit" source="src" workdir="build/phpdox">
<collector publiconly="false">
<include mask="*.php" />
</collector>
<generator output="build">
<enrich base="${basedir}/build/logs">
<source type="build" />
<source type="git" />
<source type="phploc" />
<source type="checkstyle" />
<source type="pmd" />
</enrich>
<build engine="html" enabled="true" output="api">
<file extension="html" />
</build>
</generator>
</project>
</phpdox>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation source="https://phpunit.de/manual/4.8/en/appendixes.configuration.html">
This Schema file defines the rules by which the XML configuration file of PHPUnit 4.8 may be structured.
@ -118,6 +118,7 @@
<xs:enumeration value="coverage-text"/>
<xs:enumeration value="coverage-clover"/>
<xs:enumeration value="coverage-crap4j"/>
<xs:enumeration value="coverage-xml"/>
<xs:enumeration value="json"/>
<xs:enumeration value="plain"/>
<xs:enumeration value="tap"/>
@ -161,17 +162,19 @@
</xs:attributeGroup>
<xs:complexType name="phpType">
<xs:sequence>
<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 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">

View file

@ -14,6 +14,7 @@
* We want a TestSuite object B that contains TestSuite objects C, D, ...
* for the Tests tagged with @group C, @group D, ...
* Running the Tests from TestSuite object B results in Tests tagged with both
*
* @group C and @group D in TestSuite object A to be run twice .
*
* <code>

View file

@ -50,7 +50,8 @@ class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit
/**
* Constructs a test case with the given filename.
*
* @param string $filename
* @param string $filename
*
* @throws PHPUnit_Framework_Exception
*/
public function __construct($filename)
@ -84,7 +85,8 @@ class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit
/**
* Runs a test and collects its result in a TestResult instance.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult $result
*
* @return PHPUnit_Framework_TestResult
*/
public function run(PHPUnit_Framework_TestResult $result = null)
@ -177,6 +179,7 @@ class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit
/**
* @return array
*
* @throws PHPUnit_Framework_Exception
*/
private function parse()
@ -205,7 +208,8 @@ class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit
}
/**
* @param string $code
* @param string $code
*
* @return string
*/
private function render($code)
@ -227,6 +231,7 @@ class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit
* Parse --INI-- section key value pairs and return as array.
*
* @param string
*
* @return array
*/
protected function parseIniSection($content)

View file

@ -18,7 +18,8 @@ class PHPUnit_Extensions_PhptTestSuite extends PHPUnit_Framework_TestSuite
/**
* Constructs a new TestSuite for .phpt test cases.
*
* @param string $directory
* @param string $directory
*
* @throws PHPUnit_Framework_Exception
*/
public function __construct($directory)

View file

@ -26,9 +26,10 @@ class PHPUnit_Extensions_RepeatedTest extends PHPUnit_Extensions_TestDecorator
protected $timesRepeat = 1;
/**
* @param PHPUnit_Framework_Test $test
* @param int $timesRepeat
* @param bool $processIsolation
* @param PHPUnit_Framework_Test $test
* @param int $timesRepeat
* @param bool $processIsolation
*
* @throws PHPUnit_Framework_Exception
*/
public function __construct(PHPUnit_Framework_Test $test, $timesRepeat = 1, $processIsolation = false)
@ -63,8 +64,10 @@ class PHPUnit_Extensions_RepeatedTest extends PHPUnit_Extensions_TestDecorator
* Runs the decorated test and collects the
* result in a TestResult.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult $result
*
* @return PHPUnit_Framework_TestResult
*
* @throws PHPUnit_Framework_Exception
*/
public function run(PHPUnit_Framework_TestResult $result = null)

View file

@ -92,7 +92,8 @@ class PHPUnit_Extensions_TestDecorator extends PHPUnit_Framework_Assert implemen
* Runs the decorated test and collects the
* result in a TestResult.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult $result
*
* @return PHPUnit_Framework_TestResult
*/
public function run(PHPUnit_Framework_TestResult $result = null)

View file

@ -64,6 +64,7 @@ abstract class PHPUnit_Extensions_TicketListener implements PHPUnit_Framework_Te
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
*
* @since Method available since Release 4.0.0
*/
public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time)
@ -76,6 +77,7 @@ abstract class PHPUnit_Extensions_TicketListener implements PHPUnit_Framework_Te
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
*
* @since Method available since Release 3.0.0
*/
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time)
@ -86,6 +88,7 @@ abstract class PHPUnit_Extensions_TicketListener implements PHPUnit_Framework_Te
* A test suite started.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
@ -96,6 +99,7 @@ abstract class PHPUnit_Extensions_TicketListener implements PHPUnit_Framework_Te
* A test suite ended.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
@ -184,7 +188,8 @@ abstract class PHPUnit_Extensions_TicketListener implements PHPUnit_Framework_Te
}
/**
* @param mixed $ticketId
* @param mixed $ticketId
*
* @return mixed
*/
abstract protected function getTicketInfo($ticketId = null);

View file

@ -26,6 +26,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $key
* @param array|ArrayAccess $array
* @param string $message
*
* @since Method available since Release 3.0.0
*/
public static function assertArrayHasKey($key, $array, $message = '')
@ -56,6 +57,7 @@ abstract class PHPUnit_Framework_Assert
* @param array|ArrayAccess $array
* @param bool $strict Check for object identity
* @param string $message
*
* @since Method available since Release 4.4.0
*/
public static function assertArraySubset($subset, $array, $strict = false, $message = '')
@ -85,6 +87,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $key
* @param array|ArrayAccess $array
* @param string $message
*
* @since Method available since Release 3.0.0
*/
public static function assertArrayNotHasKey($key, $array, $message = '')
@ -119,6 +122,7 @@ abstract class PHPUnit_Framework_Assert
* @param bool $ignoreCase
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*
* @since Method available since Release 2.1.0
*/
public static function assertContains($needle, $haystack, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
@ -163,6 +167,7 @@ abstract class PHPUnit_Framework_Assert
* @param bool $ignoreCase
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*
* @since Method available since Release 3.0.0
*/
public static function assertAttributeContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
@ -186,6 +191,7 @@ abstract class PHPUnit_Framework_Assert
* @param bool $ignoreCase
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*
* @since Method available since Release 2.1.0
*/
public static function assertNotContains($needle, $haystack, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
@ -234,6 +240,7 @@ abstract class PHPUnit_Framework_Assert
* @param bool $ignoreCase
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*
* @since Method available since Release 3.0.0
*/
public static function assertAttributeNotContains($needle, $haystackAttributeName, $haystackClassOrObject, $message = '', $ignoreCase = false, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
@ -255,6 +262,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $haystack
* @param bool $isNativeType
* @param string $message
*
* @since Method available since Release 3.1.4
*/
public static function assertContainsOnly($type, $haystack, $isNativeType = null, $message = '')
@ -317,6 +325,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $haystackClassOrObject
* @param bool $isNativeType
* @param string $message
*
* @since Method available since Release 3.1.4
*/
public static function assertAttributeContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')
@ -336,6 +345,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $haystack
* @param bool $isNativeType
* @param string $message
*
* @since Method available since Release 3.1.4
*/
public static function assertNotContainsOnly($type, $haystack, $isNativeType = null, $message = '')
@ -374,6 +384,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $haystackClassOrObject
* @param bool $isNativeType
* @param string $message
*
* @since Method available since Release 3.1.4
*/
public static function assertAttributeNotContainsOnly($type, $haystackAttributeName, $haystackClassOrObject, $isNativeType = null, $message = '')
@ -420,6 +431,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $haystackAttributeName
* @param mixed $haystackClassOrObject
* @param string $message
*
* @since Method available since Release 3.6.0
*/
public static function assertAttributeCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '')
@ -465,6 +477,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $haystackAttributeName
* @param mixed $haystackClassOrObject
* @param string $message
*
* @since Method available since Release 3.6.0
*/
public static function assertAttributeNotCount($expectedCount, $haystackAttributeName, $haystackClassOrObject, $message = '')
@ -535,6 +548,7 @@ abstract class PHPUnit_Framework_Assert
* @param int $maxDepth
* @param bool $canonicalize
* @param bool $ignoreCase
*
* @since Method available since Release 2.3.0
*/
public static function assertNotEquals($expected, $actual, $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
@ -580,8 +594,9 @@ abstract class PHPUnit_Framework_Assert
/**
* Asserts that a variable is empty.
*
* @param mixed $actual
* @param string $message
* @param mixed $actual
* @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
public static function assertEmpty($actual, $message = '')
@ -596,6 +611,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $haystackAttributeName
* @param mixed $haystackClassOrObject
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertAttributeEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
@ -609,8 +625,9 @@ abstract class PHPUnit_Framework_Assert
/**
* Asserts that a variable is not empty.
*
* @param mixed $actual
* @param string $message
* @param mixed $actual
* @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
public static function assertNotEmpty($actual, $message = '')
@ -625,6 +642,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $haystackAttributeName
* @param mixed $haystackClassOrObject
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertAttributeNotEmpty($haystackAttributeName, $haystackClassOrObject, $message = '')
@ -641,6 +659,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertGreaterThan($expected, $actual, $message = '')
@ -655,6 +674,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $actualAttributeName
* @param string $actualClassOrObject
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertAttributeGreaterThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
@ -672,6 +692,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertGreaterThanOrEqual($expected, $actual, $message = '')
@ -690,6 +711,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $actualAttributeName
* @param string $actualClassOrObject
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertAttributeGreaterThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
@ -707,6 +729,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertLessThan($expected, $actual, $message = '')
@ -721,6 +744,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $actualAttributeName
* @param string $actualClassOrObject
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertAttributeLessThan($expected, $actualAttributeName, $actualClassOrObject, $message = '')
@ -738,6 +762,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertLessThanOrEqual($expected, $actual, $message = '')
@ -752,6 +777,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $actualAttributeName
* @param string $actualClassOrObject
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertAttributeLessThanOrEqual($expected, $actualAttributeName, $actualClassOrObject, $message = '')
@ -772,6 +798,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $message
* @param bool $canonicalize
* @param bool $ignoreCase
*
* @since Method available since Release 3.2.14
*/
public static function assertFileEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false)
@ -799,6 +826,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $message
* @param bool $canonicalize
* @param bool $ignoreCase
*
* @since Method available since Release 3.2.14
*/
public static function assertFileNotEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false)
@ -826,6 +854,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $message
* @param bool $canonicalize
* @param bool $ignoreCase
*
* @since Method available since Release 3.3.0
*/
public static function assertStringEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = false, $ignoreCase = false)
@ -852,6 +881,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $message
* @param bool $canonicalize
* @param bool $ignoreCase
*
* @since Method available since Release 3.3.0
*/
public static function assertStringNotEqualsFile($expectedFile, $actualString, $message = '', $canonicalize = false, $ignoreCase = false)
@ -874,6 +904,7 @@ abstract class PHPUnit_Framework_Assert
*
* @param string $filename
* @param string $message
*
* @since Method available since Release 3.0.0
*/
public static function assertFileExists($filename, $message = '')
@ -892,6 +923,7 @@ abstract class PHPUnit_Framework_Assert
*
* @param string $filename
* @param string $message
*
* @since Method available since Release 3.0.0
*/
public static function assertFileNotExists($filename, $message = '')
@ -910,8 +942,9 @@ abstract class PHPUnit_Framework_Assert
/**
* Asserts that a condition is true.
*
* @param bool $condition
* @param string $message
* @param bool $condition
* @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
public static function assertTrue($condition, $message = '')
@ -922,8 +955,9 @@ abstract class PHPUnit_Framework_Assert
/**
* Asserts that a condition is not true.
*
* @param bool $condition
* @param string $message
* @param bool $condition
* @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
public static function assertNotTrue($condition, $message = '')
@ -934,8 +968,9 @@ abstract class PHPUnit_Framework_Assert
/**
* Asserts that a condition is false.
*
* @param bool $condition
* @param string $message
* @param bool $condition
* @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
public static function assertFalse($condition, $message = '')
@ -946,8 +981,9 @@ abstract class PHPUnit_Framework_Assert
/**
* Asserts that a condition is not false.
*
* @param bool $condition
* @param string $message
* @param bool $condition
* @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
public static function assertNotFalse($condition, $message = '')
@ -983,6 +1019,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param string $className
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertClassHasAttribute($attributeName, $className, $message = '')
@ -1012,6 +1049,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param string $className
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertClassNotHasAttribute($attributeName, $className, $message = '')
@ -1041,6 +1079,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param string $className
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertClassHasStaticAttribute($attributeName, $className, $message = '')
@ -1070,6 +1109,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param string $className
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertClassNotHasStaticAttribute($attributeName, $className, $message = '')
@ -1101,6 +1141,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param object $object
* @param string $message
*
* @since Method available since Release 3.0.0
*/
public static function assertObjectHasAttribute($attributeName, $object, $message = '')
@ -1130,6 +1171,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param object $object
* @param string $message
*
* @since Method available since Release 3.0.0
*/
public static function assertObjectNotHasAttribute($attributeName, $object, $message = '')
@ -1239,6 +1281,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertInstanceOf($expected, $actual, $message = '')
@ -1261,6 +1304,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param mixed $classOrObject
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertAttributeInstanceOf($expected, $attributeName, $classOrObject, $message = '')
@ -1278,6 +1322,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertNotInstanceOf($expected, $actual, $message = '')
@ -1300,6 +1345,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param mixed $classOrObject
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertAttributeNotInstanceOf($expected, $attributeName, $classOrObject, $message = '')
@ -1317,6 +1363,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertInternalType($expected, $actual, $message = '')
@ -1339,6 +1386,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param mixed $classOrObject
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertAttributeInternalType($expected, $attributeName, $classOrObject, $message = '')
@ -1356,6 +1404,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expected
* @param mixed $actual
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertNotInternalType($expected, $actual, $message = '')
@ -1378,6 +1427,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $attributeName
* @param mixed $classOrObject
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertAttributeNotInternalType($expected, $attributeName, $classOrObject, $message = '')
@ -1417,6 +1467,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $pattern
* @param string $string
* @param string $message
*
* @since Method available since Release 2.1.0
*/
public static function assertNotRegExp($pattern, $string, $message = '')
@ -1500,6 +1551,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $format
* @param string $string
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertStringMatchesFormat($format, $string, $message = '')
@ -1523,6 +1575,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $format
* @param string $string
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertStringNotMatchesFormat($format, $string, $message = '')
@ -1548,6 +1601,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $formatFile
* @param string $string
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertStringMatchesFormatFile($formatFile, $string, $message = '')
@ -1571,6 +1625,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $formatFile
* @param string $string
* @param string $message
*
* @since Method available since Release 3.5.0
*/
public static function assertStringNotMatchesFormatFile($formatFile, $string, $message = '')
@ -1596,6 +1651,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $prefix
* @param string $string
* @param string $message
*
* @since Method available since Release 3.4.0
*/
public static function assertStringStartsWith($prefix, $string, $message = '')
@ -1621,6 +1677,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $prefix
* @param string $string
* @param string $message
*
* @since Method available since Release 3.4.0
*/
public static function assertStringStartsNotWith($prefix, $string, $message = '')
@ -1646,6 +1703,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $suffix
* @param string $string
* @param string $message
*
* @since Method available since Release 3.4.0
*/
public static function assertStringEndsWith($suffix, $string, $message = '')
@ -1669,6 +1727,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $suffix
* @param string $string
* @param string $message
*
* @since Method available since Release 3.4.0
*/
public static function assertStringEndsNotWith($suffix, $string, $message = '')
@ -1694,6 +1753,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expectedFile
* @param string $actualFile
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertXmlFileEqualsXmlFile($expectedFile, $actualFile, $message = '')
@ -1710,6 +1770,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expectedFile
* @param string $actualFile
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertXmlFileNotEqualsXmlFile($expectedFile, $actualFile, $message = '')
@ -1726,6 +1787,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expectedFile
* @param string $actualXml
* @param string $message
*
* @since Method available since Release 3.3.0
*/
public static function assertXmlStringEqualsXmlFile($expectedFile, $actualXml, $message = '')
@ -1742,6 +1804,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expectedFile
* @param string $actualXml
* @param string $message
*
* @since Method available since Release 3.3.0
*/
public static function assertXmlStringNotEqualsXmlFile($expectedFile, $actualXml, $message = '')
@ -1758,6 +1821,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expectedXml
* @param string $actualXml
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, $message = '')
@ -1774,6 +1838,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $expectedXml
* @param string $actualXml
* @param string $message
*
* @since Method available since Release 3.1.0
*/
public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, $message = '')
@ -1791,15 +1856,16 @@ abstract class PHPUnit_Framework_Assert
* @param DOMElement $actualElement
* @param bool $checkAttributes
* @param string $message
*
* @since Method available since Release 3.3.0
*/
public static function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, $checkAttributes = false, $message = '')
{
$tmp = new DOMDocument;
$tmp = new DOMDocument;
$expectedElement = $tmp->importNode($expectedElement, true);
$tmp = new DOMDocument;
$actualElement= $tmp->importNode($actualElement, true);
$tmp = new DOMDocument;
$actualElement = $tmp->importNode($actualElement, true);
unset($tmp);
@ -1885,6 +1951,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $actual
* @param string $message
* @param bool $isHtml
*
* @since Method available since Release 3.3.0
* @deprecated
* @codeCoverageIgnore
@ -1913,6 +1980,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $actual
* @param string $message
* @param bool $isHtml
*
* @since Method available since Release 3.3.0
* @deprecated
* @codeCoverageIgnore
@ -1941,6 +2009,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $actual
* @param string $message
* @param bool $isHtml
*
* @since Method available since Release 3.3.0
* @deprecated
* @codeCoverageIgnore
@ -2128,6 +2197,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $actual
* @param string $message
* @param bool $isHtml
*
* @since Method available since Release 3.3.0
* @deprecated
* @codeCoverageIgnore
@ -2153,6 +2223,7 @@ abstract class PHPUnit_Framework_Assert
* @param string $actual
* @param string $message
* @param bool $isHtml
*
* @since Method available since Release 3.3.0
* @deprecated
* @codeCoverageIgnore
@ -2174,6 +2245,7 @@ abstract class PHPUnit_Framework_Assert
* @param mixed $value
* @param PHPUnit_Framework_Constraint $constraint
* @param string $message
*
* @since Method available since Release 3.0.0
*/
public static function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
@ -2188,6 +2260,7 @@ abstract class PHPUnit_Framework_Assert
*
* @param string $actualJson
* @param string $message
*
* @since Method available since Release 3.7.20
*/
public static function assertJson($actualJson, $message = '')
@ -2343,6 +2416,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_And matcher object.
*
* @return PHPUnit_Framework_Constraint_And
*
* @since Method available since Release 3.0.0
*/
public static function logicalAnd()
@ -2359,6 +2433,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_Or matcher object.
*
* @return PHPUnit_Framework_Constraint_Or
*
* @since Method available since Release 3.0.0
*/
public static function logicalOr()
@ -2374,8 +2449,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_Not matcher object.
*
* @param PHPUnit_Framework_Constraint $constraint
* @param PHPUnit_Framework_Constraint $constraint
*
* @return PHPUnit_Framework_Constraint_Not
*
* @since Method available since Release 3.0.0
*/
public static function logicalNot(PHPUnit_Framework_Constraint $constraint)
@ -2387,6 +2464,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_Xor matcher object.
*
* @return PHPUnit_Framework_Constraint_Xor
*
* @since Method available since Release 3.0.0
*/
public static function logicalXor()
@ -2403,6 +2481,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_IsAnything matcher object.
*
* @return PHPUnit_Framework_Constraint_IsAnything
*
* @since Method available since Release 3.0.0
*/
public static function anything()
@ -2414,6 +2493,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_IsTrue matcher object.
*
* @return PHPUnit_Framework_Constraint_IsTrue
*
* @since Method available since Release 3.3.0
*/
public static function isTrue()
@ -2424,7 +2504,8 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_Callback matcher object.
*
* @param callable $callback
* @param callable $callback
*
* @return PHPUnit_Framework_Constraint_Callback
*/
public static function callback($callback)
@ -2436,6 +2517,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_IsFalse matcher object.
*
* @return PHPUnit_Framework_Constraint_IsFalse
*
* @since Method available since Release 3.3.0
*/
public static function isFalse()
@ -2447,6 +2529,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_IsJson matcher object.
*
* @return PHPUnit_Framework_Constraint_IsJson
*
* @since Method available since Release 3.7.20
*/
public static function isJson()
@ -2458,6 +2541,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_IsNull matcher object.
*
* @return PHPUnit_Framework_Constraint_IsNull
*
* @since Method available since Release 3.3.0
*/
public static function isNull()
@ -2468,9 +2552,11 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_Attribute matcher object.
*
* @param PHPUnit_Framework_Constraint $constraint
* @param string $attributeName
* @param PHPUnit_Framework_Constraint $constraint
* @param string $attributeName
*
* @return PHPUnit_Framework_Constraint_Attribute
*
* @since Method available since Release 3.1.0
*/
public static function attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)
@ -2485,10 +2571,12 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_TraversableContains matcher
* object.
*
* @param mixed $value
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
* @param mixed $value
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*
* @return PHPUnit_Framework_Constraint_TraversableContains
*
* @since Method available since Release 3.0.0
*/
public static function contains($value, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
@ -2500,8 +2588,10 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
* object.
*
* @param string $type
* @param string $type
*
* @return PHPUnit_Framework_Constraint_TraversableContainsOnly
*
* @since Method available since Release 3.1.4
*/
public static function containsOnly($type)
@ -2513,7 +2603,8 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_TraversableContainsOnly matcher
* object.
*
* @param string $classname
* @param string $classname
*
* @return PHPUnit_Framework_Constraint_TraversableContainsOnly
*/
public static function containsOnlyInstancesOf($classname)
@ -2524,8 +2615,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_ArrayHasKey matcher object.
*
* @param mixed $key
* @param mixed $key
*
* @return PHPUnit_Framework_Constraint_ArrayHasKey
*
* @since Method available since Release 3.0.0
*/
public static function arrayHasKey($key)
@ -2536,12 +2629,14 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_IsEqual matcher object.
*
* @param mixed $value
* @param float $delta
* @param int $maxDepth
* @param bool $canonicalize
* @param bool $ignoreCase
* @param mixed $value
* @param float $delta
* @param int $maxDepth
* @param bool $canonicalize
* @param bool $ignoreCase
*
* @return PHPUnit_Framework_Constraint_IsEqual
*
* @since Method available since Release 3.0.0
*/
public static function equalTo($value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
@ -2560,13 +2655,15 @@ abstract class PHPUnit_Framework_Assert
* that is wrapped in a PHPUnit_Framework_Constraint_Attribute matcher
* object.
*
* @param string $attributeName
* @param mixed $value
* @param float $delta
* @param int $maxDepth
* @param bool $canonicalize
* @param bool $ignoreCase
* @param string $attributeName
* @param mixed $value
* @param float $delta
* @param int $maxDepth
* @param bool $canonicalize
* @param bool $ignoreCase
*
* @return PHPUnit_Framework_Constraint_Attribute
*
* @since Method available since Release 3.1.0
*/
public static function attributeEqualTo($attributeName, $value, $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false)
@ -2587,6 +2684,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_IsEmpty matcher object.
*
* @return PHPUnit_Framework_Constraint_IsEmpty
*
* @since Method available since Release 3.5.0
*/
public static function isEmpty()
@ -2598,6 +2696,7 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_FileExists matcher object.
*
* @return PHPUnit_Framework_Constraint_FileExists
*
* @since Method available since Release 3.0.0
*/
public static function fileExists()
@ -2608,8 +2707,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_GreaterThan matcher object.
*
* @param mixed $value
* @param mixed $value
*
* @return PHPUnit_Framework_Constraint_GreaterThan
*
* @since Method available since Release 3.0.0
*/
public static function greaterThan($value)
@ -2622,8 +2723,10 @@ abstract class PHPUnit_Framework_Assert
* a PHPUnit_Framework_Constraint_IsEqual and a
* PHPUnit_Framework_Constraint_GreaterThan matcher object.
*
* @param mixed $value
* @param mixed $value
*
* @return PHPUnit_Framework_Constraint_Or
*
* @since Method available since Release 3.1.0
*/
public static function greaterThanOrEqual($value)
@ -2637,8 +2740,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_ClassHasAttribute matcher object.
*
* @param string $attributeName
* @param string $attributeName
*
* @return PHPUnit_Framework_Constraint_ClassHasAttribute
*
* @since Method available since Release 3.1.0
*/
public static function classHasAttribute($attributeName)
@ -2652,8 +2757,10 @@ abstract class PHPUnit_Framework_Assert
* Returns a PHPUnit_Framework_Constraint_ClassHasStaticAttribute matcher
* object.
*
* @param string $attributeName
* @param string $attributeName
*
* @return PHPUnit_Framework_Constraint_ClassHasStaticAttribute
*
* @since Method available since Release 3.1.0
*/
public static function classHasStaticAttribute($attributeName)
@ -2666,8 +2773,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_ObjectHasAttribute matcher object.
*
* @param string $attributeName
* @param string $attributeName
*
* @return PHPUnit_Framework_Constraint_ObjectHasAttribute
*
* @since Method available since Release 3.0.0
*/
public static function objectHasAttribute($attributeName)
@ -2680,8 +2789,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_IsIdentical matcher object.
*
* @param mixed $value
* @param mixed $value
*
* @return PHPUnit_Framework_Constraint_IsIdentical
*
* @since Method available since Release 3.0.0
*/
public static function identicalTo($value)
@ -2692,8 +2803,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_IsInstanceOf matcher object.
*
* @param string $className
* @param string $className
*
* @return PHPUnit_Framework_Constraint_IsInstanceOf
*
* @since Method available since Release 3.0.0
*/
public static function isInstanceOf($className)
@ -2704,8 +2817,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_IsType matcher object.
*
* @param string $type
* @param string $type
*
* @return PHPUnit_Framework_Constraint_IsType
*
* @since Method available since Release 3.0.0
*/
public static function isType($type)
@ -2716,8 +2831,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_LessThan matcher object.
*
* @param mixed $value
* @param mixed $value
*
* @return PHPUnit_Framework_Constraint_LessThan
*
* @since Method available since Release 3.0.0
*/
public static function lessThan($value)
@ -2730,8 +2847,10 @@ abstract class PHPUnit_Framework_Assert
* a PHPUnit_Framework_Constraint_IsEqual and a
* PHPUnit_Framework_Constraint_LessThan matcher object.
*
* @param mixed $value
* @param mixed $value
*
* @return PHPUnit_Framework_Constraint_Or
*
* @since Method available since Release 3.1.0
*/
public static function lessThanOrEqual($value)
@ -2745,8 +2864,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_PCREMatch matcher object.
*
* @param string $pattern
* @param string $pattern
*
* @return PHPUnit_Framework_Constraint_PCREMatch
*
* @since Method available since Release 3.0.0
*/
public static function matchesRegularExpression($pattern)
@ -2757,8 +2878,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_StringMatches matcher object.
*
* @param string $string
* @param string $string
*
* @return PHPUnit_Framework_Constraint_StringMatches
*
* @since Method available since Release 3.5.0
*/
public static function matches($string)
@ -2769,8 +2892,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_StringStartsWith matcher object.
*
* @param mixed $prefix
* @param mixed $prefix
*
* @return PHPUnit_Framework_Constraint_StringStartsWith
*
* @since Method available since Release 3.4.0
*/
public static function stringStartsWith($prefix)
@ -2781,9 +2906,11 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_StringContains matcher object.
*
* @param string $string
* @param bool $case
* @param string $string
* @param bool $case
*
* @return PHPUnit_Framework_Constraint_StringContains
*
* @since Method available since Release 3.0.0
*/
public static function stringContains($string, $case = true)
@ -2794,8 +2921,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_StringEndsWith matcher object.
*
* @param mixed $suffix
* @param mixed $suffix
*
* @return PHPUnit_Framework_Constraint_StringEndsWith
*
* @since Method available since Release 3.4.0
*/
public static function stringEndsWith($suffix)
@ -2806,7 +2935,8 @@ abstract class PHPUnit_Framework_Assert
/**
* Returns a PHPUnit_Framework_Constraint_Count matcher object.
*
* @param int $count
* @param int $count
*
* @return PHPUnit_Framework_Constraint_Count
*/
public static function countOf($count)
@ -2816,7 +2946,8 @@ abstract class PHPUnit_Framework_Assert
/**
* Fails a test with the given message.
*
* @param string $message
* @param string $message
*
* @throws PHPUnit_Framework_AssertionFailedError
*/
public static function fail($message = '')
@ -2828,9 +2959,11 @@ abstract class PHPUnit_Framework_Assert
* Returns the value of an attribute of a class or an object.
* This also works for attributes that are declared protected or private.
*
* @param mixed $classOrObject
* @param string $attributeName
* @param mixed $classOrObject
* @param string $attributeName
*
* @return mixed
*
* @throws PHPUnit_Framework_Exception
*/
public static function readAttribute($classOrObject, $attributeName)
@ -2872,10 +3005,13 @@ abstract class PHPUnit_Framework_Assert
* Returns the value of a static attribute.
* This also works for attributes that are declared protected or private.
*
* @param string $className
* @param string $attributeName
* @param string $className
* @param string $attributeName
*
* @return mixed
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 4.0.0
*/
public static function getStaticAttribute($className, $attributeName)
@ -2920,10 +3056,13 @@ abstract class PHPUnit_Framework_Assert
* Returns the value of an object's attribute.
* This also works for attributes that are declared protected or private.
*
* @param object $object
* @param string $attributeName
* @param object $object
* @param string $attributeName
*
* @return mixed
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 4.0.0
*/
public static function getObjectAttribute($object, $attributeName)
@ -2977,8 +3116,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Mark the test as incomplete.
*
* @param string $message
* @param string $message
*
* @throws PHPUnit_Framework_IncompleteTestError
*
* @since Method available since Release 3.0.0
*/
public static function markTestIncomplete($message = '')
@ -2989,8 +3130,10 @@ abstract class PHPUnit_Framework_Assert
/**
* Mark the test as skipped.
*
* @param string $message
* @param string $message
*
* @throws PHPUnit_Framework_SkippedTestError
*
* @since Method available since Release 3.0.0
*/
public static function markTestSkipped($message = '')
@ -3002,6 +3145,7 @@ abstract class PHPUnit_Framework_Assert
* Return the current assertion count.
*
* @return int
*
* @since Method available since Release 3.3.3
*/
public static function getCount()

File diff suppressed because it is too large Load diff

View file

@ -11,8 +11,8 @@
/**
* An empty Listener that can be extended to implement TestListener
* with just a few lines of code.
* @see PHPUnit_Framework_TestListener for documentation on the API methods.
*
* @see PHPUnit_Framework_TestListener for documentation on the API methods.
* @since Class available since Release 4.0.0
*/
abstract class PHPUnit_Framework_BaseTestListener implements PHPUnit_Framework_TestListener

View file

@ -34,10 +34,12 @@ abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framew
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -63,7 +65,8 @@ abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framew
*
* This method can be overridden to implement the evaluation algorithm.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -75,6 +78,7 @@ abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framew
* Counts the number of constraint elements.
*
* @return int
*
* @since Method available since Release 3.4.0
*/
public function count()
@ -85,9 +89,10 @@ abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framew
/**
* 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 SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure
* @param mixed $other Evaluated value or object.
* @param string $description Additional information about the test
* @param SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure
*
* @throws PHPUnit_Framework_ExpectationFailedException
*/
protected function fail($other, $description, SebastianBergmann\Comparator\ComparisonFailure $comparisonFailure = null)
@ -119,7 +124,8 @@ abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framew
* The function can be overridden to provide additional failure
* information like a diff
*
* @param mixed $other Evaluated value or object.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function additionalFailureDescription($other)
@ -136,7 +142,8 @@ abstract class PHPUnit_Framework_Constraint implements Countable, PHPUnit_Framew
* To provide additional failure information additionalFailureDescription
* can be used.
*
* @param mixed $other Evaluated value or object.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -26,7 +26,8 @@ class PHPUnit_Framework_Constraint_And extends PHPUnit_Framework_Constraint
protected $lastConstraint = null;
/**
* @param PHPUnit_Framework_Constraint[] $constraints
* @param PHPUnit_Framework_Constraint[] $constraints
*
* @throws PHPUnit_Framework_Exception
*/
public function setConstraints(array $constraints)
@ -55,10 +56,12 @@ class PHPUnit_Framework_Constraint_And extends PHPUnit_Framework_Constraint
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -106,6 +109,7 @@ class PHPUnit_Framework_Constraint_And extends PHPUnit_Framework_Constraint
* Counts the number of constraint elements.
*
* @return int
*
* @since Method available since Release 3.4.0
*/
public function count()

View file

@ -38,7 +38,8 @@ class PHPUnit_Framework_Constraint_ArrayHasKey extends PHPUnit_Framework_Constra
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -70,7 +71,8 @@ class PHPUnit_Framework_Constraint_ArrayHasKey extends PHPUnit_Framework_Constra
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -43,7 +43,8 @@ class PHPUnit_Framework_Constraint_ArraySubset extends PHPUnit_Framework_Constra
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param array|ArrayAccess $other Array or ArrayAccess object to evaluate.
* @param array|ArrayAccess $other Array or ArrayAccess object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -73,7 +74,8 @@ class PHPUnit_Framework_Constraint_ArraySubset extends PHPUnit_Framework_Constra
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -39,10 +39,12 @@ class PHPUnit_Framework_Constraint_Attribute extends PHPUnit_Framework_Constrain
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -74,7 +76,8 @@ class PHPUnit_Framework_Constraint_Attribute extends PHPUnit_Framework_Constrain
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -16,7 +16,8 @@ class PHPUnit_Framework_Constraint_Callback extends PHPUnit_Framework_Constraint
private $callback;
/**
* @param callable $callback
* @param callable $callback
*
* @throws PHPUnit_Framework_Exception
*/
public function __construct($callback)
@ -37,7 +38,8 @@ class PHPUnit_Framework_Constraint_Callback extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $value. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -36,7 +36,8 @@ class PHPUnit_Framework_Constraint_ClassHasAttribute extends PHPUnit_Framework_C
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -65,7 +66,8 @@ class PHPUnit_Framework_Constraint_ClassHasAttribute extends PHPUnit_Framework_C
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -22,7 +22,8 @@ class PHPUnit_Framework_Constraint_ClassHasStaticAttribute extends PHPUnit_Frame
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -42,6 +43,7 @@ class PHPUnit_Framework_Constraint_ClassHasStaticAttribute extends PHPUnit_Frame
* Returns a string representation of the constraint.
*
* @return string
*
* @since Method available since Release 3.3.0
*/
public function toString()

View file

@ -37,10 +37,12 @@ abstract class PHPUnit_Framework_Constraint_Composite extends PHPUnit_Framework_
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)

View file

@ -31,7 +31,8 @@ class PHPUnit_Framework_Constraint_Count extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other
* @param mixed $other
*
* @return bool
*/
protected function matches($other)
@ -40,7 +41,8 @@ class PHPUnit_Framework_Constraint_Count extends PHPUnit_Framework_Constraint
}
/**
* @param mixed $other
* @param mixed $other
*
* @return bool
*/
protected function getCountOf($other)
@ -76,7 +78,8 @@ class PHPUnit_Framework_Constraint_Count extends PHPUnit_Framework_Constraint
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -31,7 +31,8 @@ class PHPUnit_Framework_Constraint_Exception extends PHPUnit_Framework_Constrain
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -45,7 +46,8 @@ class PHPUnit_Framework_Constraint_Exception extends PHPUnit_Framework_Constrain
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -31,7 +31,8 @@ class PHPUnit_Framework_Constraint_ExceptionCode extends PHPUnit_Framework_Const
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param Exception $other
* @param Exception $other
*
* @return bool
*/
protected function matches($other)
@ -45,7 +46,8 @@ class PHPUnit_Framework_Constraint_ExceptionCode extends PHPUnit_Framework_Const
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -31,7 +31,8 @@ class PHPUnit_Framework_Constraint_ExceptionMessage extends PHPUnit_Framework_Co
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param Exception $other
* @param Exception $other
*
* @return bool
*/
protected function matches($other)
@ -45,7 +46,8 @@ class PHPUnit_Framework_Constraint_ExceptionMessage extends PHPUnit_Framework_Co
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -31,7 +31,8 @@ class PHPUnit_Framework_Constraint_ExceptionMessageRegExp extends PHPUnit_Framew
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param Exception $other
* @param Exception $other
*
* @return bool
*/
protected function matches($other)
@ -53,7 +54,8 @@ class PHPUnit_Framework_Constraint_ExceptionMessageRegExp extends PHPUnit_Framew
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -21,7 +21,8 @@ class PHPUnit_Framework_Constraint_FileExists extends PHPUnit_Framework_Constrai
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -35,7 +36,8 @@ class PHPUnit_Framework_Constraint_FileExists extends PHPUnit_Framework_Constrai
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -34,7 +34,8 @@ class PHPUnit_Framework_Constraint_GreaterThan extends PHPUnit_Framework_Constra
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -25,10 +25,12 @@ class PHPUnit_Framework_Constraint_IsAnything extends PHPUnit_Framework_Constrai
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -50,6 +52,7 @@ class PHPUnit_Framework_Constraint_IsAnything extends PHPUnit_Framework_Constrai
* Counts the number of constraint elements.
*
* @return int
*
* @since Method available since Release 3.5.0
*/
public function count()

View file

@ -19,7 +19,8 @@ class PHPUnit_Framework_Constraint_IsEmpty extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -47,7 +48,8 @@ class PHPUnit_Framework_Constraint_IsEmpty extends PHPUnit_Framework_Constraint
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -52,11 +52,12 @@ class PHPUnit_Framework_Constraint_IsEqual extends PHPUnit_Framework_Constraint
protected $lastFailure;
/**
* @param mixed $value
* @param float $delta
* @param int $maxDepth
* @param bool $canonicalize
* @param bool $ignoreCase
* @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)
@ -96,10 +97,12 @@ class PHPUnit_Framework_Constraint_IsEqual extends PHPUnit_Framework_Constraint
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)

View file

@ -19,7 +19,8 @@ class PHPUnit_Framework_Constraint_IsFalse extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -52,10 +52,12 @@ class PHPUnit_Framework_Constraint_IsIdentical extends PHPUnit_Framework_Constra
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -95,7 +97,8 @@ class PHPUnit_Framework_Constraint_IsIdentical extends PHPUnit_Framework_Constra
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -36,7 +36,8 @@ class PHPUnit_Framework_Constraint_IsInstanceOf extends PHPUnit_Framework_Constr
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -50,7 +51,8 @@ class PHPUnit_Framework_Constraint_IsInstanceOf extends PHPUnit_Framework_Constr
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -19,7 +19,8 @@ class PHPUnit_Framework_Constraint_IsJson extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -38,7 +39,8 @@ class PHPUnit_Framework_Constraint_IsJson extends PHPUnit_Framework_Constraint
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -19,7 +19,8 @@ class PHPUnit_Framework_Constraint_IsNull extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -19,7 +19,8 @@ class PHPUnit_Framework_Constraint_IsTrue extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -57,7 +57,8 @@ class PHPUnit_Framework_Constraint_IsType extends PHPUnit_Framework_Constraint
protected $type;
/**
* @param string $type
* @param string $type
*
* @throws PHPUnit_Framework_Exception
*/
public function __construct($type)
@ -81,7 +82,8 @@ class PHPUnit_Framework_Constraint_IsType extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -37,7 +37,8 @@ class PHPUnit_Framework_Constraint_JsonMatches extends PHPUnit_Framework_Constra
*
* This method can be overridden to implement the evaluation algorithm.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -18,8 +18,9 @@ class PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider
/**
* Translates JSON error to a human readable string.
*
* @param string $error
* @param string $prefix
* @param string $error
* @param string $prefix
*
* @return string
*/
public static function determineJsonError($error, $prefix = '')
@ -45,7 +46,8 @@ class PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider
/**
* Translates a given type to a human readable message prefix.
*
* @param string $type
* @param string $type
*
* @return string
*/
public static function translateTypeToPrefix($type)

View file

@ -34,7 +34,8 @@ class PHPUnit_Framework_Constraint_LessThan extends PHPUnit_Framework_Constraint
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -35,7 +35,8 @@ class PHPUnit_Framework_Constraint_Not extends PHPUnit_Framework_Constraint
}
/**
* @param string $string
* @param string $string
*
* @return string
*/
public static function negate($string)
@ -79,10 +80,12 @@ class PHPUnit_Framework_Constraint_Not extends PHPUnit_Framework_Constraint
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -104,7 +107,8 @@ class PHPUnit_Framework_Constraint_Not extends PHPUnit_Framework_Constraint
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)
@ -146,6 +150,7 @@ class PHPUnit_Framework_Constraint_Not extends PHPUnit_Framework_Constraint
* Counts the number of constraint elements.
*
* @return int
*
* @since Method available since Release 3.4.0
*/
public function count()

View file

@ -22,7 +22,8 @@ class PHPUnit_Framework_Constraint_ObjectHasAttribute extends PHPUnit_Framework_
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -48,10 +48,12 @@ class PHPUnit_Framework_Constraint_Or extends PHPUnit_Framework_Constraint
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -99,6 +101,7 @@ class PHPUnit_Framework_Constraint_Or extends PHPUnit_Framework_Constraint
* Counts the number of constraint elements.
*
* @return int
*
* @since Method available since Release 3.4.0
*/
public function count()

View file

@ -39,7 +39,8 @@ class PHPUnit_Framework_Constraint_PCREMatch extends PHPUnit_Framework_Constrain
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -47,7 +47,8 @@ class PHPUnit_Framework_Constraint_StringContains extends PHPUnit_Framework_Cons
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -34,7 +34,8 @@ class PHPUnit_Framework_Constraint_StringEndsWith extends PHPUnit_Framework_Cons
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -34,7 +34,8 @@ class PHPUnit_Framework_Constraint_StringStartsWith extends PHPUnit_Framework_Co
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)

View file

@ -32,9 +32,10 @@ class PHPUnit_Framework_Constraint_TraversableContains extends PHPUnit_Framework
protected $value;
/**
* @param mixed $value
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
* @param mixed $value
* @param bool $checkForObjectIdentity
* @param bool $checkForNonObjectIdentity
*
* @throws PHPUnit_Framework_Exception
*/
public function __construct($value, $checkForObjectIdentity = true, $checkForNonObjectIdentity = false)
@ -58,7 +59,8 @@ class PHPUnit_Framework_Constraint_TraversableContains extends PHPUnit_Framework
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*
* @param mixed $other Value or object to evaluate.
* @param mixed $other Value or object to evaluate.
*
* @return bool
*/
protected function matches($other)
@ -69,19 +71,17 @@ class PHPUnit_Framework_Constraint_TraversableContains extends PHPUnit_Framework
if (is_object($this->value)) {
foreach ($other as $element) {
if (($this->checkForObjectIdentity &&
$element === $this->value) ||
(!$this->checkForObjectIdentity &&
$element == $this->value)) {
if ($this->checkForObjectIdentity && $element === $this->value) {
return true;
} elseif (!$this->checkForObjectIdentity && $element == $this->value) {
return true;
}
}
} else {
foreach ($other as $element) {
if (($this->checkForNonObjectIdentity &&
$element === $this->value) ||
(!$this->checkForNonObjectIdentity &&
$element == $this->value)) {
if ($this->checkForNonObjectIdentity && $element === $this->value) {
return true;
} elseif (!$this->checkForNonObjectIdentity && $element == $this->value) {
return true;
}
}
@ -110,7 +110,8 @@ class PHPUnit_Framework_Constraint_TraversableContains extends PHPUnit_Framework
* 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.
* @param mixed $other Evaluated value or object.
*
* @return string
*/
protected function failureDescription($other)

View file

@ -55,10 +55,12 @@ class PHPUnit_Framework_Constraint_TraversableContainsOnly extends PHPUnit_Frame
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)

View file

@ -48,10 +48,12 @@ class PHPUnit_Framework_Constraint_Xor extends PHPUnit_Framework_Constraint
* 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
* @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 PHPUnit_Framework_ExpectationFailedException
*/
public function evaluate($other, $description = '', $returnResult = false)
@ -104,6 +106,7 @@ class PHPUnit_Framework_Constraint_Xor extends PHPUnit_Framework_Constraint
* Counts the number of constraint elements.
*
* @return int
*
* @since Method available since Release 3.4.0
*/
public function count()

View file

@ -27,7 +27,6 @@
* the parent would break the intended encapsulation of process isolation.
*
* @see http://fabien.potencier.org/article/9/php-serialization-stack-traces-and-exceptions
*
* @since Class available since Release 3.4.0
*/
class PHPUnit_Framework_Exception extends RuntimeException implements PHPUnit_Exception

View file

@ -18,7 +18,8 @@ interface PHPUnit_Framework_Test extends Countable
/**
* Runs a test and collects its result in a TestResult instance.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult $result
*
* @return PHPUnit_Framework_TestResult
*/
public function run(PHPUnit_Framework_TestResult $result = null);

View file

@ -313,6 +313,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns the annotations for this test.
*
* @return array
*
* @since Method available since Release 3.4.0
*/
public function getAnnotations()
@ -326,7 +327,8 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* Gets the name of a TestCase.
*
* @param bool $withDataSet
* @param bool $withDataSet
*
* @return string
*/
public function getName($withDataSet = true)
@ -342,6 +344,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns the size of the test.
*
* @return int
*
* @since Method available since Release 3.6.0
*/
public function getSize()
@ -354,6 +357,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return string
*
* @since Method available since Release 3.6.0
*/
public function getActualOutput()
@ -367,6 +371,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return bool
*
* @since Method available since Release 3.6.0
*/
public function hasOutput()
@ -384,7 +389,9 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @param string $expectedRegex
*
* @since Method available since Release 3.6.0
*
* @throws PHPUnit_Framework_Exception
*/
public function expectOutputRegex($expectedRegex)
@ -400,6 +407,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @param string $expectedString
*
* @since Method available since Release 3.6.0
*/
public function expectOutputString($expectedString)
@ -415,6 +423,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return bool
*
* @since Method available since Release 3.6.5
* @deprecated
*/
@ -425,6 +434,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return bool
*
* @since Method available since Release 4.3.3
*/
public function hasExpectationOnOutput()
@ -434,6 +444,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return string
*
* @since Method available since Release 3.2.0
*/
public function getExpectedException()
@ -445,6 +456,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* @param mixed $exceptionName
* @param string $exceptionMessage
* @param int $exceptionCode
*
* @since Method available since Release 3.2.0
*/
public function setExpectedException($exceptionName, $exceptionMessage = '', $exceptionCode = null)
@ -458,6 +470,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* @param mixed $exceptionName
* @param string $exceptionMessageRegExp
* @param int $exceptionCode
*
* @since Method available since Release 4.3.0
*/
public function setExpectedExceptionRegExp($exceptionName, $exceptionMessageRegExp = '', $exceptionCode = null)
@ -499,6 +512,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @param bool $useErrorHandler
*
* @since Method available since Release 3.4.0
*/
public function setUseErrorHandler($useErrorHandler)
@ -547,6 +561,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns the status of this test.
*
* @return int
*
* @since Method available since Release 3.1.0
*/
public function getStatus()
@ -558,6 +573,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns the status message of this test.
*
* @return string
*
* @since Method available since Release 3.3.0
*/
public function getStatusMessage()
@ -569,6 +585,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns whether or not this test has failed.
*
* @return bool
*
* @since Method available since Release 3.0.0
*/
public function hasFailed()
@ -583,8 +600,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Runs the test case and collects the results in a TestResult object.
* If no TestResult object is passed a new one will be created.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult $result
*
* @return PHPUnit_Framework_TestResult
*
* @throws PHPUnit_Framework_Exception
*/
public function run(PHPUnit_Framework_TestResult $result = null)
@ -864,6 +883,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Override to run the test and assert its state.
*
* @return mixed
*
* @throws Exception|PHPUnit_Framework_Exception
* @throws PHPUnit_Framework_Exception
*/
@ -984,7 +1004,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
if ($this->prophet !== null) {
try {
$this->prophet->checkPredictions();
} catch (Throwable $t) {
} catch (Throwable $e) {
/* Intentionally left empty */
} catch (Exception $e) {
/* Intentionally left empty */
@ -1018,6 +1038,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Sets the dependencies of a TestCase.
*
* @param array $dependencies
*
* @since Method available since Release 3.4.0
*/
public function setDependencies(array $dependencies)
@ -1029,6 +1050,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns true if the tests has dependencies
*
* @return bool
*
* @since Method available since Release 4.0.0
*/
public function hasDependencies()
@ -1040,6 +1062,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Sets
*
* @param array $dependencyInput
*
* @since Method available since Release 3.4.0
*/
public function setDependencyInput(array $dependencyInput)
@ -1049,6 +1072,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @param bool $disallowChangesToGlobalState
*
* @since Method available since Release 4.6.0
*/
public function setDisallowChangesToGlobalState($disallowChangesToGlobalState)
@ -1060,6 +1084,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Calling this method in setUp() has no effect!
*
* @param bool $backupGlobals
*
* @since Method available since Release 3.3.0
*/
public function setBackupGlobals($backupGlobals)
@ -1073,6 +1098,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Calling this method in setUp() has no effect!
*
* @param bool $backupStaticAttributes
*
* @since Method available since Release 3.4.0
*/
public function setBackupStaticAttributes($backupStaticAttributes)
@ -1084,8 +1110,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param bool $runTestInSeparateProcess
* @param bool $runTestInSeparateProcess
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.4.0
*/
public function setRunTestInSeparateProcess($runTestInSeparateProcess)
@ -1100,8 +1128,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param bool $preserveGlobalState
* @param bool $preserveGlobalState
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.4.0
*/
public function setPreserveGlobalState($preserveGlobalState)
@ -1114,8 +1144,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param bool $inIsolation
* @param bool $inIsolation
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.4.0
*/
public function setInIsolation($inIsolation)
@ -1129,6 +1161,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return bool
*
* @since Method available since Release 4.3.0
*/
public function isInIsolation()
@ -1138,6 +1171,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return mixed
*
* @since Method available since Release 3.4.0
*/
public function getResult()
@ -1147,6 +1181,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @param mixed $result
*
* @since Method available since Release 3.4.0
*/
public function setResult($result)
@ -1155,8 +1190,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param callable $callback
* @param callable $callback
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.6.0
*/
public function setOutputCallback($callback)
@ -1170,6 +1207,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return PHPUnit_Framework_TestResult
*
* @since Method available since Release 3.5.7
*/
public function getTestResultObject()
@ -1179,6 +1217,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @param PHPUnit_Framework_TestResult $result
*
* @since Method available since Release 3.6.0
*/
public function setTestResultObject(PHPUnit_Framework_TestResult $result)
@ -1191,9 +1230,11 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* resets the modified php.ini setting to its original value after the
* test is run.
*
* @param string $varName
* @param string $newValue
* @param string $varName
* @param string $newValue
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.0.0
*/
protected function iniSet($varName, $newValue)
@ -1221,9 +1262,11 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* This method is a wrapper for the setlocale() function that automatically
* resets the locale to its original value after the test is run.
*
* @param int $category
* @param string $locale
* @param int $category
* @param string $locale
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.1.0
*/
protected function setLocale()
@ -1269,23 +1312,27 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* Returns a mock object for the specified class.
*
* @param string $originalClassName Name of the class to mock.
* @param array|null $methods When provided, only methods whose names are in the array
* are replaced with a configurable test double. The behavior
* of the other methods is not changed.
* Providing null means that no methods will be replaced.
* @param array $arguments Parameters to pass to the original class' constructor.
* @param string $mockClassName Class name for the generated test double class.
* @param bool $callOriginalConstructor Can be used to disable the call to the original class' constructor.
* @param bool $callOriginalClone Can be used to disable the call to the original class' clone constructor.
* @param bool $callAutoload Can be used to disable __autoload() during the generation of the test double class.
* @param bool $cloneArguments
* @param bool $callOriginalMethods
* @param string $originalClassName Name of the class to mock.
* @param array|null $methods When provided, only methods whose names are in the array
* are replaced with a configurable test double. The behavior
* of the other methods is not changed.
* Providing null means that no methods will be replaced.
* @param array $arguments Parameters to pass to the original class' constructor.
* @param string $mockClassName Class name for the generated test double class.
* @param bool $callOriginalConstructor Can be used to disable the call to the original class' constructor.
* @param bool $callOriginalClone Can be used to disable the call to the original class' clone constructor.
* @param bool $callAutoload Can be used to disable __autoload() during the generation of the test double class.
* @param bool $cloneArguments
* @param bool $callOriginalMethods
* @param object $proxyTarget
*
* @return PHPUnit_Framework_MockObject_MockObject
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.0.0
*/
public function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false)
public function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false, $proxyTarget = null)
{
$mockObject = $this->getMockObjectGenerator()->getMock(
$originalClassName,
@ -1296,7 +1343,8 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
$callOriginalClone,
$callAutoload,
$cloneArguments,
$callOriginalMethods
$callOriginalMethods,
$proxyTarget
);
$this->mockObjects[] = $mockObject;
@ -1307,8 +1355,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* Returns a builder object to create mock objects using a fluent interface.
*
* @param string $className
* @param string $className
*
* @return PHPUnit_Framework_MockObject_MockBuilder
*
* @since Method available since Release 3.5.0
*/
public function getMockBuilder($className)
@ -1319,16 +1369,19 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* Mocks the specified class and returns the name of the mocked class.
*
* @param string $originalClassName
* @param array $methods
* @param array $arguments
* @param string $mockClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param bool $cloneArguments
* @param string $originalClassName
* @param array $methods
* @param array $arguments
* @param string $mockClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param bool $cloneArguments
*
* @return string
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.5.0
*/
protected function getMockClass($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = false, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false)
@ -1352,16 +1405,19 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* methods of the class mocked. Concrete methods are not mocked by default.
* To mock concrete methods, use the 7th parameter ($mockedMethods).
*
* @param string $originalClassName
* @param array $arguments
* @param string $mockClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param array $mockedMethods
* @param bool $cloneArguments
* @param string $originalClassName
* @param array $arguments
* @param string $mockClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param array $mockedMethods
* @param bool $cloneArguments
*
* @return PHPUnit_Framework_MockObject_MockObject
*
* @since Method available since Release 3.4.0
*
* @throws PHPUnit_Framework_Exception
*/
public function getMockForAbstractClass($originalClassName, array $arguments = array(), $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $mockedMethods = array(), $cloneArguments = false)
@ -1385,13 +1441,15 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* Returns a mock object based on the given WSDL file.
*
* @param string $wsdlFile
* @param string $originalClassName
* @param string $mockClassName
* @param array $methods
* @param bool $callOriginalConstructor
* @param array $options An array of options passed to SOAPClient::_construct
* @param string $wsdlFile
* @param string $originalClassName
* @param string $mockClassName
* @param array $methods
* @param bool $callOriginalConstructor
* @param array $options An array of options passed to SOAPClient::_construct
*
* @return PHPUnit_Framework_MockObject_MockObject
*
* @since Method available since Release 3.4.0
*/
protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = array(), $callOriginalConstructor = true, array $options = array())
@ -1427,16 +1485,19 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* of the trait mocked. Concrete methods to mock can be specified with the
* `$mockedMethods` parameter.
*
* @param string $traitName
* @param array $arguments
* @param string $mockClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param array $mockedMethods
* @param bool $cloneArguments
* @param string $traitName
* @param array $arguments
* @param string $mockClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param array $mockedMethods
* @param bool $cloneArguments
*
* @return PHPUnit_Framework_MockObject_MockObject
*
* @since Method available since Release 4.0.0
*
* @throws PHPUnit_Framework_Exception
*/
public function getMockForTrait($traitName, array $arguments = array(), $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $mockedMethods = array(), $cloneArguments = false)
@ -1460,15 +1521,18 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* Returns an object for the specified trait.
*
* @param string $traitName
* @param array $arguments
* @param string $traitClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param bool $cloneArguments
* @param string $traitName
* @param array $arguments
* @param string $traitClassName
* @param bool $callOriginalConstructor
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param bool $cloneArguments
*
* @return object
*
* @since Method available since Release 3.6.0
*
* @throws PHPUnit_Framework_Exception
*/
protected function getObjectForTrait($traitName, array $arguments = array(), $traitClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false)
@ -1485,9 +1549,12 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param string|null $classOrInterface
* @param string|null $classOrInterface
*
* @return \Prophecy\Prophecy\ObjectProphecy
*
* @throws \LogicException
*
* @since Method available since Release 4.5.0
*/
protected function prophesize($classOrInterface = null)
@ -1499,6 +1566,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Adds a value to the assertion counter.
*
* @param int $count
*
* @since Method available since Release 3.3.3
*/
public function addToAssertionCount($count)
@ -1510,6 +1578,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns the number of assertions performed by this test.
*
* @return int
*
* @since Method available since Release 3.3.0
*/
public function getNumAssertions()
@ -1522,6 +1591,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* zero or more times.
*
* @return PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount
*
* @since Method available since Release 3.0.0
*/
public static function any()
@ -1533,6 +1603,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns a matcher that matches when the method is never executed.
*
* @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
*
* @since Method available since Release 3.0.0
*/
public static function never()
@ -1544,8 +1615,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns a matcher that matches when the method is executed
* at least N times.
*
* @param int $requiredInvocations
* @param int $requiredInvocations
*
* @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastCount
*
* @since Method available since Release 4.2.0
*/
public static function atLeast($requiredInvocations)
@ -1559,6 +1632,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns a matcher that matches when the method is executed at least once.
*
* @return PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce
*
* @since Method available since Release 3.0.0
*/
public static function atLeastOnce()
@ -1570,6 +1644,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns a matcher that matches when the method is executed exactly once.
*
* @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
*
* @since Method available since Release 3.0.0
*/
public static function once()
@ -1581,8 +1656,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns a matcher that matches when the method is executed
* exactly $count times.
*
* @param int $count
* @param int $count
*
* @return PHPUnit_Framework_MockObject_Matcher_InvokedCount
*
* @since Method available since Release 3.0.0
*/
public static function exactly($count)
@ -1594,8 +1671,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns a matcher that matches when the method is executed
* at most N times.
*
* @param int $allowedInvocations
* @param int $allowedInvocations
*
* @return PHPUnit_Framework_MockObject_Matcher_InvokedAtMostCount
*
* @since Method available since Release 4.2.0
*/
public static function atMost($allowedInvocations)
@ -1609,8 +1688,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Returns a matcher that matches when the method is executed
* at the given index.
*
* @param int $index
* @param int $index
*
* @return PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex
*
* @since Method available since Release 3.0.0
*/
public static function at($index)
@ -1619,8 +1700,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param mixed $value
* @param mixed $value
*
* @return PHPUnit_Framework_MockObject_Stub_Return
*
* @since Method available since Release 3.0.0
*/
public static function returnValue($value)
@ -1629,8 +1712,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param array $valueMap
* @param array $valueMap
*
* @return PHPUnit_Framework_MockObject_Stub_ReturnValueMap
*
* @since Method available since Release 3.6.0
*/
public static function returnValueMap(array $valueMap)
@ -1639,8 +1724,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param int $argumentIndex
* @param int $argumentIndex
*
* @return PHPUnit_Framework_MockObject_Stub_ReturnArgument
*
* @since Method available since Release 3.3.0
*/
public static function returnArgument($argumentIndex)
@ -1651,8 +1738,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param mixed $callback
* @param mixed $callback
*
* @return PHPUnit_Framework_MockObject_Stub_ReturnCallback
*
* @since Method available since Release 3.3.0
*/
public static function returnCallback($callback)
@ -1666,6 +1755,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* This method is useful when mocking a fluent interface.
*
* @return PHPUnit_Framework_MockObject_Stub_ReturnSelf
*
* @since Method available since Release 3.6.0
*/
public static function returnSelf()
@ -1674,8 +1764,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param Exception $exception
* @param Exception $exception
*
* @return PHPUnit_Framework_MockObject_Stub_Exception
*
* @since Method available since Release 3.1.0
*/
public static function throwException(Exception $exception)
@ -1684,8 +1776,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param mixed $value, ...
* @param mixed $value, ...
*
* @return PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls
*
* @since Method available since Release 3.0.0
*/
public static function onConsecutiveCalls()
@ -1698,8 +1792,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* Gets the data set description of a TestCase.
*
* @param bool $includeData
* @param bool $includeData
*
* @return string
*
* @since Method available since Release 3.3.0
*/
protected function getDataSetAsString($includeData = true)
@ -1861,7 +1957,9 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* This method is called when a test method did not execute successfully.
*
* @param Exception $e
*
* @since Method available since Release 3.4.0
*
* @throws Exception
*/
protected function onNotSuccessfulTest(Exception $e)
@ -1873,6 +1971,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
* Performs custom preparations on the process isolation template.
*
* @param Text_Template $template
*
* @since Method available since Release 3.4.0
*/
protected function prepareTemplate(Text_Template $template)
@ -1961,10 +2060,14 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
$backupGlobals = $this->backupGlobals === null || $this->backupGlobals === true;
if ($this->disallowChangesToGlobalState) {
$this->compareGlobalStateSnapshots(
$this->snapshot,
$this->createGlobalStateSnapshot($backupGlobals)
);
try {
$this->compareGlobalStateSnapshots(
$this->snapshot,
$this->createGlobalStateSnapshot($backupGlobals)
);
} catch (PHPUnit_Framework_RiskyTestError $rte) {
// Intentionally left empty
}
}
$restorer = new Restorer;
@ -1978,10 +2081,15 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
$this->snapshot = null;
if (isset($rte)) {
throw $rte;
}
}
/**
* @param bool $backupGlobals
* @param bool $backupGlobals
*
* @return Snapshot
*/
private function createGlobalStateSnapshot($backupGlobals)
@ -2025,8 +2133,9 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param Snapshot $before
* @param Snapshot $after
* @param Snapshot $before
* @param Snapshot $after
*
* @throws PHPUnit_Framework_RiskyTestError
*/
private function compareGlobalStateSnapshots(Snapshot $before, Snapshot $after)
@ -2057,9 +2166,10 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
}
/**
* @param array $before
* @param array $after
* @param string $header
* @param array $before
* @param array $after
* @param string $header
*
* @throws PHPUnit_Framework_RiskyTestError
*/
private function compareGlobalStateSnapshotPart(array $before, array $after, $header)
@ -2081,6 +2191,7 @@ abstract class PHPUnit_Framework_TestCase extends PHPUnit_Framework_Assert imple
/**
* @return Prophecy\Prophet
*
* @since Method available since Release 4.5.0
*/
private function getProphet()

View file

@ -67,6 +67,7 @@ class PHPUnit_Framework_TestFailure
* Returns a description for the thrown exception.
*
* @return string
*
* @since Method available since Release 3.4.0
*/
public function getExceptionAsString()
@ -77,8 +78,10 @@ class PHPUnit_Framework_TestFailure
/**
* Returns a description for an exception.
*
* @param Exception $e
* @param Exception $e
*
* @return string
*
* @since Method available since Release 3.2.0
*/
public static function exceptionToString(Exception $e)
@ -108,6 +111,7 @@ class PHPUnit_Framework_TestFailure
* Returns the name of the failing test (including data set, if any).
*
* @return string
*
* @since Method available since Release 4.3.0
*/
public function getTestName()

View file

@ -48,6 +48,7 @@ interface PHPUnit_Framework_TestListener
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
*
* @since Method available since Release 4.0.0
*/
public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time);
@ -58,6 +59,7 @@ interface PHPUnit_Framework_TestListener
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
*
* @since Method available since Release 3.0.0
*/
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time);
@ -66,6 +68,7 @@ interface PHPUnit_Framework_TestListener
* A test suite started.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite);
@ -74,6 +77,7 @@ interface PHPUnit_Framework_TestListener
* A test suite ended.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite);

View file

@ -285,6 +285,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Informs the result that a testsuite will be started.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
@ -302,6 +303,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Informs the result that a testsuite was completed.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
@ -358,6 +360,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns true if no risky test occurred.
*
* @return bool
*
* @since Method available since Release 4.0.0
*/
public function allHarmless()
@ -369,6 +372,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Gets the number of risky tests.
*
* @return int
*
* @since Method available since Release 4.0.0
*/
public function riskyCount()
@ -400,6 +404,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns an Enumeration for the risky tests.
*
* @return array
*
* @since Method available since Release 4.0.0
*/
public function risky()
@ -421,6 +426,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns true if no test has been skipped.
*
* @return bool
*
* @since Method available since Release 3.0.0
*/
public function noneSkipped()
@ -432,6 +438,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Gets the number of skipped tests.
*
* @return int
*
* @since Method available since Release 3.0.0
*/
public function skippedCount()
@ -443,6 +450,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns an Enumeration for the skipped tests.
*
* @return array
*
* @since Method available since Release 3.0.0
*/
public function skipped()
@ -494,6 +502,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns the names of the tests that have passed.
*
* @return array
*
* @since Method available since Release 3.4.0
*/
public function passed()
@ -505,6 +514,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns the (top) test suite.
*
* @return PHPUnit_Framework_TestSuite
*
* @since Method available since Release 3.0.0
*/
public function topTestSuite()
@ -516,6 +526,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns whether code coverage information should be collected.
*
* @return bool If code coverage should be collected
*
* @since Method available since Release 3.2.0
*/
public function getCollectCodeCoverageInformation()
@ -754,6 +765,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns the PHP_CodeCoverage object.
*
* @return PHP_CodeCoverage
*
* @since Method available since Release 3.5.0
*/
public function getCodeCoverage()
@ -765,6 +777,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Sets the PHP_CodeCoverage object.
*
* @param PHP_CodeCoverage $codeCoverage
*
* @since Method available since Release 3.6.0
*/
public function setCodeCoverage(PHP_CodeCoverage $codeCoverage)
@ -775,8 +788,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Enables or disables the error-to-exception conversion.
*
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.2.14
*/
public function convertErrorsToExceptions($flag)
@ -792,6 +807,7 @@ class PHPUnit_Framework_TestResult implements Countable
* Returns the error-to-exception conversion setting.
*
* @return bool
*
* @since Method available since Release 3.4.0
*/
public function getConvertErrorsToExceptions()
@ -802,8 +818,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Enables or disables the stopping when an error occurs.
*
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.5.0
*/
public function stopOnError($flag)
@ -818,8 +836,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Enables or disables the stopping when a failure occurs.
*
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.1.0
*/
public function stopOnFailure($flag)
@ -832,8 +852,10 @@ class PHPUnit_Framework_TestResult implements Countable
}
/**
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 4.0.0
*/
public function beStrictAboutTestsThatDoNotTestAnything($flag)
@ -847,6 +869,7 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* @return bool
*
* @since Method available since Release 4.0.0
*/
public function isStrictAboutTestsThatDoNotTestAnything()
@ -855,8 +878,10 @@ class PHPUnit_Framework_TestResult implements Countable
}
/**
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 4.0.0
*/
public function beStrictAboutOutputDuringTests($flag)
@ -870,6 +895,7 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* @return bool
*
* @since Method available since Release 4.0.0
*/
public function isStrictAboutOutputDuringTests()
@ -878,8 +904,10 @@ class PHPUnit_Framework_TestResult implements Countable
}
/**
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 4.0.0
*/
public function beStrictAboutTestSize($flag)
@ -893,6 +921,7 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* @return bool
*
* @since Method available since Release 4.0.0
*/
public function isStrictAboutTestSize()
@ -901,8 +930,10 @@ class PHPUnit_Framework_TestResult implements Countable
}
/**
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 4.2.0
*/
public function beStrictAboutTodoAnnotatedTests($flag)
@ -916,6 +947,7 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* @return bool
*
* @since Method available since Release 4.2.0
*/
public function isStrictAboutTodoAnnotatedTests()
@ -926,8 +958,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Enables or disables the stopping for risky tests.
*
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 4.0.0
*/
public function stopOnRisky($flag)
@ -942,8 +976,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Enables or disables the stopping for incomplete tests.
*
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.5.0
*/
public function stopOnIncomplete($flag)
@ -958,8 +994,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Enables or disables the stopping for skipped tests.
*
* @param bool $flag
* @param bool $flag
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.1.0
*/
public function stopOnSkipped($flag)
@ -994,8 +1032,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Sets the timeout for small tests.
*
* @param int $timeout
* @param int $timeout
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.6.0
*/
public function setTimeoutForSmallTests($timeout)
@ -1010,8 +1050,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Sets the timeout for medium tests.
*
* @param int $timeout
* @param int $timeout
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.6.0
*/
public function setTimeoutForMediumTests($timeout)
@ -1026,8 +1068,10 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Sets the timeout for large tests.
*
* @param int $timeout
* @param int $timeout
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.6.0
*/
public function setTimeoutForLargeTests($timeout)
@ -1042,8 +1086,9 @@ class PHPUnit_Framework_TestResult implements Countable
/**
* Returns the class hierarchy for a given class.
*
* @param string $className
* @param bool $asReflectionObjects
* @param string $className
* @param bool $asReflectionObjects
*
* @return array
*/
protected function getHierarchy($className, $asReflectionObjects = false)

View file

@ -131,8 +131,9 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* name of an existing class) or constructs an empty TestSuite
* with the given name.
*
* @param mixed $theClass
* @param string $name
* @param mixed $theClass
* @param string $name
*
* @throws PHPUnit_Framework_Exception
*/
public function __construct($theClass = '', $name = '')
@ -254,7 +255,8 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* Adds the tests from the given class to the suite.
*
* @param mixed $testClass
* @param mixed $testClass
*
* @throws PHPUnit_Framework_Exception
*/
public function addTestSuite($testClass)
@ -307,8 +309,10 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* added, a <code>PHPUnit_Framework_Warning</code> will be created instead,
* leaving the current test run untouched.
*
* @param string $filename
* @param string $filename
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 2.3.0
*/
public function addTestFile($filename)
@ -385,8 +389,10 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* Wrapper for addTestFile() that adds multiple test files.
*
* @param array|Iterator $filenames
* @param array|Iterator $filenames
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 2.3.0
*/
public function addTestFiles($filenames)
@ -407,7 +413,8 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* Counts the number of test cases that will be run by this test.
*
* @param bool $preferCache Indicates if cache is preferred.
* @param bool $preferCache Indicates if cache is preferred.
*
* @return int
*/
public function count($preferCache = false)
@ -426,9 +433,11 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
}
/**
* @param ReflectionClass $theClass
* @param string $name
* @param ReflectionClass $theClass
* @param string $name
*
* @return PHPUnit_Framework_Test
*
* @throws PHPUnit_Framework_Exception
*/
public static function createTest(ReflectionClass $theClass, $name)
@ -628,6 +637,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* Returns the test groups of the suite.
*
* @return array
*
* @since Method available since Release 3.2.0
*/
public function getGroups()
@ -644,6 +654,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* Set tests groups of the test case
*
* @param array $groups
*
* @since Method available since Release 4.0.0
*/
public function setGroupDetails(array $groups)
@ -654,7 +665,8 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* Runs the tests and collects their result in a TestResult.
*
* @param PHPUnit_Framework_TestResult $result
* @param PHPUnit_Framework_TestResult $result
*
* @return PHPUnit_Framework_TestResult
*/
public function run(PHPUnit_Framework_TestResult $result = null)
@ -749,8 +761,10 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
}
/**
* @param bool $runTestInSeparateProcess
* @param bool $runTestInSeparateProcess
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.7.0
*/
public function setRunTestInSeparateProcess($runTestInSeparateProcess)
@ -766,6 +780,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* Runs a test.
*
* @deprecated
*
* @param PHPUnit_Framework_Test $test
* @param PHPUnit_Framework_TestResult $result
*/
@ -788,6 +803,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* Returns the test at the given index.
*
* @param int
*
* @return PHPUnit_Framework_Test
*/
public function testAt($index)
@ -813,6 +829,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* Set tests of the test suite
*
* @param array $tests
*
* @since Method available since Release 4.0.0
*/
public function setTests(array $tests)
@ -823,8 +840,10 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* Mark the test suite as skipped.
*
* @param string $message
* @param string $message
*
* @throws PHPUnit_Framework_SkippedTestSuiteError
*
* @since Method available since Release 3.0.0
*/
public function markTestSuiteSkipped($message = '')
@ -874,7 +893,8 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
}
/**
* @param ReflectionMethod $method
* @param ReflectionMethod $method
*
* @return bool
*/
public static function isTestMethod(ReflectionMethod $method)
@ -892,7 +912,8 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
}
/**
* @param string $message
* @param string $message
*
* @return PHPUnit_Framework_Warning
*/
protected static function warning($message)
@ -901,10 +922,12 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
}
/**
* @param string $class
* @param string $methodName
* @param string $message
* @param string $class
* @param string $methodName
* @param string $message
*
* @return PHPUnit_Framework_SkippedTestCase
*
* @since Method available since Release 4.3.0
*/
protected static function skipTest($class, $methodName, $message)
@ -913,10 +936,12 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
}
/**
* @param string $class
* @param string $methodName
* @param string $message
* @param string $class
* @param string $methodName
* @param string $message
*
* @return PHPUnit_Framework_IncompleteTestCase
*
* @since Method available since Release 4.3.0
*/
protected static function incompleteTest($class, $methodName, $message)
@ -926,6 +951,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* @param bool $disallowChangesToGlobalState
*
* @since Method available since Release 4.6.0
*/
public function setDisallowChangesToGlobalState($disallowChangesToGlobalState)
@ -937,6 +963,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* @param bool $backupGlobals
*
* @since Method available since Release 3.3.0
*/
public function setBackupGlobals($backupGlobals)
@ -948,6 +975,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
/**
* @param bool $backupStaticAttributes
*
* @since Method available since Release 3.4.0
*/
public function setBackupStaticAttributes($backupStaticAttributes)
@ -962,6 +990,7 @@ class PHPUnit_Framework_TestSuite implements PHPUnit_Framework_Test, PHPUnit_Fra
* Returns an iterator for this test suite.
*
* @return RecursiveIteratorIterator
*
* @since Method available since Release 3.1.0
*/
public function getIterator()

View file

@ -59,6 +59,7 @@ class PHPUnit_Framework_Warning extends PHPUnit_Framework_TestCase
/**
* @return string
*
* @since Method available since Release 3.0.0
*/
public function getMessage()
@ -70,6 +71,7 @@ class PHPUnit_Framework_Warning extends PHPUnit_Framework_TestCase
* Returns a string representation of the test case.
*
* @return string
*
* @since Method available since Release 3.4.0
*/
public function toString()

View file

@ -38,9 +38,10 @@ abstract class PHPUnit_Runner_BaseTestRunner
* This is a template method, subclasses override
* the runFailed() and clearStatus() methods.
*
* @param string $suiteClassName
* @param string $suiteClassFile
* @param mixed $suffixes
* @param string $suiteClassName
* @param string $suiteClassFile
* @param mixed $suffixes
*
* @return PHPUnit_Framework_Test
*/
public function getTest($suiteClassName, $suiteClassFile = '', $suffixes = '')
@ -110,8 +111,9 @@ abstract class PHPUnit_Runner_BaseTestRunner
/**
* Returns the loaded ReflectionClass for a suite name.
*
* @param string $suiteClassName
* @param string $suiteClassFile
* @param string $suiteClassName
* @param string $suiteClassFile
*
* @return ReflectionClass
*/
protected function loadSuiteClass($suiteClassName, $suiteClassFile = '')

View file

@ -16,9 +16,11 @@
class PHPUnit_Runner_StandardTestSuiteLoader implements PHPUnit_Runner_TestSuiteLoader
{
/**
* @param string $suiteClassName
* @param string $suiteClassFile
* @param string $suiteClassName
* @param string $suiteClassFile
*
* @return ReflectionClass
*
* @throws PHPUnit_Framework_Exception
*/
public function load($suiteClassName, $suiteClassFile = '')
@ -105,7 +107,8 @@ class PHPUnit_Runner_StandardTestSuiteLoader implements PHPUnit_Runner_TestSuite
}
/**
* @param ReflectionClass $aClass
* @param ReflectionClass $aClass
*
* @return ReflectionClass
*/
public function reload(ReflectionClass $aClass)

View file

@ -16,14 +16,16 @@
interface PHPUnit_Runner_TestSuiteLoader
{
/**
* @param string $suiteClassName
* @param string $suiteClassFile
* @param string $suiteClassName
* @param string $suiteClassFile
*
* @return ReflectionClass
*/
public function load($suiteClassName, $suiteClassFile = '');
/**
* @param ReflectionClass $aClass
* @param ReflectionClass $aClass
*
* @return ReflectionClass
*/
public function reload(ReflectionClass $aClass);

View file

@ -30,13 +30,30 @@ class PHPUnit_Runner_Version
}
if (self::$version === null) {
$version = new SebastianBergmann\Version('4.8.11', dirname(dirname(__DIR__)));
$version = new SebastianBergmann\Version('4.8.27', dirname(dirname(__DIR__)));
self::$version = $version->getVersion();
}
return self::$version;
}
/**
* @return string
*
* @since Method available since Release 4.8.13
*/
public static function series()
{
if (strpos(self::id(), '-')) {
$tmp = explode('-', self::id());
$version = $tmp[0];
} else {
$version = self::id();
}
return implode('.', array_slice(explode('.', $version), 0, 2));
}
/**
* @return string
*/
@ -47,16 +64,13 @@ class PHPUnit_Runner_Version
/**
* @return string
*
* @since Method available since Release 4.0.0
*/
public static function getReleaseChannel()
{
if (strpos(self::$pharVersion, 'alpha') !== false) {
return '-alpha';
}
if (strpos(self::$pharVersion, 'beta') !== false) {
return '-beta';
if (strpos(self::$pharVersion, '-') !== false) {
return '-nightly';
}
return '';

View file

@ -101,8 +101,9 @@ class PHPUnit_TextUI_Command
}
/**
* @param array $argv
* @param bool $exit
* @param array $argv
* @param bool $exit
*
* @return int
*/
public function run(array $argv, $exit = true)
@ -169,6 +170,7 @@ class PHPUnit_TextUI_Command
* Create a TestRunner, override in subclasses.
*
* @return PHPUnit_TextUI_TestRunner
*
* @since Method available since Release 3.6.0
*/
protected function createRunner()
@ -227,6 +229,8 @@ class PHPUnit_TextUI_Command
$this->longOptions['check-version'] = null;
$this->longOptions['selfupdate'] = null;
$this->longOptions['self-update'] = null;
$this->longOptions['selfupgrade'] = null;
$this->longOptions['self-upgrade'] = null;
}
try {
@ -484,6 +488,15 @@ class PHPUnit_TextUI_Command
$this->handleSelfUpdate();
break;
case '--selfupgrade':
case '--self-upgrade':
$this->handleSelfUpdate(true);
break;
case '--whitelist':
$this->arguments['whitelist'] = $option[1];
break;
default:
$optionName = str_replace('--', '', $option[0]);
@ -665,8 +678,9 @@ class PHPUnit_TextUI_Command
/**
* Handles the loading of the PHPUnit_Runner_TestSuiteLoader implementation.
*
* @param string $loaderClass
* @param string $loaderFile
* @param string $loaderClass
* @param string $loaderFile
*
* @return PHPUnit_Runner_TestSuiteLoader
*/
protected function handleLoader($loaderClass, $loaderFile = '')
@ -709,8 +723,9 @@ class PHPUnit_TextUI_Command
/**
* Handles the loading of the PHPUnit_Util_Printer implementation.
*
* @param string $printerClass
* @param string $printerFile
* @param string $printerClass
* @param string $printerFile
*
* @return PHPUnit_Util_Printer
*/
protected function handlePrinter($printerClass, $printerFile = '')
@ -770,7 +785,7 @@ class PHPUnit_TextUI_Command
/**
* @since Method available since Release 4.0.0
*/
protected function handleSelfUpdate()
protected function handleSelfUpdate($upgrade = false)
{
$this->printVersionString();
@ -786,17 +801,28 @@ class PHPUnit_TextUI_Command
exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
}
if (PHP_VERSION_ID < 50600) {
$remoteFilename = sprintf('https://phar.phpunit.de/phpunit-old.phar');
if (!$upgrade) {
$remoteFilename = sprintf(
'https://phar.phpunit.de/phpunit-%s.phar',
file_get_contents(
sprintf(
'https://phar.phpunit.de/latest-version-of/phpunit-%s',
PHPUnit_Runner_Version::series()
)
)
);
} else {
$remoteFilename = sprintf('https://phar.phpunit.de/phpunit.phar');
$remoteFilename = sprintf(
'https://phar.phpunit.de/phpunit%s.phar',
PHPUnit_Runner_Version::getReleaseChannel()
);
}
$tempFilename = tempnam(sys_get_temp_dir(), 'phpunit') . '.phar';
// Workaround for https://bugs.php.net/bug.php?id=65538
$caFile = dirname($tempFilename) . '/ca.pem';
copy(__PHPUNIT_PHAR_ROOT__ . '/phar/ca.pem', $caFile);
copy(__PHPUNIT_PHAR_ROOT__ . '/ca.pem', $caFile);
print 'Updating the PHPUnit PHAR ... ';
@ -858,7 +884,7 @@ class PHPUnit_TextUI_Command
if ($isOutdated) {
print "You are not using the latest version of PHPUnit.\n";
print 'Use "phpunit --self-update" to install PHPUnit ' . $latestVersion . "\n";
print 'Use "phpunit --self-upgrade" to install PHPUnit ' . $latestVersion . "\n";
} else {
print "You are using the latest version of PHPUnit.\n";
}
@ -954,7 +980,8 @@ EOT;
if (defined('__PHPUNIT_PHAR__')) {
print "\n --check-version Check whether PHPUnit is the latest version.";
print "\n --self-update Update PHPUnit to the latest version.\n";
print "\n --self-update Update PHPUnit to the latest version within the same\n release series.\n";
print "\n --self-upgrade Upgrade PHPUnit to the latest version.\n";
}
}

View file

@ -108,12 +108,14 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
/**
* Constructor.
*
* @param mixed $out
* @param bool $verbose
* @param string $colors
* @param bool $debug
* @param int|string $numberOfColumns
* @param mixed $out
* @param bool $verbose
* @param string $colors
* @param bool $debug
* @param int|string $numberOfColumns
*
* @throws PHPUnit_Framework_Exception
*
* @since Method available since Release 3.0.0
*/
public function __construct($out = null, $verbose = false, $colors = self::COLOR_DEFAULT, $debug = false, $numberOfColumns = 80)
@ -298,6 +300,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
/**
* @param PHPUnit_Framework_TestResult $result
*
* @since Method available since Release 4.0.0
*/
protected function printRisky(PHPUnit_Framework_TestResult $result)
@ -307,6 +310,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
/**
* @param PHPUnit_Framework_TestResult $result
*
* @since Method available since Release 3.0.0
*/
protected function printSkipped(PHPUnit_Framework_TestResult $result)
@ -425,6 +429,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
*
* @since Method available since Release 4.0.0
*/
public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time)
@ -439,6 +444,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
* @param PHPUnit_Framework_Test $test
* @param Exception $e
* @param float $time
*
* @since Method available since Release 3.0.0
*/
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time)
@ -451,6 +457,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
* A testsuite started.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite)
@ -466,6 +473,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
* A testsuite ended.
*
* @param PHPUnit_Framework_TestSuite $suite
*
* @since Method available since Release 2.2.0
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite)
@ -550,9 +558,11 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
* Formats a buffer with a specified ANSI color sequence if colors are
* enabled.
*
* @param string $color
* @param string $buffer
* @param string $color
* @param string $buffer
*
* @return string
*
* @since Method available since Release 4.0.0
*/
protected function formatWithColor($color, $buffer)
@ -587,6 +597,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
* @param string $color
* @param string $buffer
* @param bool $lf
*
* @since Method available since Release 4.0.0
*/
protected function writeWithColor($color, $buffer, $lf = true)
@ -603,6 +614,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
*
* @param string $color
* @param string $buffer
*
* @since Method available since Release 4.0.0
*/
protected function writeProgressWithColor($color, $buffer)
@ -616,6 +628,7 @@ class PHPUnit_TextUI_ResultPrinter extends PHPUnit_Util_Printer implements PHPUn
* @param string $name
* @param string $color
* @param bool $always
*
* @since Method available since Release 4.6.5
*/
private function writeCountString($count, $name, $color, $always = false)

View file

@ -55,6 +55,7 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
/**
* @param PHPUnit_Runner_TestSuiteLoader $loader
* @param PHP_CodeCoverage_Filter $filter
*
* @since Method available since Release 3.4.0
*/
public function __construct(PHPUnit_Runner_TestSuiteLoader $loader = null, PHP_CodeCoverage_Filter $filter = null)
@ -69,9 +70,11 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
}
/**
* @param PHPUnit_Framework_Test|ReflectionClass $test
* @param array $arguments
* @param PHPUnit_Framework_Test|ReflectionClass $test
* @param array $arguments
*
* @return PHPUnit_Framework_TestResult
*
* @throws PHPUnit_Framework_Exception
*/
public static function run($test, array $arguments = array())
@ -136,8 +139,9 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
}
/**
* @param PHPUnit_Framework_Test $suite
* @param array $arguments
* @param PHPUnit_Framework_Test $suite
* @param array $arguments
*
* @return PHPUnit_Framework_TestResult
*/
public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
@ -448,11 +452,17 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in Clover XML format ..."
);
$writer = new PHP_CodeCoverage_Report_Clover;
$writer->process($codeCoverage, $arguments['coverageClover']);
try {
$writer = new PHP_CodeCoverage_Report_Clover;
$writer->process($codeCoverage, $arguments['coverageClover']);
$this->printer->write(" done\n");
unset($writer);
$this->printer->write(" done\n");
unset($writer);
} catch (PHP_CodeCoverage_Exception $e) {
$this->printer->write(
" failed\n" . $e->getMessage() . "\n"
);
}
}
if (isset($arguments['coverageCrap4J'])) {
@ -460,11 +470,17 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating Crap4J report XML file ..."
);
$writer = new PHP_CodeCoverage_Report_Crap4j($arguments['crap4jThreshold']);
$writer->process($codeCoverage, $arguments['coverageCrap4J']);
try {
$writer = new PHP_CodeCoverage_Report_Crap4j($arguments['crap4jThreshold']);
$writer->process($codeCoverage, $arguments['coverageCrap4J']);
$this->printer->write(" done\n");
unset($writer);
$this->printer->write(" done\n");
unset($writer);
} catch (PHP_CodeCoverage_Exception $e) {
$this->printer->write(
" failed\n" . $e->getMessage() . "\n"
);
}
}
if (isset($arguments['coverageHtml'])) {
@ -472,19 +488,25 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in HTML format ..."
);
$writer = new PHP_CodeCoverage_Report_HTML(
$arguments['reportLowUpperBound'],
$arguments['reportHighLowerBound'],
sprintf(
' and <a href="http://phpunit.de/">PHPUnit %s</a>',
PHPUnit_Runner_Version::id()
)
);
try {
$writer = new PHP_CodeCoverage_Report_HTML(
$arguments['reportLowUpperBound'],
$arguments['reportHighLowerBound'],
sprintf(
' and <a href="https://phpunit.de/">PHPUnit %s</a>',
PHPUnit_Runner_Version::id()
)
);
$writer->process($codeCoverage, $arguments['coverageHtml']);
$writer->process($codeCoverage, $arguments['coverageHtml']);
$this->printer->write(" done\n");
unset($writer);
$this->printer->write(" done\n");
unset($writer);
} catch (PHP_CodeCoverage_Exception $e) {
$this->printer->write(
" failed\n" . $e->getMessage() . "\n"
);
}
}
if (isset($arguments['coveragePHP'])) {
@ -492,17 +514,23 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in PHP format ..."
);
$writer = new PHP_CodeCoverage_Report_PHP;
$writer->process($codeCoverage, $arguments['coveragePHP']);
try {
$writer = new PHP_CodeCoverage_Report_PHP;
$writer->process($codeCoverage, $arguments['coveragePHP']);
$this->printer->write(" done\n");
unset($writer);
$this->printer->write(" done\n");
unset($writer);
} catch (PHP_CodeCoverage_Exception $e) {
$this->printer->write(
" failed\n" . $e->getMessage() . "\n"
);
}
}
if (isset($arguments['coverageText'])) {
if ($arguments['coverageText'] == 'php://stdout') {
$outputStream = $this->printer;
$colors = $arguments['colors'];
$colors = $arguments['colors'] && $arguments['colors'] != PHPUnit_TextUI_ResultPrinter::COLOR_NEVER;
} else {
$outputStream = new PHPUnit_Util_Printer($arguments['coverageText']);
$colors = false;
@ -525,11 +553,17 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
"\nGenerating code coverage report in PHPUnit XML format ..."
);
$writer = new PHP_CodeCoverage_Report_XML;
$writer->process($codeCoverage, $arguments['coverageXml']);
try {
$writer = new PHP_CodeCoverage_Report_XML;
$writer->process($codeCoverage, $arguments['coverageXml']);
$this->printer->write(" done\n");
unset($writer);
$this->printer->write(" done\n");
unset($writer);
} catch (PHP_CodeCoverage_Exception $e) {
$this->printer->write(
" failed\n" . $e->getMessage() . "\n"
);
}
}
}
@ -558,11 +592,12 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
/**
* @param string $buffer
*
* @since Method available since Release 3.1.0
*/
protected function write($buffer)
{
if (PHP_SAPI != 'cli') {
if (PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg') {
$buffer = htmlspecialchars($buffer);
}
@ -577,6 +612,7 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
* Returns the loader to be used.
*
* @return PHPUnit_Runner_TestSuiteLoader
*
* @since Method available since Release 2.2.0
*/
public function getLoader()
@ -590,6 +626,7 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
/**
* @param array $arguments
*
* @since Method available since Release 3.2.1
*/
protected function handleConfiguration(array &$arguments)
@ -984,6 +1021,7 @@ class PHPUnit_TextUI_TestRunner extends PHPUnit_Runner_BaseTestRunner
/**
* @param $extension
* @param string $message
*
* @since Method available since Release 4.7.3
*/
private function showExtensionNotLoadedWarning($extension, $message = '')

View file

@ -50,6 +50,7 @@ class PHPUnit_Util_Blacklist
/**
* @return array
*
* @since Method available since Release 4.1.0
*/
public function getBlacklistedDirectories()
@ -60,7 +61,8 @@ class PHPUnit_Util_Blacklist
}
/**
* @param string $file
* @param string $file
*
* @return bool
*/
public function isBlacklisted($file)

View file

@ -169,8 +169,10 @@ class PHPUnit_Util_Configuration
/**
* Returns a PHPUnit configuration object.
*
* @param string $filename
* @param string $filename
*
* @return PHPUnit_Util_Configuration
*
* @since Method available since Release 3.4.0
*/
public static function getInstance($filename)
@ -197,6 +199,7 @@ class PHPUnit_Util_Configuration
* Returns the realpath to the configuration file.
*
* @return string
*
* @since Method available since Release 3.6.0
*/
public function getFilename()
@ -208,6 +211,7 @@ class PHPUnit_Util_Configuration
* Returns the configuration for SUT filtering.
*
* @return array
*
* @since Method available since Release 3.2.1
*/
public function getFilterConfiguration()
@ -283,6 +287,7 @@ class PHPUnit_Util_Configuration
* Returns the configuration for groups.
*
* @return array
*
* @since Method available since Release 3.2.1
*/
public function getGroupConfiguration()
@ -307,6 +312,7 @@ class PHPUnit_Util_Configuration
* Returns the configuration for listeners.
*
* @return array
*
* @since Method available since Release 3.4.0
*/
public function getListenerConfiguration()
@ -422,6 +428,7 @@ class PHPUnit_Util_Configuration
* Returns the PHP configuration.
*
* @return array
*
* @since Method available since Release 3.2.1
*/
public function getPHPConfiguration()
@ -540,6 +547,7 @@ class PHPUnit_Util_Configuration
* Returns the PHPUnit configuration.
*
* @return array
*
* @since Method available since Release 3.2.14
*/
public function getPHPUnitConfiguration()
@ -796,6 +804,7 @@ class PHPUnit_Util_Configuration
* Returns the SeleniumTestCase browser configuration.
*
* @return array
*
* @since Method available since Release 3.2.9
*/
public function getSeleniumBrowserConfiguration()
@ -846,6 +855,7 @@ class PHPUnit_Util_Configuration
* Returns the test suite configuration.
*
* @return PHPUnit_Framework_TestSuite
*
* @since Method available since Release 3.2.1
*/
public function getTestSuiteConfiguration($testSuiteFilter = null)
@ -874,8 +884,10 @@ class PHPUnit_Util_Configuration
}
/**
* @param DOMElement $testSuiteNode
* @param DOMElement $testSuiteNode
*
* @return PHPUnit_Framework_TestSuite
*
* @since Method available since Release 3.4.0
*/
protected function getTestSuite(DOMElement $testSuiteNode, $testSuiteFilter = null)
@ -992,9 +1004,11 @@ class PHPUnit_Util_Configuration
}
/**
* @param string $value
* @param bool $default
* @param string $value
* @param bool $default
*
* @return bool
*
* @since Method available since Release 3.2.3
*/
protected function getBoolean($value, $default)
@ -1009,9 +1023,11 @@ class PHPUnit_Util_Configuration
}
/**
* @param string $value
* @param bool $default
* @param string $value
* @param bool $default
*
* @return bool
*
* @since Method available since Release 3.6.0
*/
protected function getInteger($value, $default)
@ -1024,8 +1040,10 @@ class PHPUnit_Util_Configuration
}
/**
* @param string $query
* @param string $query
*
* @return array
*
* @since Method available since Release 3.2.3
*/
protected function readFilterDirectories($query)
@ -1069,8 +1087,10 @@ class PHPUnit_Util_Configuration
}
/**
* @param string $query
* @param string $query
*
* @return array
*
* @since Method available since Release 3.2.3
*/
protected function readFilterFiles($query)
@ -1079,6 +1099,7 @@ class PHPUnit_Util_Configuration
foreach ($this->xpath->query($query) as $file) {
$filePath = (string) $file->textContent;
if ($filePath) {
$files[] = $this->toAbsolutePath($filePath);
}
@ -1088,13 +1109,17 @@ class PHPUnit_Util_Configuration
}
/**
* @param string $path
* @param bool $useIncludePath
* @param string $path
* @param bool $useIncludePath
*
* @return string
*
* @since Method available since Release 3.5.0
*/
protected function toAbsolutePath($path, $useIncludePath = false)
{
$path = trim($path);
if ($path[0] === '/') {
return $path;
}

View file

@ -36,10 +36,11 @@ class PHPUnit_Util_ErrorHandler
}
/**
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
*
* @throws PHPUnit_Framework_Error
*/
public static function handleError($errno, $errstr, $errfile, $errline)
@ -87,7 +88,9 @@ class PHPUnit_Util_ErrorHandler
/**
* Registers an error handler and returns a function that will restore
* the previous handler when invoked
* @param int $severity PHP predefined error constant
*
* @param int $severity PHP predefined error constant
*
* @throws Exception if event of specified severity is emitted
*/
public static function handleErrorOnce($severity = E_WARNING)

View file

@ -19,8 +19,10 @@ class PHPUnit_Util_Fileloader
* Checks if a PHP sourcefile is readable.
* The sourcefile is loaded through the load() method.
*
* @param string $filename
* @param string $filename
*
* @return string
*
* @throws PHPUnit_Framework_Exception
*/
public static function checkAndLoad($filename)
@ -41,8 +43,10 @@ class PHPUnit_Util_Fileloader
/**
* Loads a PHP sourcefile.
*
* @param string $filename
* @param string $filename
*
* @return mixed
*
* @since Method available since Release 3.0.0
*/
public static function load($filename)

View file

@ -25,8 +25,10 @@ class PHPUnit_Util_Filesystem
* - PEAR CS: Foo_Bar_Baz -> Foo/Bar/Baz.php
* - Namespace: Foo\Bar\Baz -> Foo/Bar/Baz.php
*
* @param string $className
* @param string $className
*
* @return string
*
* @since Method available since Release 3.4.0
*/
public static function classNameToFilename($className)

View file

@ -18,8 +18,9 @@ class PHPUnit_Util_Filter
/**
* Filters stack frames from PHPUnit classes.
*
* @param Exception $e
* @param bool $asString
* @param Exception $e
* @param bool $asString
*
* @return string
*/
public static function getFilteredStacktrace(Exception $e, $asString = true)
@ -84,10 +85,12 @@ class PHPUnit_Util_Filter
}
/**
* @param array $trace
* @param string $file
* @param int $line
* @param array $trace
* @param string $file
* @param int $line
*
* @return bool
*
* @since Method available since Release 3.3.2
*/
private static function frameExists(array $trace, $file, $line)

View file

@ -17,9 +17,10 @@
class PHPUnit_Util_InvalidArgumentHelper
{
/**
* @param int $argument
* @param string $type
* @param mixed $value
* @param int $argument
* @param string $type
* @param mixed $value
*
* @return PHPUnit_Framework_Exception
*/
public static function factory($argument, $type, $value = null)

Some files were not shown because too many files have changed in this diff Show more