...
 
Commits (52)
.gitlab-ci.yml export-ignore
composer.lock export-ignore
tests/ export-ignore
......@@ -4,40 +4,61 @@ stages:
- deploy
before_script:
- "echo 'assume_php=false' > .hhconfig"
- echo 'hhvm.php7.all=1' >> /etc/hhvm/php.ini
- echo 'assume_php=false' > .hhconfig
- echo 'safe_array=true' >> .hhconfig
- echo 'safe_vector_array=true' >> .hhconfig
- echo 'enable_experimental_tc_features = safe_pass_by_ref, no_fallback_in_namespaces' >> .hhconfig
- ./tests/composer.sh
- composer install
cache:
paths:
- vendor/
hack-min:
script:
- hh_server --check .
stage: typecheck
image: hhvm/hhvm:3.24.3
tags:
- hhvm-3.9
- docker
hack:
script:
- hh_server --check .
stage: typecheck
image: hhvm/hhvm:latest
tags:
- docker
hack-nightly:
script:
- hh_server --check .
stage: typecheck
image: hhvm/hhvm:nightly
tags:
- hhvm
- docker
phpunit-min:
script:
- hhvm vendor/bin/phpunit --bootstrap tests/HHITest.php tests/
- hhvm vendor/bin/phpunit tests/
stage: test
image: hhvm/hhvm:3.24.3
tags:
- hhvm-3.9
- docker
phpunit:
script:
- hhvm vendor/bin/phpunit --bootstrap tests/HHITest.php tests/
- hhvm vendor/bin/phpunit tests/
stage: test
image: hhvm/hhvm:latest
tags:
- hhvm
- docker
phpunit-nightly:
script:
- hhvm vendor/bin/phpunit tests/
stage: test
image: hhvm/hhvm:nightly
tags:
- docker
packagist:
stage: deploy
......@@ -48,3 +69,5 @@ packagist:
-H 'content-type:application/json' \
\"https://packagist.org/api/update-package?username=simon_w&apiToken=$PACKAGIST_TOKEN\" \
-d '{\"repository\":{\"url\":\"https://git.simon.geek.nz/91-carriage/phpunit-hhi.git\"}}'"
tags:
- docker
# Changelog
## 6.2.0
* Updated to match PHPUnit 6.2
* This is a **major release**. All classes are now in namespaces.
* Minimum HHVM version is now 3.20.2
## 5.7.1
* Updated to match PHPUnit 5.7.19
* Added:
+ `PHPUnit_Framework_Constraint_Count::getCountOfGenerator`
## 5.7.0
* Updated to match PHPUnit 5.7
* Added:
+ `PHPUnit\Framework\Assert`
+ `PHPUnit\Framework\BaseTestListener`
+ `PHPUnit\Framework\TestListener`
+ `PHPUnit_Framework_TestCase::markAsRisky`
+ `$includeWarnings` argument to `PHPUnit_Framework_TestResult::wasSuccessful`
* Renamed:
+ `PHPUnit_Framework_ExceptionWrapper::$classname` to
`PHPUnit_Framework_ExceptionWrapper::$className`
+ `PHPUnit_Framework_ExceptionWrapper::getClassname` to
`PHPUnit_Framework_ExceptionWrapper::getClassName`
## 5.6.0
* Updated to match PHPUnit 5.6
......
......@@ -13,9 +13,9 @@ code correctly.
The easiest way to install this package is with [Composer][composer].
To do so, add `"91carriage/phpunit-hhi": "~5.6.0"` to the `require-dev` section
To do so, add `"91carriage/phpunit-hhi": "~6.2.0"` to the `require-dev` section
of your `composer.json` or run
`composer require --dev '91carriage/phpunit-hhi:~5.6.0'`.
`composer require --dev '91carriage/phpunit-hhi:~6.2.0'`.
It is not recommended to install this as part of your `requires` section as it
should only be used during development.
......@@ -75,8 +75,8 @@ This code is provided under the MIT (X11 variant) license. The full text of
which can be found in the [LICENSE.md](LICENSE.md) file.
<!-- Please keep these sorted alphabetically. -->
[build-image]: https://git.simon.geek.nz/91-carriage/phpunit-hhi/badges/phpunit-5.6/build.svg
[build-link]: https://git.simon.geek.nz/91-carriage/phpunit-hhi/commits/phpunit-5.6
[build-image]: https://git.simon.geek.nz/91-carriage/phpunit-hhi/badges/phpunit-6.2/build.svg
[build-link]: https://git.simon.geek.nz/91-carriage/phpunit-hhi/commits/phpunit-6.2
[composer]: https://getcomposer.org/
[decl-mode]: http://docs.hhvm.com/hack/typechecker/modes#decl-mode
[strict-mode]: http://docs.hhvm.com/hack/typechecker/modes#strict-mode
......
......@@ -5,11 +5,13 @@
"homepage": "https://git.simon.geek.nz/91-carriage/phpunit-hhi",
"license": ["MIT"],
"require": {
"hhvm": ">=3.9.0"
"hhvm": ">=3.24.3"
},
"extra": {
"branch-alias": {
"dev-master": "5.7.x-dev",
"dev-master": "6.3.x-dev",
"dev-phpunit-6.2": "6.2.x-dev",
"dev-phpunit-5.7": "5.7.x-dev",
"dev-phpunit-5.6": "5.6.x-dev",
"dev-phpunit-5.5": "5.5.x-dev",
"dev-phpunit-5.4": "5.4.x-dev",
......@@ -21,7 +23,7 @@
}
},
"conflict": {
"phpunit/phpunit": "<5.6.1"
"phpunit/phpunit": "<6.2.0"
},
"suggest": {
"91carriage/dbunit-hhi": "HHI files for use with DbUnit"
......@@ -33,6 +35,11 @@
"require-dev": {
"phpunit/phpunit": "*"
},
"autoload-dev": {
"classmap": [
"tests/"
]
},
"minimum-stability": "dev",
"prefer-stable": true
}
This diff is collapsed.
<?hh // decl
interface PHPUnit_Exception {}
namespace PHPUnit;
interface Exception {}
<?hh // decl
namespace PHPUnit\Framework;
abstract class TestCase extends \PHPUnit_Framework_TestCase {}
This diff is collapsed.
<?hh // decl
class PHPUnit_Framework_AssertionFailedError
extends PHPUnit_Framework_Exception
implements PHPUnit_Framework_SelfDescribing {
namespace PHPUnit\Framework;
class AssertionFailedError extends Exception implements SelfDescribing {
public function toString(): string;
}
<?hh // decl
abstract class PHPUnit_Framework_BaseTestListener
implements PHPUnit_Framework_TestListener {
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time);
public function addWarning(
PHPUnit_Framework_Test $test,
PHPUnit_Framework_Warning $e,
$time,
);
public function addFailure(
PHPUnit_Framework_Test $test,
PHPUnit_Framework_AssertionFailedError $e,
$time,
);
public function addIncompleteTest(
PHPUnit_Framework_Test $test,
Exception $e,
$time,
);
public function addRiskyTest(
PHPUnit_Framework_Test $test,
Exception $e,
$time,
);
public function addSkippedTest(
PHPUnit_Framework_Test $test,
Exception $e,
$time,
);
public function startTestSuite(PHPUnit_Framework_TestSuite $suite);
public function endTestSuite(PHPUnit_Framework_TestSuite $suite);
public function startTest(PHPUnit_Framework_Test $test);
public function endTest(PHPUnit_Framework_Test $test, $time);
namespace PHPUnit\Framework;
abstract class BaseTestListener implements TestListener {
public function addError(Test $test, \Exception $e, $time);
public function addWarning(Test $test, Warning $e, $time);
public function addFailure(Test $test, AssertionFailedError $e, $time);
public function addIncompleteTest(Test $test, \Exception $e, $time);
public function addRiskyTest(Test $test, \Exception $e, $time);
public function addSkippedTest(Test $test, \Exception $e, $time);
public function startTestSuite(TestSuite $suite);
public function endTestSuite(TestSuite $suite);
public function startTest(Test $test);
public function endTest(Test $test, $time);
}
<?hh // decl
class PHPUnit_Framework_CodeCoverageException
extends PHPUnit_Framework_Exception {}
namespace PHPUnit\Framework;
class CodeCoverageException extends Exception {}
<?hh // decl
class PHPUnit_Framework_Constraint_And<T>
extends PHPUnit_Framework_Constraint<T> {
protected ?PHPUnit_Framework_Constraint<T> $lastConstraint;
public function setConstraints(
protected array<PHPUnit_Framework_Constraint<T>> $constraints,
): void;
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_ArrayHasKey
extends PHPUnit_Framework_Constraint<array> {
namespace PHPUnit\Framework\Constraint;
class ArrayHasKey extends Constraint<array> {
public function __construct(protected arraykey $key);
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_ArraySubset
extends PHPUnit_Framework_Constraint<array> {
namespace PHPUnit\Framework\Constraint;
class ArraySubset extends Constraint<array> {
public function __construct(
protected array $subset,
protected bool $strict = false,
......
<?hh // decl
class PHPUnit_Framework_Constraint_Attribute<T>
extends PHPUnit_Framework_Constraint_Composite<T> {
namespace PHPUnit\Framework\Constraint;
class Attribute<T> extends Composite<T> {
public function __construct(
PHPUnit_Framework_Constraint<T> $constraint,
Constraint<T> $constraint,
protected string $attributeName,
);
......
<?hh // decl
class PHPUnit_Framework_Constraint_Callback<T>
extends PHPUnit_Framework_Constraint<T> {
namespace PHPUnit\Framework\Constraint;
class Callback<T> extends Constraint<T> {
public function __construct(private (function(T): bool) $callback);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_ClassHasAttribute<T>
extends PHPUnit_Framework_Constraint<classname<T>> {
namespace PHPUnit\Framework\Constraint;
class ClassHasAttribute<T> extends Constraint<classname<T>> {
public function __construct(protected string $attributeName);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_ClassHasStaticAttribute<T>
extends PHPUnit_Framework_Constraint_ClassHasAttribute<T> {}
namespace PHPUnit\Framework\Constraint;
class ClassHasStaticAttribute<T> extends ClassHasAttribute<T> {}
<?hh // decl
abstract class PHPUnit_Framework_Constraint_Composite<T>
extends PHPUnit_Framework_Constraint<T> {
public function __construct(
protected PHPUnit_Framework_Constraint<T> $innerConstraint,
);
namespace PHPUnit\Framework\Constraint;
abstract class Composite<T> extends Constraint<T> {
public function __construct(protected Constraint<T> $innerConstraint);
}
<?hh // decl
abstract class PHPUnit_Framework_Constraint<T>
implements Countable, PHPUnit_Framework_SelfDescribing {
namespace PHPUnit\Framework\Constraint;
abstract class Constraint<T>
implements \Countable, \PHPUnit\Framework\SelfDescribing {
protected /*SebastianBergmann\Exporter\Exporter */ $exporter;
public function __construct();
......
<?hh // decl
class PHPUnit_Framework_Constraint_Count<T>
extends PHPUnit_Framework_Constraint<T> {
namespace PHPUnit\Framework\Constraint;
class Count<T> extends Constraint<T> {
public function __construct(protected int $expected);
protected function getCountOf(T $other): ?int;
protected function getCountOfGenerator(\Generator $generator): int;
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_DirectoryExists
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class DirectoryExists extends Constraint<string> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_Exception
extends PHPUnit_Framework_Constraint<Exception> {
namespace PHPUnit\Framework\Constraint;
class Exception extends Constraint<Exception> {
public function __construct(protected classname<Exception> $className);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_ExceptionCode
extends PHPUnit_Framework_Constraint<Exception> {
namespace PHPUnit\Framework\Constraint;
class ExceptionCode extends Constraint<Exception> {
public function __construct(protected int $expectedCode);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_ExceptionMessage
extends PHPUnit_Framework_Constraint<Exception> {
namespace PHPUnit\Framework\Constraint;
class ExceptionMessage extends Constraint<Exception> {
public function __construct(protected string $expectedMessage);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_ExceptionMessageRegExp
extends PHPUnit_Framework_Constraint<Exception> {
namespace PHPUnit\Framework\Constraint;
class ExceptionMessageRegExp extends Constraint<Exception> {
public function __construct(protected string $expectedMessageRegExp);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_FileExists
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class FileExists extends Constraint<string> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_GreaterThan
extends PHPUnit_Framework_Constraint<num> {
namespace PHPUnit\Framework\Constraint;
class GreaterThan extends Constraint<num> {
public function __construct(protected num $value);
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsAnything
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsAnything extends Constraint<mixed> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsEmpty
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsEmpty extends Constraint<mixed> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsEqual
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsEqual extends Constraint<mixed> {
public function __construct(
protected mixed $value,
protected float $delta = 0.0,
......
<?hh // decl
class PHPUnit_Framework_Constraint_IsFalse
extends PHPUnit_Framework_Constraint<bool> {
namespace PHPUnit\Framework\Constraint;
class IsFalse extends Constraint<bool> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsFinite
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsFinite extends Constraint<mixed> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsIdentical
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsIdentical extends Constraint<mixed> {
const float EPSILON = 0.0000000001;
public function __construct(protected mixed $value);
......
<?hh // decl
class PHPUnit_Framework_Constraint_IsInfinite
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsInfinite extends Constraint<mixed> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsInstanceOf<T>
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsInstanceOf<T> extends Constraint<mixed> {
public function __construct(protected classname<T> $className);
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsJson
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class IsJson extends Constraint<string> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsNan
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsNan extends Constraint<mixed> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsNull
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsNull extends Constraint<mixed> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsReadable
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class IsReadable extends Constraint<string> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsTrue
extends PHPUnit_Framework_Constraint<bool> {
namespace PHPUnit\Framework\Constraint;
class IsTrue extends Constraint<bool> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsType
extends PHPUnit_Framework_Constraint<mixed> {
namespace PHPUnit\Framework\Constraint;
class IsType extends Constraint<mixed> {
const string TYPE_ARRAY = 'array';
const string TYPE_BOOL = 'bool';
const string TYPE_FLOAT = 'float';
......@@ -14,6 +15,8 @@ class PHPUnit_Framework_Constraint_IsType
const string TYPE_SCALAR = 'scalar';
const string TYPE_CALLABLE = 'callable';
protected array<string, bool> $types = [];
public function __construct(protected string $type);
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_IsWritable
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class IsWritable extends Constraint<string> {
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_JsonMatches
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class JsonMatches extends Constraint<string> {
public function __construct(protected string $value);
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider {
namespace PHPUnit\Framework\Constraint;
class JsonMatchesErrorMessageProvider {
public static function determineJsonError(
int $error,
string $prefix = '',
......
<?hh // decl
class PHPUnit_Framework_Constraint_LessThan
extends PHPUnit_Framework_Constraint<num> {
namespace PHPUnit\Framework\Constraint;
class LessThan extends Constraint<num> {
public function __construct(protected num $value);
public function toString(): string;
}
<?hh // decl
namespace PHPUnit\Framework\Constraint;
class LogicalAnd<T> extends Constraint<T> {
protected ?Constraint<T> $lastConstraint;
public function setConstraints(array<Constraint<T>> $constraints): void;
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_Not<T>
extends PHPUnit_Framework_Constraint<T> {
public function __construct(
protected PHPUnit_Framework_Constraint<T> $constraint,
);
namespace PHPUnit\Framework\Constraint;
class LogicalNot<T> extends Constraint<T> {
public function __construct(protected Constraint<T> $constraint);
public static function negate(string $string): string;
public function toString(): string;
......
<?hh // decl
namespace PHPUnit\Framework\Constraint;
class LogicalOr<T> extends Constraint<T> {
protected array<Constraint<T>> $constraints = [];
public function setConstraints(array<Constraint<T>> $constraints): void;
public function toString(): string;
}
<?hh // decl
namespace PHPUnit\Framework\Constraint;
class LogicalXor<T> extends Constraint<T> {
protected array<Constraint<T>> $constraints = [];
public function setConstraints(array<Constraint<T>> $constraints): void;
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_ObjectHasAttribute<T>
extends PHPUnit_Framework_Constraint_ClassHasAttribute<T> {}
namespace PHPUnit\Framework\Constraint;
class ObjectHasAttribute<T> extends ClassHasAttribute<T> {}
<?hh // decl
class PHPUnit_Framework_Constraint_Or<T>
extends PHPUnit_Framework_Constraint<T> {
protected array<PHPUnit_Framework_Constraint<T>> $constraints = [];
public function setConstraints(
array<PHPUnit_Framework_Constraint<T>> $constraints,
): void;
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_PCREMatch
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class RegularExpression extends Constraint<string> {
public function __construct(protected string $pattern);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_SameSize<T>
extends PHPUnit_Framework_Constraint_Count<T> {
namespace PHPUnit\Framework\Constraint;
class SameSize<T> extends Count<T> {
public function __construct($expected);
}
<?hh // decl
class PHPUnit_Framework_Constraint_StringContains
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class StringContains extends Constraint<string> {
public function __construct(
protected string $string,
protected bool $ignoreCase = false,
......
<?hh // decl
class PHPUnit_Framework_Constraint_StringEndsWith
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class StringEndsWith extends Constraint<string> {
public function __construct(protected string $suffix);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_StringMatches
extends PHPUnit_Framework_Constraint_PCREMatch {
namespace PHPUnit\Framework\Constraint;
class StringMatchesFormatDescription extends RegularExpression {
public function __construct(protected string $string);
protected function createPatternFromFormat(string $string): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_StringStartsWith
extends PHPUnit_Framework_Constraint<string> {
namespace PHPUnit\Framework\Constraint;
class StringStartsWith extends Constraint<string> {
public function __construct(protected string $prefix);
public function toString(): string;
......
<?hh // decl
class PHPUnit_Framework_Constraint_TraversableContains<T>
extends PHPUnit_Framework_Constraint<Traversable<T>> {
namespace PHPUnit\Framework\Constraint;
class TraversableContains<T> extends Constraint<Traversable<T>> {
public function __construct(
protected mixed $value,
protected bool $checkForObjectIdentity = true,
......
<?hh // decl
class PHPUnit_Framework_Constraint_TraversableContainsOnly<T>
extends PHPUnit_Framework_Constraint<Traversable<T>> {
namespace PHPUnit\Framework\Constraint;
class TraversableContainsOnly<T> extends Constraint<Traversable<T>> {
public function __construct(
protected string $type,
protected bool $isNativeType = true,
);
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_Constraint_Xor<T>
extends PHPUnit_Framework_Constraint<T> {
protected array<PHPUnit_Framework_Constraint<T>> $constraints = [];
public function setConstraints(
array<PHPUnit_Framework_Constraint<T>> $constraints,
): void;
public function toString(): string;
}
<?hh // decl
class PHPUnit_Framework_CoveredCodeNotExecutedException
extends PHPUnit_Framework_RiskyTestError {}
namespace PHPUnit\Framework;
class CoveredCodeNotExecutedException extends RiskyTestError {}
<?hh // decl
class PHPUnit_Framework_Error_Deprecated extends PHPUnit_Framework_Error {
namespace PHPUnit\Framework\Error;
class Deprecated extends Error {
public static bool $enabled = true;
}
<?hh // decl
class PHPUnit_Framework_Error extends PHPUnit_Framework_Exception {
namespace PHPUnit\Framework\Error;
class Error extends \PHPUnit\Framework\Exception {
public function __construct(
string $message,
int $code,
public string $file,
public int $line,
?Exception $previous = null,
?\Exception $previous = null,
);
}
<?hh // decl
class PHPUnit_Framework_Error_Notice extends PHPUnit_Framework_Error {
namespace PHPUnit\Framework\Error;
class Notice extends Error {
public static bool $enabled = true;
}
<?hh // decl
class PHPUnit_Framework_Error_Warning extends PHPUnit_Framework_Error {
namespace PHPUnit\Framework\Error;
class Warning extends Error {
public static bool $enabled = true;
}
<?hh // decl
class PHPUnit_Framework_Exception extends RuntimeException
implements PHPUnit_Exception {
namespace PHPUnit\Framework;
class Exception extends \RuntimeException implements \PHPUnit\Exception {
protected array<shape(
'function' => string,
'line' => ?int,
......@@ -14,7 +15,7 @@ class PHPUnit_Framework_Exception extends RuntimeException
public function __construct(
string $message,
int $code = 0,
?Exception $previous = null,
?\Exception $previous = null,
);
public function getSerializableTrace(
......
<?hh // decl
class PHPUnit_Framework_ExceptionWrapper extends PHPUnit_Framework_Exception {
protected classname<Exception> $classname;
namespace PHPUnit\Framework;
public function __construct(Exception $e);
class ExceptionWrapper extends Exception {
protected classname<\Exception> $className;
public function getClassname(): classname<Exception>;
public function getPreviousWrapper(): ?PHPUnit_Framework_ExceptionWrapper;
public function __construct(\Exception $e);
public function getClassName(): classname<\Exception>;
public function getPreviousWrapper(): ?ExceptionWrapper;
public function __toString(): string;
}
<?hh // decl
class PHPUnit_Framework_ExpectationFailedException
extends PHPUnit_Framework_AssertionFailedError {
namespace PHPUnit\Framework;
class ExpectationFailedException extends AssertionFailedError {
public function __construct(
string $Message,
string $message,
protected /*?SebastianBergmann\Comparator\ComparisonFailure */ $comparisonFailure = null,
?Exception $previous = null,
?\Exception $previous = null,
);
public function getComparisionFailure(
) /* :?SebastianBergmann\Comparator\ComparisonFailure */;
......
<?hh // decl
interface PHPUnit_Framework_IncompleteTest {}
namespace PHPUnit\Framework;
interface IncompleteTest {}
<?hh // decl
class PHPUnit_Framework_IncompleteTestCase
extends PHPUnit_Framework_TestCase {
namespace PHPUnit\Framework;
class IncompleteTestCase extends TestCase {
protected bool $useErrorHandler = false;
protected bool $useOutputBuffering = false;
......@@ -10,4 +11,6 @@ class PHPUnit_Framework_IncompleteTestCase
string $methodName,
protected string $message,
);
public function getMessage(): string;
}
<?hh // decl
class PHPUnit_Framework_IncompleteTestError
extends PHPUnit_Framework_AssertionFailedError
implements PHPUnit_Framework_IncompleteTest {}
namespace PHPUnit\Framework;
class IncompleteTestError extends AssertionFailedError
implements IncompleteTest {}
<?hh // decl
class PHPUnit_Framework_InvalidCoversTargetException
extends PHPUnit_Framework_CodeCoverageException {}
namespace PHPUnit\Framework;
class InvalidCoversTargetException extends CodeCoverageException {}
<?hh // decl
class PHPUnit_Framework_MissingCoversAnnotationException
extends PHPUnit_Framework_RiskyTestError {}
namespace PHPUnit\Framework;
class MissingCoversAnnotationException extends RiskyTestError {}
<?hh // decl
class PHPUnit_Framework_OutputError
extends PHPUnit_Framework_AssertionFailedError {}
namespace PHPUnit\Framework;
class OutputError extends AssertionFailedError {}
<?hh // decl
interface PHPUnit_Framework_RiskyTest {}
namespace PHPUnit\Framework;
interface RiskyTest {}
<?hh // decl
class PHPUnit_Framework_RiskyTestError
extends PHPUnit_Framework_AssertionFailedError
implements PHPUnit_Framework_RiskyTest {}
namespace PHPUnit\Framework;
class RiskyTestError extends AssertionFailedError implements RiskyTest {}
<?hh // decl
interface PHPUnit_Framework_SelfDescribing {
namespace PHPUnit\Framework;
interface SelfDescribing {
public function toString(): string;
}
<?hh // decl
interface PHPUnit_Framework_SkippedTest {}
namespace PHPUnit\Framework;
interface SkippedTest {}
<?hh // decl
class PHPUnit_Framework_SkippedTestCase extends PHPUnit_Framework_TestCase {
namespace PHPUnit\Framework;
class SkippedTestCase extends TestCase {
protected bool $useErrorHandler = false;
protected bool $useOutputBuffering = false;
public function __construct(protected string $message);
public function __construct(
string $className,
string $methodName,
protected string $message = '',
);
public function getMessage(): string;
}
<?hh // decl
class PHPUnit_Framework_SkippedTestError
extends PHPUnit_Framework_AssertionFailedError
implements PHPUnit_Framework_SkippedTest {}
namespace PHPUnit\Framework;
class SkippedTestError extends AssertionFailedError implements SkippedTest {}
<?hh // decl
class PHPUnit_Framework_SkippedTestSuiteError
extends PHPUnit_Framework_AssertionFailedError
implements PHPUnit_Framework_SkippedTest {}
namespace PHPUnit\Framework;
class SkippedTestSuiteError extends AssertionFailedError
implements SkippedTest {}
<?hh // decl
class PHPUnit_Framework_SyntheticError
extends PHPUnit_Framework_AssertionFailedError {
namespace PHPUnit\Framework;
class SyntheticError extends AssertionFailedError {
public function __construct(
string $Message,
string $message,
int $code,
protected string $file,
protected int $line,
protected array $trace,
protected string $syntheticFile,
protected int $syntheticLine,
protected array $syntheticTrace,
);
public function getSyntheticFile(): string;
public function getSyntheticLine(): int;
......
<?hh // decl
interface PHPUnit_Framework_Test extends Countable {
public function run(
?PHPUnit_Framework_TestResult $result = null,
): PHPUnit_Framework_TestResult;
namespace PHPUnit\Framework;
interface Test extends \Countable {
public function run(?TestResult $result = null): TestResult;
}
This diff is collapsed.
<?hh // decl
class PHPUnit_Framework_TestFailure {
protected ?PHPUnit_Framework_Test $failedTest;
protected Exception $thrownException;
namespace PHPUnit\Framework;
public function __construct(
PHPUnit_Framework_Test $failedTest,
Exception $thrownException,
);
class TestFailure {
protected ?Test $failedTest;
protected \Exception $thrownException;
public function __construct(Test $failedTest, \Exception $thrownException);
public function toString(): string;
public function getExceptionAsString(): string;
public static function exceptionToString(Exception $e): string;
public static function exceptionToString(\Exception $e): string;
public function getTestName(): string;
public function failedTest(): ?PHPUnit_Framework_Test;
public function failedTest(): ?Test;
public function thrownException(): Exception;
public function exceptionMessage(): string;
public function isFailure(): bool;
......
<?hh // decl
namespace PHPUnit\Framework;
// Due to the way interfaces get checked at run time, this needs to match the
// actual implementation, so no bonus types :(
interface PHPUnit_Framework_TestListener {
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time);
public function addFailure(
PHPUnit_Framework_Test $test,
PHPUnit_Framework_AssertionFailedError $e,
$time,
);
public function addIncompleteTest(
PHPUnit_Framework_Test $test,
Exception $e,
$time,
);
public function addRiskyTest(
PHPUnit_Framework_Test $test,
Exception $e,
$time,
);
public function addSkippedTest(
PHPUnit_Framework_Test $test,
Exception $e,
$time,
);
public function startTestSuite(PHPUnit_Framework_TestSuite $suite);
public function endTestSuite(PHPUnit_Framework_TestSuite $suite);
public function startTest(PHPUnit_Framework_Test $test);
public function endTest(PHPUnit_Framework_Test $test, $time);
interface TestListener {
public function addError(Test $test, \Exception $e, $time);
public function addWarning(Test $test, Warning $e, $time);
public function addFailure(Test $test, AssertionFailedError $e, $time);
public function addIncompleteTest(Test $test, \Exception $e, $time);
public function addRiskyTest(Test $test, \Exception $e, $time);
public function addSkippedTest(Test $test, \Exception $e, $time);
public function startTestSuite(TestSuite $suite);
public function endTestSuite(TestSuite $suite);
public function startTest(Test $test);
public function endTest(Test $test, $time);
}
<?hh // decl
class PHPUnit_Framework_TestResult implements Countable {
namespace PHPUnit\Framework;
class TestResult implements \Countable {
protected array<string,
shape(
'result' => PHPUnit_Framework_TestResult,
'result' => TestResult,
'size' => int,
)> $passed = [];
protected array<PHPUnit_Framework_TestFailure> $error = [];
protected array<PHPUnit_Framework_TestFailure> $failures = [];
protected array<PHPUnit_Framework_TestFailure> $warnings = [];
protected array<PHPUnit_Framework_TestFailure> $notImplemented = [];
protected array<PHPUnit_Framework_TestFailure> $risky = [];
protected array<PHPUnit_Framework_TestFailure> $skipped = [];
protected array<PHPUnit_Framework_TestListener> $listeners = [];
protected array<TestFailure> $error = [];
protected array<TestFailure> $failures = [];
protected array<TestFailure> $warnings = [];
protected array<TestFailure> $notImplemented = [];
protected array<TestFailure> $risky = [];
protected array<TestFailure> $skipped = [];
protected array<TestListener> $listeners = [];
protected int $runTests = 0;
protected float $time = 0.0;
protected ?PHPUnit_Framework_TestSuite $topTestSuite;
protected ?TestSuite $topTestSuite;