From df5252497e4b5fd537a2258c70b969caa6e770bf Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Fri, 21 Sep 2018 08:43:09 -0400 Subject: [PATCH] Closes #3310 --- ChangeLog-7.3.md | 7 + src/Framework/Assert/Functions.php | 229 +++++++++++++---------------- 2 files changed, 112 insertions(+), 124 deletions(-) diff --git a/ChangeLog-7.3.md b/ChangeLog-7.3.md index c69dc1cc031..58bdac7d3eb 100644 --- a/ChangeLog-7.3.md +++ b/ChangeLog-7.3.md @@ -2,6 +2,12 @@ All notable changes of the PHPUnit 7.3 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [7.3.6] - 2018-MM-DD + +### Fixed + +* Fixed [#3310](https://github.com/sebastianbergmann/phpunit/issues/3310): Inconsistent `@throws` annotations in `Assert/Functions.php` + ## [7.3.5] - 2018-09-08 ### Fixed @@ -66,6 +72,7 @@ All notable changes of the PHPUnit 7.3 release series are documented in this fil * Fixed [#3222](https://github.com/sebastianbergmann/phpunit/pull/3222): Priority of `@covers` and `@coversNothing` is wrong * Fixed [#3225](https://github.com/sebastianbergmann/phpunit/issues/3225): `coverage-php` missing from `phpunit.xsd` +[7.3.6]: https://github.com/sebastianbergmann/phpunit/compare/7.3.5...7.3.6 [7.3.5]: https://github.com/sebastianbergmann/phpunit/compare/7.3.4...7.3.5 [7.3.4]: https://github.com/sebastianbergmann/phpunit/compare/7.3.3...7.3.4 [7.3.3]: https://github.com/sebastianbergmann/phpunit/compare/7.3.2...7.3.3 diff --git a/src/Framework/Assert/Functions.php b/src/Framework/Assert/Functions.php index f9cd235a2c2..210c0e2e0df 100644 --- a/src/Framework/Assert/Functions.php +++ b/src/Framework/Assert/Functions.php @@ -68,7 +68,8 @@ * @param int|string $key * @param array|ArrayAccess $array * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertArrayHasKey($key, $array, string $message = ''): void { @@ -80,11 +81,11 @@ function assertArrayHasKey($key, $array, string $message = ''): void * * @param array|ArrayAccess $subset * @param array|ArrayAccess $array - * @param bool $strict Check for object identity * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ -function assertArraySubset($subset, $array, bool $strict = false, string $message = ''): void +function assertArraySubset($subset, $array, bool $checkForObjectIdentity = false, string $message = ''): void { Assert::assertArraySubset(...\func_get_args()); } @@ -95,7 +96,8 @@ function assertArraySubset($subset, $array, bool $strict = false, string $messag * @param int|string $key * @param array|ArrayAccess $array * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertArrayNotHasKey($key, $array, string $message = ''): void { @@ -105,9 +107,7 @@ function assertArrayNotHasKey($key, $array, string $message = ''): void /** * Asserts that a haystack contains a needle. * - * @throws Exception * @throws ExpectationFailedException - * @throws \PHPUnit\Framework\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertContains($needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void @@ -121,7 +121,8 @@ function assertContains($needle, $haystack, string $message = '', bool $ignoreCa * * @param object|string $haystackClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeContains($needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void { @@ -131,9 +132,7 @@ function assertAttributeContains($needle, string $haystackAttributeName, $haysta /** * Asserts that a haystack does not contain a needle. * - * @throws Exception * @throws ExpectationFailedException - * @throws \PHPUnit\Framework\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertNotContains($needle, $haystack, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void @@ -147,7 +146,8 @@ function assertNotContains($needle, $haystack, string $message = '', bool $ignor * * @param object|string $haystackClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotContains($needle, string $haystackAttributeName, $haystackClassOrObject, string $message = '', bool $ignoreCase = false, bool $checkForObjectIdentity = true, bool $checkForNonObjectIdentity = false): void { @@ -157,7 +157,6 @@ function assertAttributeNotContains($needle, string $haystackAttributeName, $hay /** * Asserts that a haystack contains only values of a given type. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -169,7 +168,6 @@ function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeTyp /** * Asserts that a haystack contains only instances of a given class name. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -185,7 +183,8 @@ function assertContainsOnlyInstancesOf(string $className, iterable $haystack, st * @param object|string $haystackClassOrObject * @param bool $isNativeType * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = null, string $message = ''): void { @@ -195,7 +194,6 @@ function assertAttributeContainsOnly(string $type, string $haystackAttributeName /** * Asserts that a haystack does not contain only values of a given type. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -212,7 +210,8 @@ function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNative * @param object|string $haystackClassOrObject * @param bool $isNativeType * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotContainsOnly(string $type, string $haystackAttributeName, $haystackClassOrObject, ?bool $isNativeType = null, string $message = ''): void { @@ -224,7 +223,8 @@ function assertAttributeNotContainsOnly(string $type, string $haystackAttributeN * * @param Countable|iterable $haystack * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertCount(int $expectedCount, $haystack, string $message = ''): void { @@ -237,7 +237,8 @@ function assertCount(int $expectedCount, $haystack, string $message = ''): void * * @param object|string $haystackClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void { @@ -249,7 +250,8 @@ function assertAttributeCount(int $expectedCount, string $haystackAttributeName, * * @param Countable|iterable $haystack * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertNotCount(int $expectedCount, $haystack, string $message = ''): void { @@ -262,7 +264,8 @@ function assertNotCount(int $expectedCount, $haystack, string $message = ''): vo * * @param object|string $haystackClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotCount(int $expectedCount, string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void { @@ -272,7 +275,6 @@ function assertAttributeNotCount(int $expectedCount, string $haystackAttributeNa /** * Asserts that two variables are equal. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -286,7 +288,8 @@ function assertEquals($expected, $actual, string $message = '', float $delta = 0 * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeEquals($expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void { @@ -301,7 +304,6 @@ function assertAttributeEquals($expected, string $actualAttributeName, $actualCl * @param bool $canonicalize * @param bool $ignoreCase * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -315,7 +317,8 @@ function assertNotEquals($expected, $actual, string $message = '', $delta = 0.0, * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotEquals($expected, string $actualAttributeName, $actualClassOrObject, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void { @@ -325,7 +328,6 @@ function assertAttributeNotEquals($expected, string $actualAttributeName, $actua /** * Asserts that a variable is empty. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -340,7 +342,8 @@ function assertEmpty($actual, string $message = ''): void * * @param object|string $haystackClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void { @@ -350,7 +353,6 @@ function assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObj /** * Asserts that a variable is not empty. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -365,7 +367,8 @@ function assertNotEmpty($actual, string $message = ''): void * * @param object|string $haystackClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotEmpty(string $haystackAttributeName, $haystackClassOrObject, string $message = ''): void { @@ -375,7 +378,6 @@ function assertAttributeNotEmpty(string $haystackAttributeName, $haystackClassOr /** * Asserts that a value is greater than another value. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -389,7 +391,8 @@ function assertGreaterThan($expected, $actual, string $message = ''): void * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeGreaterThan($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void { @@ -399,7 +402,6 @@ function assertAttributeGreaterThan($expected, string $actualAttributeName, $act /** * Asserts that a value is greater than or equal to another value. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -413,7 +415,8 @@ function assertGreaterThanOrEqual($expected, $actual, string $message = ''): voi * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeGreaterThanOrEqual($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void { @@ -423,7 +426,6 @@ function assertAttributeGreaterThanOrEqual($expected, string $actualAttributeNam /** * Asserts that a value is smaller than another value. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -437,7 +439,8 @@ function assertLessThan($expected, $actual, string $message = ''): void * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeLessThan($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void { @@ -447,7 +450,6 @@ function assertAttributeLessThan($expected, string $actualAttributeName, $actual /** * Asserts that a value is smaller than or equal to another value. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -461,7 +463,8 @@ function assertLessThanOrEqual($expected, $actual, string $message = ''): void * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeLessThanOrEqual($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void { @@ -472,7 +475,8 @@ function assertAttributeLessThanOrEqual($expected, string $actualAttributeName, * Asserts that the contents of one file is equal to the contents of another * file. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void { @@ -483,7 +487,8 @@ function assertFileEquals(string $expected, string $actual, string $message = '' * Asserts that the contents of one file is not equal to the contents of * another file. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void { @@ -494,7 +499,8 @@ function assertFileNotEquals(string $expected, string $actual, string $message = * Asserts that the contents of a string is equal * to the contents of a file. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void { @@ -505,7 +511,8 @@ function assertStringEqualsFile(string $expectedFile, string $actualString, stri * Asserts that the contents of a string is not equal * to the contents of a file. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void { @@ -515,7 +522,6 @@ function assertStringNotEqualsFile(string $expectedFile, string $actualString, s /** * Asserts that a file/dir is readable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -527,7 +533,6 @@ function assertIsReadable(string $filename, string $message = ''): void /** * Asserts that a file/dir exists and is not readable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -539,7 +544,6 @@ function assertNotIsReadable(string $filename, string $message = ''): void /** * Asserts that a file/dir exists and is writable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -551,7 +555,6 @@ function assertIsWritable(string $filename, string $message = ''): void /** * Asserts that a file/dir exists and is not writable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -563,7 +566,6 @@ function assertNotIsWritable(string $filename, string $message = ''): void /** * Asserts that a directory exists. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -575,7 +577,6 @@ function assertDirectoryExists(string $directory, string $message = ''): void /** * Asserts that a directory does not exist. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -587,7 +588,6 @@ function assertDirectoryNotExists(string $directory, string $message = ''): void /** * Asserts that a directory exists and is readable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -599,7 +599,6 @@ function assertDirectoryIsReadable(string $directory, string $message = ''): voi /** * Asserts that a directory exists and is not readable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -611,7 +610,6 @@ function assertDirectoryNotIsReadable(string $directory, string $message = ''): /** * Asserts that a directory exists and is writable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -623,7 +621,6 @@ function assertDirectoryIsWritable(string $directory, string $message = ''): voi /** * Asserts that a directory exists and is not writable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -635,7 +632,6 @@ function assertDirectoryNotIsWritable(string $directory, string $message = ''): /** * Asserts that a file exists. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -647,7 +643,6 @@ function assertFileExists(string $filename, string $message = ''): void /** * Asserts that a file does not exist. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -659,7 +654,6 @@ function assertFileNotExists(string $filename, string $message = ''): void /** * Asserts that a file exists and is readable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -671,7 +665,6 @@ function assertFileIsReadable(string $file, string $message = ''): void /** * Asserts that a file exists and is not readable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -683,7 +676,6 @@ function assertFileNotIsReadable(string $file, string $message = ''): void /** * Asserts that a file exists and is writable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -695,7 +687,6 @@ function assertFileIsWritable(string $file, string $message = ''): void /** * Asserts that a file exists and is not writable. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -707,7 +698,6 @@ function assertFileNotIsWritable(string $file, string $message = ''): void /** * Asserts that a condition is true. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -719,7 +709,6 @@ function assertTrue($condition, string $message = ''): void /** * Asserts that a condition is not true. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -731,7 +720,6 @@ function assertNotTrue($condition, string $message = ''): void /** * Asserts that a condition is false. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -743,7 +731,6 @@ function assertFalse($condition, string $message = ''): void /** * Asserts that a condition is not false. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -755,7 +742,6 @@ function assertNotFalse($condition, string $message = ''): void /** * Asserts that a variable is null. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -767,7 +753,6 @@ function assertNull($actual, string $message = ''): void /** * Asserts that a variable is not null. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -779,7 +764,6 @@ function assertNotNull($actual, string $message = ''): void /** * Asserts that a variable is finite. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -791,7 +775,6 @@ function assertFinite($actual, string $message = ''): void /** * Asserts that a variable is infinite. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -803,7 +786,6 @@ function assertInfinite($actual, string $message = ''): void /** * Asserts that a variable is nan. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -815,7 +797,8 @@ function assertNan($actual, string $message = ''): void /** * Asserts that a class has a specified attribute. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void { @@ -825,7 +808,8 @@ function assertClassHasAttribute(string $attributeName, string $className, strin /** * Asserts that a class does not have a specified attribute. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void { @@ -835,7 +819,8 @@ function assertClassNotHasAttribute(string $attributeName, string $className, st /** * Asserts that a class has a specified static attribute. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void { @@ -845,7 +830,8 @@ function assertClassHasStaticAttribute(string $attributeName, string $className, /** * Asserts that a class does not have a specified static attribute. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void { @@ -857,7 +843,8 @@ function assertClassNotHasStaticAttribute(string $attributeName, string $classNa * * @param object $object * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertObjectHasAttribute(string $attributeName, $object, string $message = ''): void { @@ -869,7 +856,8 @@ function assertObjectHasAttribute(string $attributeName, $object, string $messag * * @param object $object * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertObjectNotHasAttribute(string $attributeName, $object, string $message = ''): void { @@ -881,7 +869,6 @@ function assertObjectNotHasAttribute(string $attributeName, $object, string $mes * Used on objects, it asserts that two variables reference * the same object. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -896,7 +883,8 @@ function assertSame($expected, $actual, string $message = ''): void * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeSame($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void { @@ -908,7 +896,6 @@ function assertAttributeSame($expected, string $actualAttributeName, $actualClas * Used on objects, it asserts that two variables do not reference * the same object. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -923,7 +910,8 @@ function assertNotSame($expected, $actual, string $message = ''): void * * @param object|string $actualClassOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotSame($expected, string $actualAttributeName, $actualClassOrObject, string $message = ''): void { @@ -933,7 +921,8 @@ function assertAttributeNotSame($expected, string $actualAttributeName, $actualC /** * Asserts that a variable is of a given type. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertInstanceOf(string $expected, $actual, string $message = ''): void { @@ -945,7 +934,8 @@ function assertInstanceOf(string $expected, $actual, string $message = ''): void * * @param object|string $classOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void { @@ -955,7 +945,8 @@ function assertAttributeInstanceOf(string $expected, string $attributeName, $cla /** * Asserts that a variable is not of a given type. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertNotInstanceOf(string $expected, $actual, string $message = ''): void { @@ -967,7 +958,8 @@ function assertNotInstanceOf(string $expected, $actual, string $message = ''): v * * @param object|string $classOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void { @@ -977,7 +969,6 @@ function assertAttributeNotInstanceOf(string $expected, string $attributeName, $ /** * Asserts that a variable is of a given type. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -991,7 +982,8 @@ function assertInternalType(string $expected, $actual, string $message = ''): vo * * @param object|string $classOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeInternalType(string $expected, string $attributeName, $classOrObject, string $message = ''): void { @@ -1001,7 +993,6 @@ function assertAttributeInternalType(string $expected, string $attributeName, $c /** * Asserts that a variable is not of a given type. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1015,7 +1006,8 @@ function assertNotInternalType(string $expected, $actual, string $message = ''): * * @param object|string $classOrObject * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertAttributeNotInternalType(string $expected, string $attributeName, $classOrObject, string $message = ''): void { @@ -1025,7 +1017,6 @@ function assertAttributeNotInternalType(string $expected, string $attributeName, /** * Asserts that a string matches a given regular expression. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1037,7 +1028,6 @@ function assertRegExp(string $pattern, string $string, string $message = ''): vo /** * Asserts that a string does not match a given regular expression. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1053,7 +1043,8 @@ function assertNotRegExp(string $pattern, string $string, string $message = ''): * @param Countable|iterable $expected * @param Countable|iterable $actual * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertSameSize($expected, $actual, string $message = ''): void { @@ -1067,7 +1058,8 @@ function assertSameSize($expected, $actual, string $message = ''): void * @param Countable|iterable $expected * @param Countable|iterable $actual * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertNotSameSize($expected, $actual, string $message = ''): void { @@ -1077,7 +1069,6 @@ function assertNotSameSize($expected, $actual, string $message = ''): void /** * Asserts that a string matches a given format string. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1089,7 +1080,6 @@ function assertStringMatchesFormat(string $format, string $string, string $messa /** * Asserts that a string does not match a given format string. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1101,7 +1091,6 @@ function assertStringNotMatchesFormat(string $format, string $string, string $me /** * Asserts that a string matches a given format file. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1113,7 +1102,6 @@ function assertStringMatchesFormatFile(string $formatFile, string $string, strin /** * Asserts that a string does not match a given format string. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1125,7 +1113,6 @@ function assertStringNotMatchesFormatFile(string $formatFile, string $string, st /** * Asserts that a string starts with a given prefix. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1140,7 +1127,6 @@ function assertStringStartsWith(string $prefix, string $string, string $message * @param string $prefix * @param string $string * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1152,7 +1138,6 @@ function assertStringStartsNotWith($prefix, $string, string $message = ''): void /** * Asserts that a string ends with a given suffix. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1164,7 +1149,6 @@ function assertStringEndsWith(string $suffix, string $string, string $message = /** * Asserts that a string ends not with a given suffix. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1176,7 +1160,8 @@ function assertStringEndsNotWith(string $suffix, string $string, string $message /** * Asserts that two XML files are equal. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void { @@ -1186,7 +1171,8 @@ function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, st /** * Asserts that two XML files are not equal. * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void { @@ -1198,7 +1184,8 @@ function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, * * @param DOMDocument|string $actualXml * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void { @@ -1210,7 +1197,8 @@ function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $ * * @param DOMDocument|string $actualXml * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, string $message = ''): void { @@ -1223,7 +1211,8 @@ function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, strin * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $message = ''): void { @@ -1236,7 +1225,8 @@ function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $messag * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml * - * @throws Exception + * @throws ExpectationFailedException + * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $message = ''): void { @@ -1246,9 +1236,8 @@ function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $mes /** * Asserts that a hierarchy of DOMElements matches. * - * @throws Exception + * @throws AssertionFailedError * @throws ExpectationFailedException - * @throws \PHPUnit\Framework\AssertionFailedError * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actualElement, bool $checkAttributes = false, string $message = ''): void @@ -1259,7 +1248,6 @@ function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actual /** * Evaluates a PHPUnit\Framework\Constraint matcher object. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1271,7 +1259,6 @@ function assertThat($value, Constraint $constraint, string $message = ''): void /** * Asserts that a string is a valid JSON string. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1283,7 +1270,6 @@ function assertJson(string $actualJson, string $message = ''): void /** * Asserts that two given JSON encoded objects or arrays are equal. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1298,7 +1284,6 @@ function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJs * @param string $expectedJson * @param string $actualJson * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1310,7 +1295,6 @@ function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string /** * Asserts that the generated JSON encoded object and the content of the given file are equal. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1322,7 +1306,6 @@ function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson /** * Asserts that the generated JSON encoded object and the content of the given file are not equal. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1334,7 +1317,6 @@ function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJ /** * Asserts that two JSON files are equal. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1346,7 +1328,6 @@ function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, /** * Asserts that two JSON files are not equal. * - * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1377,12 +1358,12 @@ function logicalXor(): LogicalXor function anything(): IsAnything { - return Assert::anything(); + return Assert::anything(...\func_get_args()); } function isTrue(): IsTrue { - return Assert::isTrue(); + return Assert::isTrue(...\func_get_args()); } function callback(callable $callback): Callback @@ -1392,32 +1373,32 @@ function callback(callable $callback): Callback function isFalse(): IsFalse { - return Assert::isFalse(); + return Assert::isFalse(...\func_get_args()); } function isJson(): IsJson { - return Assert::isJson(); + return Assert::isJson(...\func_get_args()); } function isNull(): IsNull { - return Assert::isNull(); + return Assert::isNull(...\func_get_args()); } function isFinite(): IsFinite { - return Assert::isFinite(); + return Assert::isFinite(...\func_get_args()); } function isInfinite(): IsInfinite { - return Assert::isInfinite(); + return Assert::isInfinite(...\func_get_args()); } function isNan(): IsNan { - return Assert::isNan(); + return Assert::isNan(...\func_get_args()); } function attribute(Constraint $constraint, string $attributeName): Attribute @@ -1457,27 +1438,27 @@ function attributeEqualTo(string $attributeName, $value, float $delta = 0.0, int function isEmpty(): IsEmpty { - return Assert::isEmpty(); + return Assert::isEmpty(...\func_get_args()); } function isWritable(): IsWritable { - return Assert::isWritable(); + return Assert::isWritable(...\func_get_args()); } function isReadable(): IsReadable { - return Assert::isReadable(); + return Assert::isReadable(...\func_get_args()); } function directoryExists(): DirectoryExists { - return Assert::directoryExists(); + return Assert::directoryExists(...\func_get_args()); } function fileExists(): FileExists { - return Assert::fileExists(); + return Assert::fileExists(...\func_get_args()); } function greaterThan($value): GreaterThan