Skip to content

Commit

Permalink
Merge branch '8.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jul 3, 2019
2 parents 6c818cd + c754e04 commit 26c1674
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions src/Framework/Assert/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ function assertAttributeNotEquals($expected, string $actualAttributeName, $actua
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert empty $actual
*
* @see Assert::assertEmpty
*/
function assertEmpty($actual, string $message = ''): void
Expand Down Expand Up @@ -534,6 +536,8 @@ function assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObj
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !empty $actual
*
* @see Assert::assertNotEmpty
*/
function assertNotEmpty($actual, string $message = ''): void
Expand Down Expand Up @@ -959,6 +963,8 @@ function assertFileNotIsWritable(string $file, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert true $condition
*
* @see Assert::assertTrue
*/
function assertTrue($condition, string $message = ''): void
Expand All @@ -972,6 +978,8 @@ function assertTrue($condition, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !true $condition
*
* @see Assert::assertNotTrue
*/
function assertNotTrue($condition, string $message = ''): void
Expand All @@ -985,6 +993,8 @@ function assertNotTrue($condition, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert false $condition
*
* @see Assert::assertFalse
*/
function assertFalse($condition, string $message = ''): void
Expand All @@ -998,6 +1008,8 @@ function assertFalse($condition, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !false $condition
*
* @see Assert::assertNotFalse
*/
function assertNotFalse($condition, string $message = ''): void
Expand All @@ -1011,6 +1023,8 @@ function assertNotFalse($condition, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert null $actual
*
* @see Assert::assertNull
*/
function assertNull($actual, string $message = ''): void
Expand All @@ -1024,6 +1038,8 @@ function assertNull($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !null $actual
*
* @see Assert::assertNotNull
*/
function assertNotNull($actual, string $message = ''): void
Expand Down Expand Up @@ -1166,6 +1182,10 @@ function assertObjectNotHasAttribute(string $attributeName, $object, string $mes
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-template ExpectedType
* @psalm-param ExpectedType $expected
* @psalm-assert =ExpectedType $actual
*
* @see Assert::assertSame
*/
function assertSame($expected, $actual, string $message = ''): void
Expand Down Expand Up @@ -1235,6 +1255,10 @@ function assertAttributeNotSame($expected, string $actualAttributeName, $actualC
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws Exception
*
* @psalm-template ExpectedType of object
* @psalm-param class-string<ExpectedType> $expected
* @psalm-assert ExpectedType $actual
*
* @see Assert::assertInstanceOf
*/
function assertInstanceOf(string $expected, $actual, string $message = ''): void
Expand All @@ -1254,6 +1278,8 @@ function assertInstanceOf(string $expected, $actual, string $message = ''): void
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
* @codeCoverageIgnore
*
* @psalm-param class-string $expected
*
* @see Assert::assertAttributeInstanceOf
*/
function assertAttributeInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void
Expand All @@ -1268,6 +1294,10 @@ function assertAttributeInstanceOf(string $expected, string $attributeName, $cla
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws Exception
*
* @psalm-template ExpectedType of object
* @psalm-param class-string<ExpectedType> $expected
* @psalm-assert !ExpectedType $actual
*
* @see Assert::assertNotInstanceOf
*/
function assertNotInstanceOf(string $expected, $actual, string $message = ''): void
Expand All @@ -1287,6 +1317,8 @@ function assertNotInstanceOf(string $expected, $actual, string $message = ''): v
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/3338
* @codeCoverageIgnore
*
* @psalm-param class-string $expected
*
* @see Assert::assertAttributeNotInstanceOf
*/
function assertAttributeNotInstanceOf(string $expected, string $attributeName, $classOrObject, string $message = ''): void
Expand Down Expand Up @@ -1335,6 +1367,8 @@ function assertAttributeInternalType(string $expected, string $attributeName, $c
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert array $actual
*
* @see Assert::assertIsArray
*/
function assertIsArray($actual, string $message = ''): void
Expand All @@ -1348,6 +1382,8 @@ function assertIsArray($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert bool $actual
*
* @see Assert::assertIsBool
*/
function assertIsBool($actual, string $message = ''): void
Expand All @@ -1361,6 +1397,8 @@ function assertIsBool($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert float $actual
*
* @see Assert::assertIsFloat
*/
function assertIsFloat($actual, string $message = ''): void
Expand All @@ -1374,6 +1412,8 @@ function assertIsFloat($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert int $actual
*
* @see Assert::assertIsInt
*/
function assertIsInt($actual, string $message = ''): void
Expand All @@ -1387,6 +1427,8 @@ function assertIsInt($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert numeric $actual
*
* @see Assert::assertIsNumeric
*/
function assertIsNumeric($actual, string $message = ''): void
Expand All @@ -1400,6 +1442,8 @@ function assertIsNumeric($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert object $actual
*
* @see Assert::assertIsObject
*/
function assertIsObject($actual, string $message = ''): void
Expand All @@ -1413,6 +1457,8 @@ function assertIsObject($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert resource $actual
*
* @see Assert::assertIsResource
*/
function assertIsResource($actual, string $message = ''): void
Expand All @@ -1426,6 +1472,8 @@ function assertIsResource($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert string $actual
*
* @see Assert::assertIsString
*/
function assertIsString($actual, string $message = ''): void
Expand All @@ -1439,6 +1487,8 @@ function assertIsString($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert scalar $actual
*
* @see Assert::assertIsScalar
*/
function assertIsScalar($actual, string $message = ''): void
Expand All @@ -1452,6 +1502,8 @@ function assertIsScalar($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert callable $actual
*
* @see Assert::assertIsCallable
*/
function assertIsCallable($actual, string $message = ''): void
Expand All @@ -1465,6 +1517,8 @@ function assertIsCallable($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert iterable $actual
*
* @see Assert::assertIsIterable
*/
function assertIsIterable($actual, string $message = ''): void
Expand Down Expand Up @@ -1494,6 +1548,8 @@ function assertNotInternalType(string $expected, $actual, string $message = ''):
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !array $actual
*
* @see Assert::assertIsNotArray
*/
function assertIsNotArray($actual, string $message = ''): void
Expand All @@ -1507,6 +1563,8 @@ function assertIsNotArray($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !bool $actual
*
* @see Assert::assertIsNotBool
*/
function assertIsNotBool($actual, string $message = ''): void
Expand All @@ -1520,6 +1578,8 @@ function assertIsNotBool($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !float $actual
*
* @see Assert::assertIsNotFloat
*/
function assertIsNotFloat($actual, string $message = ''): void
Expand All @@ -1533,6 +1593,8 @@ function assertIsNotFloat($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !int $actual
*
* @see Assert::assertIsNotInt
*/
function assertIsNotInt($actual, string $message = ''): void
Expand All @@ -1546,6 +1608,8 @@ function assertIsNotInt($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !numeric $actual
*
* @see Assert::assertIsNotNumeric
*/
function assertIsNotNumeric($actual, string $message = ''): void
Expand All @@ -1559,6 +1623,8 @@ function assertIsNotNumeric($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !object $actual
*
* @see Assert::assertIsNotObject
*/
function assertIsNotObject($actual, string $message = ''): void
Expand All @@ -1572,6 +1638,8 @@ function assertIsNotObject($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !resource $actual
*
* @see Assert::assertIsNotResource
*/
function assertIsNotResource($actual, string $message = ''): void
Expand All @@ -1585,6 +1653,8 @@ function assertIsNotResource($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !string $actual
*
* @see Assert::assertIsNotString
*/
function assertIsNotString($actual, string $message = ''): void
Expand All @@ -1598,6 +1668,8 @@ function assertIsNotString($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !scalar $actual
*
* @see Assert::assertIsNotScalar
*/
function assertIsNotScalar($actual, string $message = ''): void
Expand All @@ -1611,6 +1683,8 @@ function assertIsNotScalar($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !callable $actual
*
* @see Assert::assertIsNotCallable
*/
function assertIsNotCallable($actual, string $message = ''): void
Expand All @@ -1624,6 +1698,8 @@ function assertIsNotCallable($actual, string $message = ''): void
* @throws ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
*
* @psalm-assert !iterable $actual
*
* @see Assert::assertIsNotIterable
*/
function assertIsNotIterable($actual, string $message = ''): void
Expand Down

0 comments on commit 26c1674

Please sign in to comment.