From bcb4c788c7872cd2f885ccf50285f6feb7cfff1a Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Sun, 10 Jun 2018 14:04:06 +0200 Subject: [PATCH] Fix CS/WS issues --- src/Exception.php | 1 - src/Framework/Assert.php | 395 +----------------- src/Framework/Assert/Functions.php | 390 +---------------- src/Framework/AssertionFailedError.php | 1 - src/Framework/CodeCoverageException.php | 1 - src/Framework/Constraint/ArraySubset.php | 12 +- src/Framework/Constraint/Attribute.php | 2 - src/Framework/Constraint/Composite.php | 2 - src/Framework/Constraint/Constraint.php | 3 - src/Framework/Constraint/Count.php | 2 - src/Framework/Constraint/IsAnything.php | 2 - src/Framework/Constraint/IsEqual.php | 2 - src/Framework/Constraint/IsIdentical.php | 5 - src/Framework/Constraint/IsType.php | 11 + .../JsonMatchesErrorMessageProvider.php | 13 +- src/Framework/Constraint/LogicalAnd.php | 2 - src/Framework/Constraint/LogicalNot.php | 2 - src/Framework/Constraint/LogicalOr.php | 2 - src/Framework/Constraint/LogicalXor.php | 2 - .../StringMatchesFormatDescription.php | 5 +- .../Constraint/TraversableContains.php | 2 - .../Constraint/TraversableContainsOnly.php | 2 - .../CoveredCodeNotExecutedException.php | 1 - src/Framework/Error/Error.php | 1 - src/Framework/ExceptionWrapper.php | 6 - src/Framework/IncompleteTest.php | 1 - .../MissingCoversAnnotationException.php | 1 - .../MockObject/Builder/InvocationMocker.php | 22 - src/Framework/MockObject/Builder/Stub.php | 2 - .../ForwardCompatibility/MockObject.php | 1 - src/Framework/MockObject/Generator.php | 37 +- .../Invocation/ObjectInvocation.php | 1 - .../Invocation/StaticInvocation.php | 1 - src/Framework/MockObject/InvocationMocker.php | 22 - src/Framework/MockObject/Matcher.php | 12 - .../MockObject/Matcher/AnyInvokedCount.php | 3 - .../MockObject/Matcher/AnyParameters.php | 5 - .../Matcher/ConsecutiveParameters.php | 10 +- .../MockObject/Matcher/Invocation.php | 2 - .../MockObject/Matcher/InvokedAtIndex.php | 8 - .../Matcher/InvokedAtLeastCount.php | 3 - .../MockObject/Matcher/InvokedAtLeastOnce.php | 3 - .../MockObject/Matcher/InvokedAtMostCount.php | 3 - .../MockObject/Matcher/InvokedCount.php | 5 - .../MockObject/Matcher/InvokedRecorder.php | 5 - .../MockObject/Matcher/MethodName.php | 6 - .../MockObject/Matcher/Parameters.php | 7 - .../Matcher/StatelessInvocation.php | 4 - src/Framework/MockObject/MockBuilder.php | 5 - src/Framework/MockObject/MockObject.php | 4 - src/Framework/MockObject/Stub.php | 2 - src/Framework/RiskyTest.php | 1 - src/Framework/SelfDescribing.php | 1 - src/Framework/SkippedTest.php | 1 - src/Framework/SkippedTestError.php | 1 - src/Framework/SkippedTestSuiteError.php | 1 - src/Framework/SyntheticError.php | 1 - src/Framework/Test.php | 1 - src/Framework/TestCase.php | 32 +- src/Framework/TestFailure.php | 4 +- src/Framework/TestResult.php | 7 +- src/Framework/TestSuite.php | 22 +- src/Runner/BaseTestRunner.php | 10 +- src/Runner/Filter/Factory.php | 3 - src/Runner/Filter/NameFilterIterator.php | 1 + src/Runner/Hook/AfterIncompleteTestHook.php | 1 - src/Runner/Hook/AfterLastTestHook.php | 1 - src/Runner/Hook/AfterRiskyTestHook.php | 1 - src/Runner/Hook/AfterSkippedTestHook.php | 1 - src/Runner/Hook/AfterSuccessfulTestHook.php | 1 - src/Runner/Hook/AfterTestErrorHook.php | 1 - src/Runner/Hook/AfterTestFailureHook.php | 1 - src/Runner/Hook/AfterTestWarningHook.php | 1 - src/Runner/Hook/BeforeFirstTestHook.php | 1 - src/Runner/Hook/BeforeTestHook.php | 1 - src/Runner/Hook/Hook.php | 1 - src/Runner/Hook/TestHook.php | 1 - src/Runner/Hook/TestListenerAdapter.php | 1 - src/Runner/PhptTestCase.php | 7 +- src/Runner/TestSuiteLoader.php | 1 - src/Runner/TestSuiteSorter.php | 1 - src/Runner/Version.php | 2 +- src/TextUI/Command.php | 39 +- src/TextUI/ResultPrinter.php | 12 +- src/TextUI/TestRunner.php | 8 +- src/Util/Blacklist.php | 3 +- src/Util/Configuration.php | 15 +- src/Util/ConfigurationGenerator.php | 1 - src/Util/ErrorHandler.php | 9 +- src/Util/FileLoader.php | 2 +- src/Util/Filesystem.php | 3 +- src/Util/Json.php | 3 +- src/Util/Log/JUnit.php | 7 +- src/Util/Log/TeamCity.php | 15 - src/Util/PHP/AbstractPhpProcess.php | 5 +- src/Util/Printer.php | 4 +- src/Util/Test.php | 15 +- src/Util/TestDox/HtmlResultPrinter.php | 2 - src/Util/TestDox/NamePrettifier.php | 1 - src/Util/TestDox/ResultPrinter.php | 4 - src/Util/TestDox/TextResultPrinter.php | 2 - src/Util/TestDox/XmlResultPrinter.php | 2 +- src/Util/TextTestListRenderer.php | 5 +- src/Util/Type.php | 1 - src/Util/Xml.php | 8 +- src/Util/XmlTestListRenderer.php | 1 - tests/Framework/AssertTest.php | 80 +--- .../Framework/Constraint/ArrayHasKeyTest.php | 1 - .../Framework/Constraint/ArraySubsetTest.php | 1 - tests/Framework/Constraint/AttributeTest.php | 1 - tests/Framework/Constraint/CallbackTest.php | 1 - .../Constraint/ClassHasAttributeTest.php | 1 - .../ClassHasStaticAttributeTest.php | 1 - .../Constraint/ConstraintTestCase.php | 3 - tests/Framework/Constraint/CountTest.php | 1 - .../Constraint/DirectoryExistsTest.php | 1 - .../Constraint/ExceptionMessageRegExpTest.php | 1 - .../Constraint/ExceptionMessageTest.php | 1 - tests/Framework/Constraint/FileExistsTest.php | 1 - .../Framework/Constraint/GreaterThanTest.php | 1 - tests/Framework/Constraint/IsEmptyTest.php | 1 - tests/Framework/Constraint/IsEqualTest.php | 5 - .../Framework/Constraint/IsIdenticalTest.php | 1 - .../Framework/Constraint/IsInstanceOfTest.php | 1 - tests/Framework/Constraint/IsJsonTest.php | 4 - tests/Framework/Constraint/IsNullTest.php | 1 - tests/Framework/Constraint/IsReadableTest.php | 1 - tests/Framework/Constraint/IsTypeTest.php | 3 - tests/Framework/Constraint/IsWritableTest.php | 1 - .../JsonMatchesErrorMessageProviderTest.php | 20 +- .../Framework/Constraint/JsonMatchesTest.php | 8 - tests/Framework/Constraint/LessThanTest.php | 1 - tests/Framework/Constraint/LogicalAndTest.php | 1 - tests/Framework/Constraint/LogicalOrTest.php | 1 - .../Constraint/ObjectHasAttributeTest.php | 1 - .../Constraint/RegularExpressionTest.php | 1 - tests/Framework/Constraint/SameSizeTest.php | 1 - .../Constraint/StringContainsTest.php | 1 - .../Constraint/StringEndsWithTest.php | 1 - .../StringMatchesFormatDescriptionTest.php | 1 - .../Constraint/StringStartsWithTest.php | 1 - .../Constraint/TraversableContainsTest.php | 1 - tests/Framework/ConstraintTest.php | 5 +- tests/Framework/ExceptionWrapperTest.php | 1 - tests/Framework/MockObject/GeneratorTest.php | 3 - .../Invocation/ObjectInvocationTest.php | 2 +- .../Invocation/StaticInvocationTest.php | 2 +- tests/Framework/MockObject/MockObjectTest.php | 14 +- tests/Framework/TestCaseTest.php | 18 +- tests/Framework/TestFailureTest.php | 1 - tests/Framework/TestImplementorTest.php | 1 - tests/Framework/TestListenerTest.php | 9 +- tests/Framework/TestSuiteTest.php | 3 +- .../Regression/GitHub/1337/Issue1337Test.php | 6 +- .../Regression/GitHub/1348/Issue1348Test.php | 4 +- .../Regression/GitHub/2137/Issue2137Test.php | 6 - .../Regression/GitHub/2366/Issue2366Test.php | 2 - .../Regression/GitHub/2380/Issue2380Test.php | 2 - .../Regression/GitHub/2382/Issue2382Test.php | 2 - ...SeparateClassRunMethodInNewProcessTest.php | 3 + .../Regression/GitHub/3156/Issue3156Test.php | 1 - tests/Regression/GitHub/498/Issue498Test.php | 4 - tests/Regression/GitHub/765/Issue765Test.php | 2 - tests/Regression/Trac/1021/Issue1021Test.php | 2 - tests/Regression/Trac/578/Issue578Test.php | 8 +- tests/Runner/PhptTestCaseTest.php | 37 +- tests/Runner/TestSuiteSorterTest.php | 1 - tests/TextUI/_files/Extension.php | 22 +- tests/Util/ConfigurationGeneratorTest.php | 1 - tests/Util/ConfigurationTest.php | 222 +++++----- tests/Util/GetoptTest.php | 1 - tests/Util/GlobalStateTest.php | 1 - tests/Util/JsonTest.php | 10 - tests/Util/PHP/AbstractPhpProcessTest.php | 3 +- tests/Util/RegularExpressionTest.php | 22 +- tests/Util/TestDox/NamePrettifierTest.php | 1 - tests/Util/TestTest.php | 245 +++++------ tests/Util/XmlTest.php | 1 - tests/_files/BeforeAndAfterTest.php | 1 + tests/_files/BeforeClassAndAfterClassTest.php | 1 + .../BeforeClassWithOnlyDataProviderTest.php | 1 + tests/_files/Calculator.php | 3 - tests/_files/ClassWithNonPublicAttributes.php | 10 + tests/_files/ClonedDependencyTest.php | 10 - tests/_files/DataProviderDependencyTest.php | 2 - tests/_files/DataProviderFilterTest.php | 20 +- tests/_files/DataProviderIncompleteTest.php | 16 +- .../DataProviderIssue2833/FirstTest.php | 2 - .../another/TestWithDataProviderTest.php | 2 - .../DataProviderIssue2922/FirstTest.php | 2 - tests/_files/DataProviderSkippedTest.php | 16 +- tests/_files/DataProviderTest.php | 12 +- .../ExceptionInAssertPostConditionsTest.php | 4 + .../ExceptionInAssertPreConditionsTest.php | 4 + tests/_files/ExceptionInSetUpTest.php | 4 + tests/_files/ExceptionInTearDownTest.php | 4 + tests/_files/ExceptionInTest.php | 4 + tests/_files/Mockable.php | 1 + tests/_files/MultiDependencyTest.php | 3 - tests/_files/SampleArrayAccess.php | 2 +- tests/_files/SampleClass.php | 2 + tests/_files/SomeClass.php | 2 - tests/_files/TestIterator.php | 1 + tests/_files/TestWithTest.php | 12 +- tests/bootstrap.php | 2 +- 205 files changed, 502 insertions(+), 1780 deletions(-) diff --git a/src/Exception.php b/src/Exception.php index 11db551bcb3..055c5b5b529 100644 --- a/src/Exception.php +++ b/src/Exception.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit; /** diff --git a/src/Framework/Assert.php b/src/Framework/Assert.php index ebf45aa5069..f161d7f2f47 100644 --- a/src/Framework/Assert.php +++ b/src/Framework/Assert.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use ArrayAccess; @@ -79,7 +78,6 @@ abstract class Assert * * @param int|string $key * @param array|ArrayAccess $array - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -110,13 +108,11 @@ public static function assertArrayHasKey($key, $array, string $message = ''): vo * * @param array|ArrayAccess $subset * @param array|ArrayAccess $array - * @param bool $strict Check for object identity - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ - public static function assertArraySubset($subset, $array, bool $strict = false, string $message = ''): void + public static function assertArraySubset($subset, $array, bool $checkForObjectIdentity = false, string $message = ''): void { if (!(\is_array($subset) || $subset instanceof ArrayAccess)) { throw InvalidArgumentHelper::factory( @@ -132,7 +128,7 @@ public static function assertArraySubset($subset, $array, bool $strict = false, ); } - $constraint = new ArraySubset($subset, $strict); + $constraint = new ArraySubset($subset, $checkForObjectIdentity); static::assertThat($array, $constraint, $message); } @@ -142,7 +138,6 @@ public static function assertArraySubset($subset, $array, bool $strict = false, * * @param int|string $key * @param array|ArrayAccess $array - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -173,13 +168,6 @@ public static function assertArrayNotHasKey($key, $array, string $message = ''): /** * Asserts that a haystack contains a needle. * - * @param mixed $needle - * @param mixed $haystack - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -218,13 +206,7 @@ public static function assertContains($needle, $haystack, string $message = '', * Asserts that a haystack that is stored in a static attribute of a class * or an attribute of an object contains a needle. * - * @param mixed $needle - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -244,13 +226,6 @@ public static function assertAttributeContains($needle, string $haystackAttribut /** * Asserts that a haystack does not contain a needle. * - * @param mixed $needle - * @param mixed $haystack - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -293,13 +268,7 @@ public static function assertNotContains($needle, $haystack, string $message = ' * Asserts that a haystack that is stored in a static attribute of a class * or an attribute of an object does not contain a needle. * - * @param mixed $needle - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -319,10 +288,7 @@ public static function assertAttributeNotContains($needle, string $haystackAttri /** * Asserts that a haystack contains only values of a given type. * - * @param string $type - * @param iterable $haystack * @param null|bool $isNativeType - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -346,10 +312,6 @@ public static function assertContainsOnly(string $type, iterable $haystack, ?boo /** * Asserts that a haystack contains only instances of a given class name. * - * @param string $className - * @param iterable $haystack - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -369,11 +331,8 @@ public static function assertContainsOnlyInstancesOf(string $className, iterable * Asserts that a haystack that is stored in a static attribute of a class * or an attribute of an object contains only values of a given type. * - * @param string $type - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject * @param bool $isNativeType - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -391,10 +350,7 @@ public static function assertAttributeContainsOnly(string $type, string $haystac /** * Asserts that a haystack does not contain only values of a given type. * - * @param string $type - * @param iterable $haystack * @param null|bool $isNativeType - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -422,11 +378,8 @@ public static function assertNotContainsOnly(string $type, iterable $haystack, ? * or an attribute of an object does not contain only values of a given * type. * - * @param string $type - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject * @param bool $isNativeType - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -444,9 +397,7 @@ public static function assertAttributeNotContainsOnly(string $type, string $hays /** * Asserts the number of elements of an array, Countable or Traversable. * - * @param int $expectedCount * @param Countable|iterable $haystack - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -468,10 +419,7 @@ public static function assertCount(int $expectedCount, $haystack, string $messag * Asserts the number of elements of an array, Countable or Traversable * that is stored in an attribute. * - * @param int $expectedCount - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -488,9 +436,7 @@ public static function assertAttributeCount(int $expectedCount, string $haystack /** * Asserts the number of elements of an array, Countable or Traversable. * - * @param int $expectedCount * @param Countable|iterable $haystack - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -512,10 +458,7 @@ public static function assertNotCount(int $expectedCount, $haystack, string $mes * Asserts the number of elements of an array, Countable or Traversable * that is stored in an attribute. * - * @param int $expectedCount - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -532,14 +475,6 @@ public static function assertAttributeNotCount(int $expectedCount, string $hayst /** * Asserts that two variables are equal. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -559,14 +494,7 @@ public static function assertEquals($expected, $actual, string $message = '', fl /** * Asserts that a variable is equal to an attribute of an object. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -587,18 +515,10 @@ public static function assertAttributeEquals($expected, string $actualAttributeN /** * Asserts that two variables are not equal. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ - public static function assertNotEquals($expected, $actual, string $message = '', $delta = 0.0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false): void + public static function assertNotEquals($expected, $actual, string $message = '', float $delta = 0.0, int $maxDepth = 10, bool $canonicalize = false, bool $ignoreCase = false): void { $constraint = new LogicalNot( new IsEqual( @@ -616,14 +536,7 @@ public static function assertNotEquals($expected, $actual, string $message = '', /** * Asserts that a variable is not equal to an attribute of an object. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -644,9 +557,6 @@ public static function assertAttributeNotEquals($expected, string $actualAttribu /** * Asserts that a variable is empty. * - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -659,9 +569,7 @@ public static function assertEmpty($actual, string $message = ''): void * Asserts that a static attribute of a class or an attribute of an object * is empty. * - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -677,9 +585,6 @@ public static function assertAttributeEmpty(string $haystackAttributeName, $hays /** * Asserts that a variable is not empty. * - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -692,9 +597,7 @@ public static function assertNotEmpty($actual, string $message = ''): void * Asserts that a static attribute of a class or an attribute of an object * is not empty. * - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -710,10 +613,6 @@ public static function assertAttributeNotEmpty(string $haystackAttributeName, $h /** * Asserts that a value is greater than another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -725,10 +624,7 @@ public static function assertGreaterThan($expected, $actual, string $message = ' /** * Asserts that an attribute is greater than another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -745,10 +641,6 @@ public static function assertAttributeGreaterThan($expected, string $actualAttri /** * Asserts that a value is greater than or equal to another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -764,10 +656,7 @@ public static function assertGreaterThanOrEqual($expected, $actual, string $mess /** * Asserts that an attribute is greater than or equal to another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -784,10 +673,6 @@ public static function assertAttributeGreaterThanOrEqual($expected, string $actu /** * Asserts that a value is smaller than another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -799,10 +684,7 @@ public static function assertLessThan($expected, $actual, string $message = ''): /** * Asserts that an attribute is smaller than another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -819,10 +701,6 @@ public static function assertAttributeLessThan($expected, string $actualAttribut /** * Asserts that a value is smaller than or equal to another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -834,10 +712,7 @@ public static function assertLessThanOrEqual($expected, $actual, string $message /** * Asserts that an attribute is smaller than or equal to another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -855,12 +730,6 @@ public static function assertAttributeLessThanOrEqual($expected, string $actualA * Asserts that the contents of one file is equal to the contents of another * file. * - * @param string $expected - * @param string $actual - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -884,12 +753,6 @@ public static function assertFileEquals(string $expected, string $actual, string * Asserts that the contents of one file is not equal to the contents of * another file. * - * @param string $expected - * @param string $actual - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -913,12 +776,6 @@ public static function assertFileNotEquals(string $expected, string $actual, str * Asserts that the contents of a string is equal * to the contents of a file. * - * @param string $expectedFile - * @param string $actualString - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -942,12 +799,6 @@ public static function assertStringEqualsFile(string $expectedFile, string $actu * Asserts that the contents of a string is not equal * to the contents of a file. * - * @param string $expectedFile - * @param string $actualString - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -969,9 +820,6 @@ public static function assertStringNotEqualsFile(string $expectedFile, string $a /** * Asserts that a file/dir is readable. * - * @param string $filename - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -983,9 +831,6 @@ public static function assertIsReadable(string $filename, string $message = ''): /** * Asserts that a file/dir exists and is not readable. * - * @param string $filename - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -997,9 +842,6 @@ public static function assertNotIsReadable(string $filename, string $message = ' /** * Asserts that a file/dir exists and is writable. * - * @param string $filename - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1011,9 +853,6 @@ public static function assertIsWritable(string $filename, string $message = ''): /** * Asserts that a file/dir exists and is not writable. * - * @param string $filename - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1025,9 +864,6 @@ public static function assertNotIsWritable(string $filename, string $message = ' /** * Asserts that a directory exists. * - * @param string $directory - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1039,9 +875,6 @@ public static function assertDirectoryExists(string $directory, string $message /** * Asserts that a directory does not exist. * - * @param string $directory - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1053,9 +886,6 @@ public static function assertDirectoryNotExists(string $directory, string $messa /** * Asserts that a directory exists and is readable. * - * @param string $directory - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1068,9 +898,6 @@ public static function assertDirectoryIsReadable(string $directory, string $mess /** * Asserts that a directory exists and is not readable. * - * @param string $directory - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1083,9 +910,6 @@ public static function assertDirectoryNotIsReadable(string $directory, string $m /** * Asserts that a directory exists and is writable. * - * @param string $directory - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1098,9 +922,6 @@ public static function assertDirectoryIsWritable(string $directory, string $mess /** * Asserts that a directory exists and is not writable. * - * @param string $directory - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1113,9 +934,6 @@ public static function assertDirectoryNotIsWritable(string $directory, string $m /** * Asserts that a file exists. * - * @param string $filename - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1127,9 +945,6 @@ public static function assertFileExists(string $filename, string $message = ''): /** * Asserts that a file does not exist. * - * @param string $filename - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1141,9 +956,6 @@ public static function assertFileNotExists(string $filename, string $message = ' /** * Asserts that a file exists and is readable. * - * @param string $file - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1156,9 +968,6 @@ public static function assertFileIsReadable(string $file, string $message = ''): /** * Asserts that a file exists and is not readable. * - * @param string $file - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1171,9 +980,6 @@ public static function assertFileNotIsReadable(string $file, string $message = ' /** * Asserts that a file exists and is writable. * - * @param string $file - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1186,9 +992,6 @@ public static function assertFileIsWritable(string $file, string $message = ''): /** * Asserts that a file exists and is not writable. * - * @param string $file - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1201,9 +1004,6 @@ public static function assertFileNotIsWritable(string $file, string $message = ' /** * Asserts that a condition is true. * - * @param mixed $condition - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1215,9 +1015,6 @@ public static function assertTrue($condition, string $message = ''): void /** * Asserts that a condition is not true. * - * @param mixed $condition - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1229,9 +1026,6 @@ public static function assertNotTrue($condition, string $message = ''): void /** * Asserts that a condition is false. * - * @param mixed $condition - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1243,9 +1037,6 @@ public static function assertFalse($condition, string $message = ''): void /** * Asserts that a condition is not false. * - * @param mixed $condition - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1257,9 +1048,6 @@ public static function assertNotFalse($condition, string $message = ''): void /** * Asserts that a variable is null. * - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1271,9 +1059,6 @@ public static function assertNull($actual, string $message = ''): void /** * Asserts that a variable is not null. * - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1285,9 +1070,6 @@ public static function assertNotNull($actual, string $message = ''): void /** * Asserts that a variable is finite. * - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1299,9 +1081,6 @@ public static function assertFinite($actual, string $message = ''): void /** * Asserts that a variable is infinite. * - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1313,9 +1092,6 @@ public static function assertInfinite($actual, string $message = ''): void /** * Asserts that a variable is nan. * - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1327,10 +1103,6 @@ public static function assertNan($actual, string $message = ''): void /** * Asserts that a class has a specified attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1350,10 +1122,6 @@ public static function assertClassHasAttribute(string $attributeName, string $cl /** * Asserts that a class does not have a specified attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1379,10 +1147,6 @@ public static function assertClassNotHasAttribute(string $attributeName, string /** * Asserts that a class has a specified static attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1406,10 +1170,6 @@ public static function assertClassHasStaticAttribute(string $attributeName, stri /** * Asserts that a class does not have a specified static attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1435,9 +1195,7 @@ public static function assertClassNotHasStaticAttribute(string $attributeName, s /** * Asserts that an object has a specified attribute. * - * @param string $attributeName * @param object $object - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1462,9 +1220,7 @@ public static function assertObjectHasAttribute(string $attributeName, $object, /** * Asserts that an object does not have a specified attribute. * - * @param string $attributeName * @param object $object - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1493,10 +1249,6 @@ public static function assertObjectNotHasAttribute(string $attributeName, $objec * Used on objects, it asserts that two variables reference * the same object. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1517,10 +1269,7 @@ public static function assertSame($expected, $actual, string $message = ''): voi * Asserts that a variable and an attribute of an object have the same type * and value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1539,10 +1288,6 @@ public static function assertAttributeSame($expected, string $actualAttributeNam * Used on objects, it asserts that two variables do not reference * the same object. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1565,10 +1310,7 @@ public static function assertNotSame($expected, $actual, string $message = ''): * Asserts that a variable and an attribute of an object do not have the * same type and value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1585,10 +1327,6 @@ public static function assertAttributeNotSame($expected, string $actualAttribute /** * Asserts that a variable is of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1608,10 +1346,7 @@ public static function assertInstanceOf(string $expected, $actual, string $messa /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1628,10 +1363,6 @@ public static function assertAttributeInstanceOf(string $expected, string $attri /** * Asserts that a variable is not of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1653,10 +1384,7 @@ public static function assertNotInstanceOf(string $expected, $actual, string $me /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1673,10 +1401,6 @@ public static function assertAttributeNotInstanceOf(string $expected, string $at /** * Asserts that a variable is of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1692,10 +1416,7 @@ public static function assertInternalType(string $expected, $actual, string $mes /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1712,10 +1433,6 @@ public static function assertAttributeInternalType(string $expected, string $att /** * Asserts that a variable is not of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1733,10 +1450,7 @@ public static function assertNotInternalType(string $expected, $actual, string $ /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1753,10 +1467,6 @@ public static function assertAttributeNotInternalType(string $expected, string $ /** * Asserts that a string matches a given regular expression. * - * @param string $pattern - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1768,10 +1478,6 @@ public static function assertRegExp(string $pattern, string $string, string $mes /** * Asserts that a string does not match a given regular expression. * - * @param string $pattern - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1792,7 +1498,6 @@ public static function assertNotRegExp(string $pattern, string $string, string $ * * @param Countable|iterable $expected * @param Countable|iterable $actual - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1820,7 +1525,6 @@ public static function assertSameSize($expected, $actual, string $message = ''): * * @param Countable|iterable $expected * @param Countable|iterable $actual - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1847,10 +1551,6 @@ public static function assertNotSameSize($expected, $actual, string $message = ' /** * Asserts that a string matches a given format string. * - * @param string $format - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1862,10 +1562,6 @@ public static function assertStringMatchesFormat(string $format, string $string, /** * Asserts that a string does not match a given format string. * - * @param string $format - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1883,10 +1579,6 @@ public static function assertStringNotMatchesFormat(string $format, string $stri /** * Asserts that a string matches a given format file. * - * @param string $formatFile - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1906,10 +1598,6 @@ public static function assertStringMatchesFormatFile(string $formatFile, string /** * Asserts that a string does not match a given format string. * - * @param string $formatFile - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1931,10 +1619,6 @@ public static function assertStringNotMatchesFormatFile(string $formatFile, stri /** * Asserts that a string starts with a given prefix. * - * @param string $prefix - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1948,7 +1632,6 @@ public static function assertStringStartsWith(string $prefix, string $string, st * * @param string $prefix * @param string $string - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1967,10 +1650,6 @@ public static function assertStringStartsNotWith($prefix, $string, string $messa /** * Asserts that a string ends with a given suffix. * - * @param string $suffix - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -1982,10 +1661,6 @@ public static function assertStringEndsWith(string $suffix, string $string, stri /** * Asserts that a string ends not with a given suffix. * - * @param string $suffix - * @param string $string - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2003,10 +1678,6 @@ public static function assertStringEndsNotWith(string $suffix, string $string, s /** * Asserts that two XML files are equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2021,10 +1692,6 @@ public static function assertXmlFileEqualsXmlFile(string $expectedFile, string $ /** * Asserts that two XML files are not equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2039,9 +1706,7 @@ public static function assertXmlFileNotEqualsXmlFile(string $expectedFile, strin /** * Asserts that two XML documents are equal. * - * @param string $expectedFile * @param DOMDocument|string $actualXml - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -2057,9 +1722,7 @@ public static function assertXmlStringEqualsXmlFile(string $expectedFile, $actua /** * Asserts that two XML documents are not equal. * - * @param string $expectedFile * @param DOMDocument|string $actualXml - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -2077,7 +1740,6 @@ public static function assertXmlStringNotEqualsXmlFile(string $expectedFile, $ac * * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -2095,7 +1757,6 @@ public static function assertXmlStringEqualsXmlString($expectedXml, $actualXml, * * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -2111,11 +1772,6 @@ public static function assertXmlStringNotEqualsXmlString($expectedXml, $actualXm /** * Asserts that a hierarchy of DOMElements matches. * - * @param DOMElement $expectedElement - * @param DOMElement $actualElement - * @param bool $checkAttributes - * @param string $message - * * @throws AssertionFailedError * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -2195,10 +1851,6 @@ public static function assertEqualXMLStructure(DOMElement $expectedElement, DOME /** * Evaluates a PHPUnit\Framework\Constraint matcher object. * - * @param mixed $value - * @param Constraint $constraint - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2212,9 +1864,6 @@ public static function assertThat($value, Constraint $constraint, string $messag /** * Asserts that a string is a valid JSON string. * - * @param string $actualJson - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2226,10 +1875,6 @@ public static function assertJson(string $actualJson, string $message = ''): voi /** * Asserts that two given JSON encoded objects or arrays are equal. * - * @param string $expectedJson - * @param string $actualJson - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2246,7 +1891,6 @@ public static function assertJsonStringEqualsJsonString(string $expectedJson, st * * @param string $expectedJson * @param string $actualJson - * @param string $message * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -2268,10 +1912,6 @@ public static function assertJsonStringNotEqualsJsonString($expectedJson, $actua /** * Asserts that the generated JSON encoded object and the content of the given file are equal. * - * @param string $expectedFile - * @param string $actualJson - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2289,10 +1929,6 @@ public static function assertJsonStringEqualsJsonFile(string $expectedFile, stri /** * Asserts that the generated JSON encoded object and the content of the given file are not equal. * - * @param string $expectedFile - * @param string $actualJson - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2316,10 +1952,6 @@ public static function assertJsonStringNotEqualsJsonFile(string $expectedFile, s /** * Asserts that two JSON files are equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2347,10 +1979,6 @@ public static function assertJsonFileEqualsJsonFile(string $expectedFile, string /** * Asserts that two JSON files are not equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2616,8 +2244,6 @@ public static function countOf(int $count): Count /** * Fails a test with the given message. * - * @param string $message - * * @throws AssertionFailedError */ public static function fail(string $message = ''): void @@ -2632,11 +2258,8 @@ public static function fail(string $message = ''): void * This also works for attributes that are declared protected or private. * * @param object|string $classOrObject - * @param string $attributeName * * @throws Exception - * - * @return mixed */ public static function readAttribute($classOrObject, string $attributeName) { @@ -2675,13 +2298,8 @@ public static function readAttribute($classOrObject, string $attributeName) * Returns the value of a static attribute. * This also works for attributes that are declared protected or private. * - * @param string $className - * @param string $attributeName - * * @throws Exception * @throws ReflectionException - * - * @return mixed */ public static function getStaticAttribute(string $className, string $attributeName) { @@ -2718,11 +2336,8 @@ public static function getStaticAttribute(string $className, string $attributeNa * This also works for attributes that are declared protected or private. * * @param object $object - * @param string $attributeName * * @throws Exception - * - * @return mixed */ public static function getObjectAttribute($object, string $attributeName) { @@ -2772,8 +2387,6 @@ public static function getObjectAttribute($object, string $attributeName) /** * Mark the test as incomplete. * - * @param string $message - * * @throws IncompleteTestError */ public static function markTestIncomplete(string $message = ''): void @@ -2784,8 +2397,6 @@ public static function markTestIncomplete(string $message = ''): void /** * Mark the test as skipped. * - * @param string $message - * * @throws SkippedTestError */ public static function markTestSkipped(string $message = ''): void diff --git a/src/Framework/Assert/Functions.php b/src/Framework/Assert/Functions.php index 75a310c4fcc..0eea5f6dd73 100644 --- a/src/Framework/Assert/Functions.php +++ b/src/Framework/Assert/Functions.php @@ -67,7 +67,6 @@ * * @param int|string $key * @param array|ArrayAccess $array - * @param string $message * * @throws Exception */ @@ -81,8 +80,7 @@ function assertArrayHasKey($key, $array, string $message = ''): void * * @param array|ArrayAccess $subset * @param array|ArrayAccess $array - * @param bool $strict Check for object identity - * @param string $message + * @param bool $strict Check for object identity * * @throws Exception */ @@ -96,7 +94,6 @@ function assertArraySubset($subset, $array, bool $strict = false, string $messag * * @param int|string $key * @param array|ArrayAccess $array - * @param string $message * * @throws Exception */ @@ -108,13 +105,6 @@ function assertArrayNotHasKey($key, $array, string $message = ''): void /** * Asserts that a haystack contains a needle. * - * @param mixed $needle - * @param mixed $haystack - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity - * * @throws Exception * @throws ExpectationFailedException * @throws \PHPUnit\Framework\Exception @@ -129,13 +119,7 @@ function assertContains($needle, $haystack, string $message = '', bool $ignoreCa * Asserts that a haystack that is stored in a static attribute of a class * or an attribute of an object contains a needle. * - * @param mixed $needle - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity * * @throws Exception */ @@ -147,13 +131,6 @@ function assertAttributeContains($needle, string $haystackAttributeName, $haysta /** * Asserts that a haystack does not contain a needle. * - * @param mixed $needle - * @param mixed $haystack - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity - * * @throws Exception * @throws ExpectationFailedException * @throws \PHPUnit\Framework\Exception @@ -168,13 +145,7 @@ function assertNotContains($needle, $haystack, string $message = '', bool $ignor * Asserts that a haystack that is stored in a static attribute of a class * or an attribute of an object does not contain a needle. * - * @param mixed $needle - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message - * @param bool $ignoreCase - * @param bool $checkForObjectIdentity - * @param bool $checkForNonObjectIdentity * * @throws Exception */ @@ -186,10 +157,7 @@ function assertAttributeNotContains($needle, string $haystackAttributeName, $hay /** * Asserts that a haystack contains only values of a given type. * - * @param string $type - * @param iterable $haystack * @param null|bool $isNativeType - * @param string $message * * @throws Exception * @throws ExpectationFailedException @@ -203,10 +171,6 @@ function assertContainsOnly(string $type, iterable $haystack, ?bool $isNativeTyp /** * Asserts that a haystack contains only instances of a given class name. * - * @param string $className - * @param iterable $haystack - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -220,11 +184,8 @@ function assertContainsOnlyInstancesOf(string $className, iterable $haystack, st * Asserts that a haystack that is stored in a static attribute of a class * or an attribute of an object contains only values of a given type. * - * @param string $type - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject * @param bool $isNativeType - * @param string $message * * @throws Exception */ @@ -236,10 +197,7 @@ function assertAttributeContainsOnly(string $type, string $haystackAttributeName /** * Asserts that a haystack does not contain only values of a given type. * - * @param string $type - * @param iterable $haystack * @param null|bool $isNativeType - * @param string $message * * @throws Exception * @throws ExpectationFailedException @@ -255,11 +213,8 @@ function assertNotContainsOnly(string $type, iterable $haystack, ?bool $isNative * or an attribute of an object does not contain only values of a given * type. * - * @param string $type - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject * @param bool $isNativeType - * @param string $message * * @throws Exception */ @@ -271,9 +226,7 @@ function assertAttributeNotContainsOnly(string $type, string $haystackAttributeN /** * Asserts the number of elements of an array, Countable or Traversable. * - * @param int $expectedCount * @param Countable|iterable $haystack - * @param string $message * * @throws Exception */ @@ -286,10 +239,7 @@ function assertCount(int $expectedCount, $haystack, string $message = ''): void * Asserts the number of elements of an array, Countable or Traversable * that is stored in an attribute. * - * @param int $expectedCount - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws Exception */ @@ -301,9 +251,7 @@ function assertAttributeCount(int $expectedCount, string $haystackAttributeName, /** * Asserts the number of elements of an array, Countable or Traversable. * - * @param int $expectedCount * @param Countable|iterable $haystack - * @param string $message * * @throws Exception */ @@ -316,10 +264,7 @@ function assertNotCount(int $expectedCount, $haystack, string $message = ''): vo * Asserts the number of elements of an array, Countable or Traversable * that is stored in an attribute. * - * @param int $expectedCount - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws Exception */ @@ -331,14 +276,6 @@ function assertAttributeNotCount(int $expectedCount, string $haystackAttributeNa /** * Asserts that two variables are equal. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -351,14 +288,7 @@ function assertEquals($expected, $actual, string $message = '', float $delta = 0 /** * Asserts that a variable is equal to an attribute of an object. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase * * @throws Exception */ @@ -370,13 +300,10 @@ function assertAttributeEquals($expected, string $actualAttributeName, $actualCl /** * Asserts that two variables are not equal. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase + * @param float $delta + * @param int $maxDepth + * @param bool $canonicalize + * @param bool $ignoreCase * * @throws Exception * @throws ExpectationFailedException @@ -390,14 +317,7 @@ function assertNotEquals($expected, $actual, string $message = '', $delta = 0.0, /** * Asserts that a variable is not equal to an attribute of an object. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message - * @param float $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase * * @throws Exception */ @@ -409,9 +329,6 @@ function assertAttributeNotEquals($expected, string $actualAttributeName, $actua /** * Asserts that a variable is empty. * - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -425,9 +342,7 @@ function assertEmpty($actual, string $message = ''): void * Asserts that a static attribute of a class or an attribute of an object * is empty. * - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws Exception */ @@ -439,9 +354,6 @@ function assertAttributeEmpty(string $haystackAttributeName, $haystackClassOrObj /** * Asserts that a variable is not empty. * - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -455,9 +367,7 @@ function assertNotEmpty($actual, string $message = ''): void * Asserts that a static attribute of a class or an attribute of an object * is not empty. * - * @param string $haystackAttributeName * @param object|string $haystackClassOrObject - * @param string $message * * @throws Exception */ @@ -469,10 +379,6 @@ function assertAttributeNotEmpty(string $haystackAttributeName, $haystackClassOr /** * Asserts that a value is greater than another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -485,10 +391,7 @@ function assertGreaterThan($expected, $actual, string $message = ''): void /** * Asserts that an attribute is greater than another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws Exception */ @@ -500,10 +403,6 @@ function assertAttributeGreaterThan($expected, string $actualAttributeName, $act /** * Asserts that a value is greater than or equal to another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -516,10 +415,7 @@ function assertGreaterThanOrEqual($expected, $actual, string $message = ''): voi /** * Asserts that an attribute is greater than or equal to another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws Exception */ @@ -531,10 +427,6 @@ function assertAttributeGreaterThanOrEqual($expected, string $actualAttributeNam /** * Asserts that a value is smaller than another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -547,10 +439,7 @@ function assertLessThan($expected, $actual, string $message = ''): void /** * Asserts that an attribute is smaller than another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws Exception */ @@ -562,10 +451,6 @@ function assertAttributeLessThan($expected, string $actualAttributeName, $actual /** * Asserts that a value is smaller than or equal to another value. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -578,10 +463,7 @@ function assertLessThanOrEqual($expected, $actual, string $message = ''): void /** * Asserts that an attribute is smaller than or equal to another value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws Exception */ @@ -594,12 +476,6 @@ function assertAttributeLessThanOrEqual($expected, string $actualAttributeName, * Asserts that the contents of one file is equal to the contents of another * file. * - * @param string $expected - * @param string $actual - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws Exception */ function assertFileEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void @@ -611,12 +487,6 @@ function assertFileEquals(string $expected, string $actual, string $message = '' * Asserts that the contents of one file is not equal to the contents of * another file. * - * @param string $expected - * @param string $actual - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws Exception */ function assertFileNotEquals(string $expected, string $actual, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void @@ -628,12 +498,6 @@ function assertFileNotEquals(string $expected, string $actual, string $message = * Asserts that the contents of a string is equal * to the contents of a file. * - * @param string $expectedFile - * @param string $actualString - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws Exception */ function assertStringEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void @@ -645,12 +509,6 @@ function assertStringEqualsFile(string $expectedFile, string $actualString, stri * Asserts that the contents of a string is not equal * to the contents of a file. * - * @param string $expectedFile - * @param string $actualString - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase - * * @throws Exception */ function assertStringNotEqualsFile(string $expectedFile, string $actualString, string $message = '', bool $canonicalize = false, bool $ignoreCase = false): void @@ -661,9 +519,6 @@ function assertStringNotEqualsFile(string $expectedFile, string $actualString, s /** * Asserts that a file/dir is readable. * - * @param string $filename - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -676,9 +531,6 @@ function assertIsReadable(string $filename, string $message = ''): void /** * Asserts that a file/dir exists and is not readable. * - * @param string $filename - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -691,9 +543,6 @@ function assertNotIsReadable(string $filename, string $message = ''): void /** * Asserts that a file/dir exists and is writable. * - * @param string $filename - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -706,9 +555,6 @@ function assertIsWritable(string $filename, string $message = ''): void /** * Asserts that a file/dir exists and is not writable. * - * @param string $filename - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -721,9 +567,6 @@ function assertNotIsWritable(string $filename, string $message = ''): void /** * Asserts that a directory exists. * - * @param string $directory - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -736,9 +579,6 @@ function assertDirectoryExists(string $directory, string $message = ''): void /** * Asserts that a directory does not exist. * - * @param string $directory - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -751,9 +591,6 @@ function assertDirectoryNotExists(string $directory, string $message = ''): void /** * Asserts that a directory exists and is readable. * - * @param string $directory - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -766,9 +603,6 @@ function assertDirectoryIsReadable(string $directory, string $message = ''): voi /** * Asserts that a directory exists and is not readable. * - * @param string $directory - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -781,9 +615,6 @@ function assertDirectoryNotIsReadable(string $directory, string $message = ''): /** * Asserts that a directory exists and is writable. * - * @param string $directory - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -796,9 +627,6 @@ function assertDirectoryIsWritable(string $directory, string $message = ''): voi /** * Asserts that a directory exists and is not writable. * - * @param string $directory - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -811,9 +639,6 @@ function assertDirectoryNotIsWritable(string $directory, string $message = ''): /** * Asserts that a file exists. * - * @param string $filename - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -826,9 +651,6 @@ function assertFileExists(string $filename, string $message = ''): void /** * Asserts that a file does not exist. * - * @param string $filename - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -841,9 +663,6 @@ function assertFileNotExists(string $filename, string $message = ''): void /** * Asserts that a file exists and is readable. * - * @param string $file - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -856,9 +675,6 @@ function assertFileIsReadable(string $file, string $message = ''): void /** * Asserts that a file exists and is not readable. * - * @param string $file - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -871,9 +687,6 @@ function assertFileNotIsReadable(string $file, string $message = ''): void /** * Asserts that a file exists and is writable. * - * @param string $file - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -886,9 +699,6 @@ function assertFileIsWritable(string $file, string $message = ''): void /** * Asserts that a file exists and is not writable. * - * @param string $file - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -901,9 +711,6 @@ function assertFileNotIsWritable(string $file, string $message = ''): void /** * Asserts that a condition is true. * - * @param mixed $condition - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -916,9 +723,6 @@ function assertTrue($condition, string $message = ''): void /** * Asserts that a condition is not true. * - * @param mixed $condition - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -931,9 +735,6 @@ function assertNotTrue($condition, string $message = ''): void /** * Asserts that a condition is false. * - * @param mixed $condition - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -946,9 +747,6 @@ function assertFalse($condition, string $message = ''): void /** * Asserts that a condition is not false. * - * @param mixed $condition - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -961,9 +759,6 @@ function assertNotFalse($condition, string $message = ''): void /** * Asserts that a variable is null. * - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -976,9 +771,6 @@ function assertNull($actual, string $message = ''): void /** * Asserts that a variable is not null. * - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -991,9 +783,6 @@ function assertNotNull($actual, string $message = ''): void /** * Asserts that a variable is finite. * - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1006,9 +795,6 @@ function assertFinite($actual, string $message = ''): void /** * Asserts that a variable is infinite. * - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1021,9 +807,6 @@ function assertInfinite($actual, string $message = ''): void /** * Asserts that a variable is nan. * - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1036,10 +819,6 @@ function assertNan($actual, string $message = ''): void /** * Asserts that a class has a specified attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws Exception */ function assertClassHasAttribute(string $attributeName, string $className, string $message = ''): void @@ -1050,10 +829,6 @@ function assertClassHasAttribute(string $attributeName, string $className, strin /** * Asserts that a class does not have a specified attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws Exception */ function assertClassNotHasAttribute(string $attributeName, string $className, string $message = ''): void @@ -1064,10 +839,6 @@ function assertClassNotHasAttribute(string $attributeName, string $className, st /** * Asserts that a class has a specified static attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws Exception */ function assertClassHasStaticAttribute(string $attributeName, string $className, string $message = ''): void @@ -1078,10 +849,6 @@ function assertClassHasStaticAttribute(string $attributeName, string $className, /** * Asserts that a class does not have a specified static attribute. * - * @param string $attributeName - * @param string $className - * @param string $message - * * @throws Exception */ function assertClassNotHasStaticAttribute(string $attributeName, string $className, string $message = ''): void @@ -1092,9 +859,7 @@ function assertClassNotHasStaticAttribute(string $attributeName, string $classNa /** * Asserts that an object has a specified attribute. * - * @param string $attributeName * @param object $object - * @param string $message * * @throws Exception */ @@ -1106,9 +871,7 @@ function assertObjectHasAttribute(string $attributeName, $object, string $messag /** * Asserts that an object does not have a specified attribute. * - * @param string $attributeName * @param object $object - * @param string $message * * @throws Exception */ @@ -1122,10 +885,6 @@ function assertObjectNotHasAttribute(string $attributeName, $object, string $mes * Used on objects, it asserts that two variables reference * the same object. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1139,10 +898,7 @@ function assertSame($expected, $actual, string $message = ''): void * Asserts that a variable and an attribute of an object have the same type * and value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws Exception */ @@ -1156,10 +912,6 @@ function assertAttributeSame($expected, string $actualAttributeName, $actualClas * Used on objects, it asserts that two variables do not reference * the same object. * - * @param mixed $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1173,10 +925,7 @@ function assertNotSame($expected, $actual, string $message = ''): void * Asserts that a variable and an attribute of an object do not have the * same type and value. * - * @param mixed $expected - * @param string $actualAttributeName * @param object|string $actualClassOrObject - * @param string $message * * @throws Exception */ @@ -1188,10 +937,6 @@ function assertAttributeNotSame($expected, string $actualAttributeName, $actualC /** * Asserts that a variable is of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws Exception */ function assertInstanceOf(string $expected, $actual, string $message = ''): void @@ -1202,10 +947,7 @@ function assertInstanceOf(string $expected, $actual, string $message = ''): void /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws Exception */ @@ -1217,10 +959,6 @@ function assertAttributeInstanceOf(string $expected, string $attributeName, $cla /** * Asserts that a variable is not of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws Exception */ function assertNotInstanceOf(string $expected, $actual, string $message = ''): void @@ -1231,10 +969,7 @@ function assertNotInstanceOf(string $expected, $actual, string $message = ''): v /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws Exception */ @@ -1246,10 +981,6 @@ function assertAttributeNotInstanceOf(string $expected, string $attributeName, $ /** * Asserts that a variable is of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1262,10 +993,7 @@ function assertInternalType(string $expected, $actual, string $message = ''): vo /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws Exception */ @@ -1277,10 +1005,6 @@ function assertAttributeInternalType(string $expected, string $attributeName, $c /** * Asserts that a variable is not of a given type. * - * @param string $expected - * @param mixed $actual - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1293,10 +1017,7 @@ function assertNotInternalType(string $expected, $actual, string $message = ''): /** * Asserts that an attribute is of a given type. * - * @param string $expected - * @param string $attributeName * @param object|string $classOrObject - * @param string $message * * @throws Exception */ @@ -1308,10 +1029,6 @@ function assertAttributeNotInternalType(string $expected, string $attributeName, /** * Asserts that a string matches a given regular expression. * - * @param string $pattern - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1324,10 +1041,6 @@ function assertRegExp(string $pattern, string $string, string $message = ''): vo /** * Asserts that a string does not match a given regular expression. * - * @param string $pattern - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1343,7 +1056,6 @@ function assertNotRegExp(string $pattern, string $string, string $message = ''): * * @param Countable|iterable $expected * @param Countable|iterable $actual - * @param string $message * * @throws Exception */ @@ -1358,7 +1070,6 @@ function assertSameSize($expected, $actual, string $message = ''): void * * @param Countable|iterable $expected * @param Countable|iterable $actual - * @param string $message * * @throws Exception */ @@ -1370,10 +1081,6 @@ function assertNotSameSize($expected, $actual, string $message = ''): void /** * Asserts that a string matches a given format string. * - * @param string $format - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1386,10 +1093,6 @@ function assertStringMatchesFormat(string $format, string $string, string $messa /** * Asserts that a string does not match a given format string. * - * @param string $format - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1402,10 +1105,6 @@ function assertStringNotMatchesFormat(string $format, string $string, string $me /** * Asserts that a string matches a given format file. * - * @param string $formatFile - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1418,10 +1117,6 @@ function assertStringMatchesFormatFile(string $formatFile, string $string, strin /** * Asserts that a string does not match a given format string. * - * @param string $formatFile - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1434,10 +1129,6 @@ function assertStringNotMatchesFormatFile(string $formatFile, string $string, st /** * Asserts that a string starts with a given prefix. * - * @param string $prefix - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1452,7 +1143,6 @@ function assertStringStartsWith(string $prefix, string $string, string $message * * @param string $prefix * @param string $string - * @param string $message * * @throws Exception * @throws ExpectationFailedException @@ -1466,10 +1156,6 @@ function assertStringStartsNotWith($prefix, $string, string $message = ''): void /** * Asserts that a string ends with a given suffix. * - * @param string $suffix - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1482,10 +1168,6 @@ function assertStringEndsWith(string $suffix, string $string, string $message = /** * Asserts that a string ends not with a given suffix. * - * @param string $suffix - * @param string $string - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1498,10 +1180,6 @@ function assertStringEndsNotWith(string $suffix, string $string, string $message /** * Asserts that two XML files are equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws Exception */ function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void @@ -1512,10 +1190,6 @@ function assertXmlFileEqualsXmlFile(string $expectedFile, string $actualFile, st /** * Asserts that two XML files are not equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws Exception */ function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, string $message = ''): void @@ -1526,9 +1200,7 @@ function assertXmlFileNotEqualsXmlFile(string $expectedFile, string $actualFile, /** * Asserts that two XML documents are equal. * - * @param string $expectedFile * @param DOMDocument|string $actualXml - * @param string $message * * @throws Exception */ @@ -1540,9 +1212,7 @@ function assertXmlStringEqualsXmlFile(string $expectedFile, $actualXml, string $ /** * Asserts that two XML documents are not equal. * - * @param string $expectedFile * @param DOMDocument|string $actualXml - * @param string $message * * @throws Exception */ @@ -1556,7 +1226,6 @@ function assertXmlStringNotEqualsXmlFile(string $expectedFile, $actualXml, strin * * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml - * @param string $message * * @throws Exception */ @@ -1570,7 +1239,6 @@ function assertXmlStringEqualsXmlString($expectedXml, $actualXml, string $messag * * @param DOMDocument|string $expectedXml * @param DOMDocument|string $actualXml - * @param string $message * * @throws Exception */ @@ -1582,11 +1250,6 @@ function assertXmlStringNotEqualsXmlString($expectedXml, $actualXml, string $mes /** * Asserts that a hierarchy of DOMElements matches. * - * @param DOMElement $expectedElement - * @param DOMElement $actualElement - * @param bool $checkAttributes - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \PHPUnit\Framework\AssertionFailedError @@ -1600,10 +1263,6 @@ function assertEqualXMLStructure(DOMElement $expectedElement, DOMElement $actual /** * Evaluates a PHPUnit\Framework\Constraint matcher object. * - * @param mixed $value - * @param Constraint $constraint - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1616,9 +1275,6 @@ function assertThat($value, Constraint $constraint, string $message = ''): void /** * Asserts that a string is a valid JSON string. * - * @param string $actualJson - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1631,10 +1287,6 @@ function assertJson(string $actualJson, string $message = ''): void /** * Asserts that two given JSON encoded objects or arrays are equal. * - * @param string $expectedJson - * @param string $actualJson - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1649,7 +1301,6 @@ function assertJsonStringEqualsJsonString(string $expectedJson, string $actualJs * * @param string $expectedJson * @param string $actualJson - * @param string $message * * @throws Exception * @throws ExpectationFailedException @@ -1663,10 +1314,6 @@ function assertJsonStringNotEqualsJsonString($expectedJson, $actualJson, string /** * Asserts that the generated JSON encoded object and the content of the given file are equal. * - * @param string $expectedFile - * @param string $actualJson - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1679,10 +1326,6 @@ function assertJsonStringEqualsJsonFile(string $expectedFile, string $actualJson /** * Asserts that the generated JSON encoded object and the content of the given file are not equal. * - * @param string $expectedFile - * @param string $actualJson - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1695,10 +1338,6 @@ function assertJsonStringNotEqualsJsonFile(string $expectedFile, string $actualJ /** * Asserts that two JSON files are equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -1711,10 +1350,6 @@ function assertJsonFileEqualsJsonFile(string $expectedFile, string $actualFile, /** * Asserts that two JSON files are not equal. * - * @param string $expectedFile - * @param string $actualFile - * @param string $message - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -2008,17 +1643,11 @@ function at($index): InvokedAtIndexMatcher return new InvokedAtIndexMatcher($index); } -/** - * @param mixed $value - */ function returnValue($value): ReturnStub { return new ReturnStub($value); } -/** - * @param array $valueMap - */ function returnValueMap(array $valueMap): ReturnValueMapStub { return new ReturnValueMapStub($valueMap); @@ -2032,9 +1661,6 @@ function returnArgument($argumentIndex): ReturnArgumentStub return new ReturnArgumentStub($argumentIndex); } -/** - * @param mixed $callback - */ function returnCallback($callback): ReturnCallbackStub { return new ReturnCallbackStub($callback); @@ -2050,17 +1676,11 @@ function returnSelf(): ReturnSelfStub return new ReturnSelfStub; } -/** - * @param Throwable $exception - */ function throwException(Throwable $exception): ExceptionStub { return new ExceptionStub($exception); } -/** - * @param mixed $value , ... - */ function onConsecutiveCalls(): ConsecutiveCallsStub { $args = \func_get_args(); diff --git a/src/Framework/AssertionFailedError.php b/src/Framework/AssertionFailedError.php index 603fff84dce..a402e579023 100644 --- a/src/Framework/AssertionFailedError.php +++ b/src/Framework/AssertionFailedError.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; /** diff --git a/src/Framework/CodeCoverageException.php b/src/Framework/CodeCoverageException.php index 9864e91d8e7..298f5c443ff 100644 --- a/src/Framework/CodeCoverageException.php +++ b/src/Framework/CodeCoverageException.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class CodeCoverageException extends Exception diff --git a/src/Framework/Constraint/ArraySubset.php b/src/Framework/Constraint/ArraySubset.php index d2199df7741..2e63152d021 100644 --- a/src/Framework/Constraint/ArraySubset.php +++ b/src/Framework/Constraint/ArraySubset.php @@ -28,14 +28,14 @@ class ArraySubset extends Constraint /** * @var bool */ - private $strict; + private $checkForObjectIdentity; - public function __construct(iterable $subset, bool $strict = false) + public function __construct(iterable $subset, bool $checkForObjectIdentity = false) { parent::__construct(); - $this->strict = $strict; - $this->subset = $subset; + $this->checkForObjectIdentity = $checkForObjectIdentity; + $this->subset = $subset; } /** @@ -54,8 +54,6 @@ public function __construct(iterable $subset, bool $strict = false) * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { @@ -66,7 +64,7 @@ public function evaluate($other, $description = '', $returnResult = false) $patched = \array_replace_recursive($other, $this->subset); - if ($this->strict) { + if ($this->checkForObjectIdentity) { $result = $other === $patched; } else { $result = $other == $patched; diff --git a/src/Framework/Constraint/Attribute.php b/src/Framework/Constraint/Attribute.php index f8e19d1aedb..36321f30807 100644 --- a/src/Framework/Constraint/Attribute.php +++ b/src/Framework/Constraint/Attribute.php @@ -43,8 +43,6 @@ public function __construct(Constraint $constraint, string $attributeName) * @throws ExpectationFailedException * @throws \PHPUnit\Framework\Exception * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/Composite.php b/src/Framework/Constraint/Composite.php index a2463625ca8..3b19df30890 100644 --- a/src/Framework/Constraint/Composite.php +++ b/src/Framework/Constraint/Composite.php @@ -41,8 +41,6 @@ public function __construct(Constraint $innerConstraint) * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/Constraint.php b/src/Framework/Constraint/Constraint.php index b02c9f6dcdb..175557d2e96 100644 --- a/src/Framework/Constraint/Constraint.php +++ b/src/Framework/Constraint/Constraint.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use Countable; @@ -44,8 +43,6 @@ public function __construct() * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/Count.php b/src/Framework/Constraint/Count.php index cabaea293f5..7aeb2d72fcc 100644 --- a/src/Framework/Constraint/Count.php +++ b/src/Framework/Constraint/Count.php @@ -40,8 +40,6 @@ public function toString(): string /** * Evaluates the constraint for parameter $other. Returns true if the * constraint is met, false otherwise. - * - * @param mixed $other */ protected function matches($other): bool { diff --git a/src/Framework/Constraint/IsAnything.php b/src/Framework/Constraint/IsAnything.php index 021f783a004..526cc3711f2 100644 --- a/src/Framework/Constraint/IsAnything.php +++ b/src/Framework/Constraint/IsAnything.php @@ -31,8 +31,6 @@ class IsAnything extends Constraint * @param bool $returnResult Whether to return a result or throw an exception * * @throws ExpectationFailedException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/IsEqual.php b/src/Framework/Constraint/IsEqual.php index 0ad1a52b629..d3a00a0fde6 100644 --- a/src/Framework/Constraint/IsEqual.php +++ b/src/Framework/Constraint/IsEqual.php @@ -75,8 +75,6 @@ public function __construct($value, float $delta = 0.0, int $maxDepth = 10, bool * @param bool $returnResult Whether to return a result or throw an exception * * @throws ExpectationFailedException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/IsIdentical.php b/src/Framework/Constraint/IsIdentical.php index dba98875b5f..7975966b382 100644 --- a/src/Framework/Constraint/IsIdentical.php +++ b/src/Framework/Constraint/IsIdentical.php @@ -35,9 +35,6 @@ class IsIdentical extends Constraint */ private $value; - /** - * @param mixed $value - */ public function __construct($value) { parent::__construct(); @@ -61,8 +58,6 @@ public function __construct($value) * * @throws ExpectationFailedException * @throws SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/IsType.php b/src/Framework/Constraint/IsType.php index 416770361b6..de42e4a7922 100644 --- a/src/Framework/Constraint/IsType.php +++ b/src/Framework/Constraint/IsType.php @@ -18,16 +18,27 @@ class IsType extends Constraint { public const TYPE_ARRAY = 'array'; + public const TYPE_BOOL = 'bool'; + public const TYPE_FLOAT = 'float'; + public const TYPE_INT = 'int'; + public const TYPE_NULL = 'null'; + public const TYPE_NUMERIC = 'numeric'; + public const TYPE_OBJECT = 'object'; + public const TYPE_RESOURCE = 'resource'; + public const TYPE_STRING = 'string'; + public const TYPE_SCALAR = 'scalar'; + public const TYPE_CALLABLE = 'callable'; + public const TYPE_ITERABLE = 'iterable'; /** diff --git a/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php b/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php index c6fe7ef83ba..9b3659a3c6b 100644 --- a/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php +++ b/src/Framework/Constraint/JsonMatchesErrorMessageProvider.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; /** @@ -21,17 +20,17 @@ class JsonMatchesErrorMessageProvider public static function determineJsonError(string $error, string $prefix = ''): ?string { switch ($error) { - case JSON_ERROR_NONE: + case \JSON_ERROR_NONE: return null; - case JSON_ERROR_DEPTH: + case \JSON_ERROR_DEPTH: return $prefix . 'Maximum stack depth exceeded'; - case JSON_ERROR_STATE_MISMATCH: + case \JSON_ERROR_STATE_MISMATCH: return $prefix . 'Underflow or the modes mismatch'; - case JSON_ERROR_CTRL_CHAR: + case \JSON_ERROR_CTRL_CHAR: return $prefix . 'Unexpected control character found'; - case JSON_ERROR_SYNTAX: + case \JSON_ERROR_SYNTAX: return $prefix . 'Syntax error, malformed JSON'; - case JSON_ERROR_UTF8: + case \JSON_ERROR_UTF8: return $prefix . 'Malformed UTF-8 characters, possibly incorrectly encoded'; default: return $prefix . 'Unknown error'; diff --git a/src/Framework/Constraint/LogicalAnd.php b/src/Framework/Constraint/LogicalAnd.php index 078a4d78c6f..fd7fa29f25d 100644 --- a/src/Framework/Constraint/LogicalAnd.php +++ b/src/Framework/Constraint/LogicalAnd.php @@ -67,8 +67,6 @@ public function setConstraints(array $constraints): void * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/LogicalNot.php b/src/Framework/Constraint/LogicalNot.php index 5996e560525..2e73356b20b 100644 --- a/src/Framework/Constraint/LogicalNot.php +++ b/src/Framework/Constraint/LogicalNot.php @@ -104,8 +104,6 @@ public function __construct($constraint) * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/LogicalOr.php b/src/Framework/Constraint/LogicalOr.php index 340630e2439..dd1fda85921 100644 --- a/src/Framework/Constraint/LogicalOr.php +++ b/src/Framework/Constraint/LogicalOr.php @@ -64,8 +64,6 @@ public function setConstraints(array $constraints): void * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/LogicalXor.php b/src/Framework/Constraint/LogicalXor.php index f681624dff2..b8a2802eb64 100644 --- a/src/Framework/Constraint/LogicalXor.php +++ b/src/Framework/Constraint/LogicalXor.php @@ -64,8 +64,6 @@ public function setConstraints(array $constraints): void * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException - * - * @return mixed */ public function evaluate($other, $description = '', $returnResult = false) { diff --git a/src/Framework/Constraint/StringMatchesFormatDescription.php b/src/Framework/Constraint/StringMatchesFormatDescription.php index c310da97fe8..5b3e5700551 100644 --- a/src/Framework/Constraint/StringMatchesFormatDescription.php +++ b/src/Framework/Constraint/StringMatchesFormatDescription.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use SebastianBergmann\Diff\Differ; @@ -38,8 +37,6 @@ public function __construct(string $string) * constraint is met, false otherwise. * * @param mixed $other value or object to evaluate - * - * @return bool */ protected function matches($other): bool { @@ -93,7 +90,7 @@ private function createPatternFromFormat(string $string): string '/(?previous; } - /** - * @param string $className - */ public function setClassName(string $className): void { $this->className = $className; diff --git a/src/Framework/IncompleteTest.php b/src/Framework/IncompleteTest.php index b65a3a086c3..53654f9e063 100644 --- a/src/Framework/IncompleteTest.php +++ b/src/Framework/IncompleteTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; /** diff --git a/src/Framework/MissingCoversAnnotationException.php b/src/Framework/MissingCoversAnnotationException.php index dbd57c782ee..ed3bcb62aa4 100644 --- a/src/Framework/MissingCoversAnnotationException.php +++ b/src/Framework/MissingCoversAnnotationException.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class MissingCoversAnnotationException extends RiskyTestError diff --git a/src/Framework/MockObject/Builder/InvocationMocker.php b/src/Framework/MockObject/Builder/InvocationMocker.php index f7407556ca0..28013193593 100644 --- a/src/Framework/MockObject/Builder/InvocationMocker.php +++ b/src/Framework/MockObject/Builder/InvocationMocker.php @@ -41,11 +41,6 @@ class InvocationMocker implements MethodNameMatch */ private $configurableMethods; - /** - * @param MatcherCollection $collection - * @param Invocation $invocationMatcher - * @param array $configurableMethods - */ public function __construct(MatcherCollection $collection, Invocation $invocationMatcher, array $configurableMethods) { $this->collection = $collection; @@ -65,8 +60,6 @@ public function getMatcher() } /** - * @param mixed $id - * * @return InvocationMocker */ public function id($id) @@ -77,8 +70,6 @@ public function id($id) } /** - * @param Stub $stub - * * @return InvocationMocker */ public function will(Stub $stub) @@ -89,9 +80,6 @@ public function will(Stub $stub) } /** - * @param mixed $value - * @param mixed $nextValues, ... - * * @return InvocationMocker */ public function willReturn($value, ...$nextValues) @@ -120,8 +108,6 @@ public function willReturnReference(&$reference) } /** - * @param array $valueMap - * * @return InvocationMocker */ public function willReturnMap(array $valueMap) @@ -132,8 +118,6 @@ public function willReturnMap(array $valueMap) } /** - * @param mixed $argumentIndex - * * @return InvocationMocker */ public function willReturnArgument($argumentIndex) @@ -166,8 +150,6 @@ public function willReturnSelf() } /** - * @param mixed $values, ... - * * @return InvocationMocker */ public function willReturnOnConsecutiveCalls(...$values) @@ -178,8 +160,6 @@ public function willReturnOnConsecutiveCalls(...$values) } /** - * @param \Exception $exception - * * @return InvocationMocker */ public function willThrowException(\Exception $exception) @@ -190,8 +170,6 @@ public function willThrowException(\Exception $exception) } /** - * @param mixed $id - * * @return InvocationMocker */ public function after($id) diff --git a/src/Framework/MockObject/Builder/Stub.php b/src/Framework/MockObject/Builder/Stub.php index 234d33fad01..ad9e6c18127 100644 --- a/src/Framework/MockObject/Builder/Stub.php +++ b/src/Framework/MockObject/Builder/Stub.php @@ -20,8 +20,6 @@ interface Stub extends Identity * Stubs the matching method with the stub object $stub. Any invocations of * the matched method will now be handled by the stub instead. * - * @param BaseStub $stub - * * @return Identity */ public function will(BaseStub $stub); diff --git a/src/Framework/MockObject/ForwardCompatibility/MockObject.php b/src/Framework/MockObject/ForwardCompatibility/MockObject.php index 64c0634fd91..f020e8c3c25 100644 --- a/src/Framework/MockObject/ForwardCompatibility/MockObject.php +++ b/src/Framework/MockObject/ForwardCompatibility/MockObject.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\MockObject; use PHPUnit_Framework_MockObject_MockObject; diff --git a/src/Framework/MockObject/Generator.php b/src/Framework/MockObject/Generator.php index a4096ea8a40..c2d00a26733 100644 --- a/src/Framework/MockObject/Generator.php +++ b/src/Framework/MockObject/Generator.php @@ -58,7 +58,6 @@ class Generator * * @param string|string[] $type * @param array $methods - * @param array $arguments * @param string $mockClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -209,7 +208,6 @@ function ($type) { * the last parameter * * @param string $originalClassName - * @param array $arguments * @param string $mockClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -271,7 +269,6 @@ public function getMockForAbstractClass($originalClassName, array $arguments = [ * `$mockedMethods` parameter. * * @param string $traitName - * @param array $arguments * @param string $mockClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -332,7 +329,6 @@ public function getMockForTrait($traitName, array $arguments = [], $mockClassNam * Returns an object for the specified trait. * * @param string $traitName - * @param array $arguments * @param string $traitClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -436,8 +432,6 @@ public function generate($type, array $methods = null, $mockClassName = '', $cal /** * @param string $wsdlFile * @param string $className - * @param array $methods - * @param array $options * * @throws RuntimeException * @@ -451,7 +445,7 @@ public function generateClassFromWsdl($wsdlFile, $className, array $methods = [] ); } - $options = \array_merge($options, ['cache_wsdl' => WSDL_CACHE_NONE]); + $options = \array_merge($options, ['cache_wsdl' => \WSDL_CACHE_NONE]); $client = new SoapClient($wsdlFile, $options); $_methods = \array_unique($client->__getFunctions()); unset($client); @@ -548,7 +542,6 @@ public function getClassMethods($className) * @param array|string $type * @param bool $callOriginalConstructor * @param bool $callAutoload - * @param array $arguments * @param bool $callOriginalMethods * @param object $proxyTarget * @param bool $returnValueGeneration @@ -838,8 +831,8 @@ private function generateMock($type, $methods, $mockClassName, $callOriginalClon ); return [ - 'code' => $classTemplate->render(), - 'mockClassName' => $mockClassName['className'] + 'code' => $classTemplate->render(), + 'mockClassName' => $mockClassName['className'] ]; } @@ -879,17 +872,15 @@ private function generateClassName($type, $className, $prefix) } return [ - 'className' => $className, - 'originalClassName' => $type, - 'fullClassName' => $fullClassName, - 'namespaceName' => $namespaceName + 'className' => $className, + 'originalClassName' => $type, + 'fullClassName' => $fullClassName, + 'namespaceName' => $namespaceName ]; } /** - * @param array $mockClassName - * @param bool $isInterface - * @param array $additionalInterfaces + * @param bool $isInterface * * @return string */ @@ -930,9 +921,8 @@ private function generateMockClassDeclaration(array $mockClassName, $isInterface } /** - * @param ReflectionMethod $method - * @param bool $cloneArguments - * @param bool $callOriginalMethods + * @param bool $cloneArguments + * @param bool $callOriginalMethods * * @throws \PHPUnit\Framework\MockObject\RuntimeException * @@ -1084,8 +1074,6 @@ private function generateMockedMethodDefinition($className, $methodName, $cloneA } /** - * @param ReflectionMethod $method - * * @return bool */ private function canMockMethod(ReflectionMethod $method) @@ -1108,8 +1096,7 @@ private function isMethodNameBlacklisted($name) /** * Returns the parameters of a function or method. * - * @param ReflectionMethod $method - * @param bool $forCall + * @param bool $forCall * * @throws RuntimeException * @@ -1208,7 +1195,7 @@ private function getMethodParameters(ReflectionMethod $method, $forCall = false) */ private function getTemplate($template) { - $filename = __DIR__ . DIRECTORY_SEPARATOR . 'Generator' . DIRECTORY_SEPARATOR . $template; + $filename = __DIR__ . \DIRECTORY_SEPARATOR . 'Generator' . \DIRECTORY_SEPARATOR . $template; if (!isset(self::$templates[$filename])) { self::$templates[$filename] = new Text_Template($filename); diff --git a/src/Framework/MockObject/Invocation/ObjectInvocation.php b/src/Framework/MockObject/Invocation/ObjectInvocation.php index 4b029aac9f7..eb4475f2c51 100644 --- a/src/Framework/MockObject/Invocation/ObjectInvocation.php +++ b/src/Framework/MockObject/Invocation/ObjectInvocation.php @@ -22,7 +22,6 @@ class ObjectInvocation extends StaticInvocation /** * @param string $className * @param string $methodName - * @param array $parameters * @param string $returnType * @param object $object * @param bool $cloneObjects diff --git a/src/Framework/MockObject/Invocation/StaticInvocation.php b/src/Framework/MockObject/Invocation/StaticInvocation.php index 971e2f82fb7..12b328d85fe 100644 --- a/src/Framework/MockObject/Invocation/StaticInvocation.php +++ b/src/Framework/MockObject/Invocation/StaticInvocation.php @@ -73,7 +73,6 @@ class StaticInvocation implements Invocation, SelfDescribing /** * @param string $className * @param string $methodName - * @param array $parameters * @param string $returnType * @param bool $cloneObjects */ diff --git a/src/Framework/MockObject/InvocationMocker.php b/src/Framework/MockObject/InvocationMocker.php index 820840b4a32..d93faaa434f 100644 --- a/src/Framework/MockObject/InvocationMocker.php +++ b/src/Framework/MockObject/InvocationMocker.php @@ -47,19 +47,12 @@ class InvocationMocker implements MatcherCollection, Invokable, NamespaceMatch */ private $returnValueGeneration; - /** - * @param array $configurableMethods - * @param bool $returnValueGeneration - */ public function __construct(array $configurableMethods, bool $returnValueGeneration) { $this->configurableMethods = $configurableMethods; $this->returnValueGeneration = $returnValueGeneration; } - /** - * @param MatcherInvocation $matcher - */ public function addMatcher(MatcherInvocation $matcher): void { $this->matchers[] = $matcher; @@ -77,8 +70,6 @@ public function hasMatchers() } /** - * @param mixed $id - * * @return null|bool */ public function lookupId($id) @@ -86,14 +77,9 @@ public function lookupId($id) if (isset($this->builderMap[$id])) { return $this->builderMap[$id]; } - - return; } /** - * @param mixed $id - * @param Match $builder - * * @throws RuntimeException */ public function registerId($id, Match $builder): void @@ -108,8 +94,6 @@ public function registerId($id, Match $builder): void } /** - * @param MatcherInvocation $matcher - * * @return BuilderInvocationMocker */ public function expects(MatcherInvocation $matcher) @@ -122,11 +106,7 @@ public function expects(MatcherInvocation $matcher) } /** - * @param Invocation $invocation - * * @throws Exception - * - * @return mixed */ public function invoke(Invocation $invocation) { @@ -179,8 +159,6 @@ public function invoke(Invocation $invocation) } /** - * @param Invocation $invocation - * * @return bool */ public function matches(Invocation $invocation) diff --git a/src/Framework/MockObject/Matcher.php b/src/Framework/MockObject/Matcher.php index b6987096ad1..e0552a6d14e 100644 --- a/src/Framework/MockObject/Matcher.php +++ b/src/Framework/MockObject/Matcher.php @@ -59,9 +59,6 @@ class Matcher implements MatcherInvocation */ private $stub; - /** - * @param MatcherInvocation $invocationMatcher - */ public function __construct(MatcherInvocation $invocationMatcher) { $this->invocationMatcher = $invocationMatcher; @@ -113,13 +110,9 @@ public function setAfterMatchBuilderId($id): void } /** - * @param Invocation $invocation - * * @throws \Exception * @throws RuntimeException * @throws ExpectationFailedException - * - * @return mixed */ public function invoked(Invocation $invocation) { @@ -181,8 +174,6 @@ public function invoked(Invocation $invocation) } /** - * @param Invocation $invocation - * * @throws RuntimeException * @throws ExpectationFailedException * @@ -289,9 +280,6 @@ public function verify(): void } } - /** - * @return string - */ public function toString(): string { $list = []; diff --git a/src/Framework/MockObject/Matcher/AnyInvokedCount.php b/src/Framework/MockObject/Matcher/AnyInvokedCount.php index 33155153f15..ddabf92e778 100644 --- a/src/Framework/MockObject/Matcher/AnyInvokedCount.php +++ b/src/Framework/MockObject/Matcher/AnyInvokedCount.php @@ -15,9 +15,6 @@ */ class AnyInvokedCount extends InvokedRecorder { - /** - * @return string - */ public function toString(): string { return 'invoked zero or more times'; diff --git a/src/Framework/MockObject/Matcher/AnyParameters.php b/src/Framework/MockObject/Matcher/AnyParameters.php index fb93ca06864..48eb5610d20 100644 --- a/src/Framework/MockObject/Matcher/AnyParameters.php +++ b/src/Framework/MockObject/Matcher/AnyParameters.php @@ -16,17 +16,12 @@ */ class AnyParameters extends StatelessInvocation { - /** - * @return string - */ public function toString(): string { return 'with any parameters'; } /** - * @param BaseInvocation $invocation - * * @return bool */ public function matches(BaseInvocation $invocation) diff --git a/src/Framework/MockObject/Matcher/ConsecutiveParameters.php b/src/Framework/MockObject/Matcher/ConsecutiveParameters.php index f44749fe489..854b67b3c5c 100644 --- a/src/Framework/MockObject/Matcher/ConsecutiveParameters.php +++ b/src/Framework/MockObject/Matcher/ConsecutiveParameters.php @@ -37,8 +37,6 @@ class ConsecutiveParameters extends StatelessInvocation private $invocations = []; /** - * @param array $parameterGroups - * * @throws \PHPUnit\Framework\Exception */ public function __construct(array $parameterGroups) @@ -54,17 +52,12 @@ public function __construct(array $parameterGroups) } } - /** - * @return string - */ public function toString(): string { return 'with consecutive parameters'; } /** - * @param BaseInvocation $invocation - * * @throws \PHPUnit\Framework\ExpectationFailedException * * @return bool @@ -89,8 +82,7 @@ public function verify(): void /** * Verify a single invocation * - * @param BaseInvocation $invocation - * @param int $callIndex + * @param int $callIndex * * @throws ExpectationFailedException */ diff --git a/src/Framework/MockObject/Matcher/Invocation.php b/src/Framework/MockObject/Matcher/Invocation.php index e4e2fb37111..d3f93b29d33 100644 --- a/src/Framework/MockObject/Matcher/Invocation.php +++ b/src/Framework/MockObject/Matcher/Invocation.php @@ -31,8 +31,6 @@ interface Invocation extends SelfDescribing, Verifiable * If the matcher is a stub it will also have a return value. * * @param BaseInvocation $invocation Object containing information on a mocked or stubbed method which was invoked - * - * @return mixed */ public function invoked(BaseInvocation $invocation); diff --git a/src/Framework/MockObject/Matcher/InvokedAtIndex.php b/src/Framework/MockObject/Matcher/InvokedAtIndex.php index 56483d99319..2584ef3b64c 100644 --- a/src/Framework/MockObject/Matcher/InvokedAtIndex.php +++ b/src/Framework/MockObject/Matcher/InvokedAtIndex.php @@ -42,17 +42,12 @@ public function __construct($sequenceIndex) $this->sequenceIndex = $sequenceIndex; } - /** - * @return string - */ public function toString(): string { return 'invoked at sequence index ' . $this->sequenceIndex; } /** - * @param BaseInvocation $invocation - * * @return bool */ public function matches(BaseInvocation $invocation) @@ -62,9 +57,6 @@ public function matches(BaseInvocation $invocation) return $this->currentIndex == $this->sequenceIndex; } - /** - * @param BaseInvocation $invocation - */ public function invoked(BaseInvocation $invocation): void { } diff --git a/src/Framework/MockObject/Matcher/InvokedAtLeastCount.php b/src/Framework/MockObject/Matcher/InvokedAtLeastCount.php index 03c94be9213..ada506f65cf 100644 --- a/src/Framework/MockObject/Matcher/InvokedAtLeastCount.php +++ b/src/Framework/MockObject/Matcher/InvokedAtLeastCount.php @@ -30,9 +30,6 @@ public function __construct($requiredInvocations) $this->requiredInvocations = $requiredInvocations; } - /** - * @return string - */ public function toString(): string { return 'invoked at least ' . $this->requiredInvocations . ' times'; diff --git a/src/Framework/MockObject/Matcher/InvokedAtLeastOnce.php b/src/Framework/MockObject/Matcher/InvokedAtLeastOnce.php index b6617764020..33b6b8fb10f 100644 --- a/src/Framework/MockObject/Matcher/InvokedAtLeastOnce.php +++ b/src/Framework/MockObject/Matcher/InvokedAtLeastOnce.php @@ -19,9 +19,6 @@ */ class InvokedAtLeastOnce extends InvokedRecorder { - /** - * @return string - */ public function toString(): string { return 'invoked at least once'; diff --git a/src/Framework/MockObject/Matcher/InvokedAtMostCount.php b/src/Framework/MockObject/Matcher/InvokedAtMostCount.php index a25042e352a..981ef362160 100644 --- a/src/Framework/MockObject/Matcher/InvokedAtMostCount.php +++ b/src/Framework/MockObject/Matcher/InvokedAtMostCount.php @@ -30,9 +30,6 @@ public function __construct($allowedInvocations) $this->allowedInvocations = $allowedInvocations; } - /** - * @return string - */ public function toString(): string { return 'invoked at most ' . $this->allowedInvocations . ' times'; diff --git a/src/Framework/MockObject/Matcher/InvokedCount.php b/src/Framework/MockObject/Matcher/InvokedCount.php index db2044bc24b..f4cb1ab24b4 100644 --- a/src/Framework/MockObject/Matcher/InvokedCount.php +++ b/src/Framework/MockObject/Matcher/InvokedCount.php @@ -43,17 +43,12 @@ public function isNever() return $this->expectedCount === 0; } - /** - * @return string - */ public function toString(): string { return 'invoked ' . $this->expectedCount . ' time(s)'; } /** - * @param BaseInvocation $invocation - * * @throws ExpectationFailedException */ public function invoked(BaseInvocation $invocation): void diff --git a/src/Framework/MockObject/Matcher/InvokedRecorder.php b/src/Framework/MockObject/Matcher/InvokedRecorder.php index 7d538779e02..216aae7430b 100644 --- a/src/Framework/MockObject/Matcher/InvokedRecorder.php +++ b/src/Framework/MockObject/Matcher/InvokedRecorder.php @@ -48,17 +48,12 @@ public function hasBeenInvoked() return \count($this->invocations) > 0; } - /** - * @param BaseInvocation $invocation - */ public function invoked(BaseInvocation $invocation): void { $this->invocations[] = $invocation; } /** - * @param BaseInvocation $invocation - * * @return bool */ public function matches(BaseInvocation $invocation) diff --git a/src/Framework/MockObject/Matcher/MethodName.php b/src/Framework/MockObject/Matcher/MethodName.php index 11970e49a48..7aea38a9e38 100644 --- a/src/Framework/MockObject/Matcher/MethodName.php +++ b/src/Framework/MockObject/Matcher/MethodName.php @@ -30,7 +30,6 @@ class MethodName extends StatelessInvocation /** * @param Constraint|string - * @param mixed $constraint * * @throws Constraint * @throws \PHPUnit\Framework\Exception @@ -54,17 +53,12 @@ public function __construct($constraint) $this->constraint = $constraint; } - /** - * @return string - */ public function toString(): string { return 'method name ' . $this->constraint->toString(); } /** - * @param BaseInvocation $invocation - * * @return bool */ public function matches(BaseInvocation $invocation) diff --git a/src/Framework/MockObject/Matcher/Parameters.php b/src/Framework/MockObject/Matcher/Parameters.php index 9cbdf569951..a74e3a3fde6 100644 --- a/src/Framework/MockObject/Matcher/Parameters.php +++ b/src/Framework/MockObject/Matcher/Parameters.php @@ -40,8 +40,6 @@ class Parameters extends StatelessInvocation private $parameterVerificationResult; /** - * @param array $parameters - * * @throws \PHPUnit\Framework\Exception */ public function __construct(array $parameters) @@ -57,9 +55,6 @@ public function __construct(array $parameters) } } - /** - * @return string - */ public function toString(): string { $text = 'with parameter'; @@ -76,8 +71,6 @@ public function toString(): string } /** - * @param BaseInvocation $invocation - * * @throws \Exception * * @return bool diff --git a/src/Framework/MockObject/Matcher/StatelessInvocation.php b/src/Framework/MockObject/Matcher/StatelessInvocation.php index ad93ae7c53c..f4e50a627cd 100644 --- a/src/Framework/MockObject/Matcher/StatelessInvocation.php +++ b/src/Framework/MockObject/Matcher/StatelessInvocation.php @@ -32,8 +32,6 @@ abstract class StatelessInvocation implements Invocation * If the matcher is a stub it will also have a return value. * * @param BaseInvocation $invocation Object containing information on a mocked or stubbed method which was invoked - * - * @return mixed */ public function invoked(BaseInvocation $invocation) { @@ -44,8 +42,6 @@ public function invoked(BaseInvocation $invocation) * the matcher will get the invoked() method called which should check if an * expectation is met. * - * @param Invocation $invocation Object containing information on a mocked or stubbed method which was invoked - * * @return bool */ public function verify() diff --git a/src/Framework/MockObject/MockBuilder.php b/src/Framework/MockObject/MockBuilder.php index 4b1613eb735..8fb0afd1c18 100644 --- a/src/Framework/MockObject/MockBuilder.php +++ b/src/Framework/MockObject/MockBuilder.php @@ -92,7 +92,6 @@ class MockBuilder private $generator; /** - * @param TestCase $testCase * @param array|string $type */ public function __construct(TestCase $testCase, $type) @@ -192,8 +191,6 @@ public function setMethods(array $methods = null) /** * Specifies the subset of methods to not mock. Default is to mock all of them. * - * @param array $methods - * * @return MockBuilder */ public function setMethodsExcept(array $methods = []) @@ -213,8 +210,6 @@ public function setMethodsExcept(array $methods = []) /** * Specifies the arguments for the constructor. * - * @param array $args - * * @return MockBuilder */ public function setConstructorArgs(array $args) diff --git a/src/Framework/MockObject/MockObject.php b/src/Framework/MockObject/MockObject.php index c3cf3f7411f..38c184abc51 100644 --- a/src/Framework/MockObject/MockObject.php +++ b/src/Framework/MockObject/MockObject.php @@ -21,8 +21,6 @@ interface PHPUnit_Framework_MockObject_MockObject /*extends Verifiable*/ { /** - * @param mixed $originalObject - * * @return InvocationMocker */ public function __phpunit_setOriginalObject($originalObject); @@ -51,8 +49,6 @@ public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration); * Registers a new expectation in the mock object and returns the match * object which can be infused with further details. * - * @param Invocation $matcher - * * @return InvocationMocker */ public function expects(Invocation $matcher); diff --git a/src/Framework/MockObject/Stub.php b/src/Framework/MockObject/Stub.php index 835a3ac2602..b0f04f522bb 100644 --- a/src/Framework/MockObject/Stub.php +++ b/src/Framework/MockObject/Stub.php @@ -24,8 +24,6 @@ interface Stub extends SelfDescribing * specific value. * * @param Invocation $invocation The invocation which was mocked and matched by the current method and argument matchers - * - * @return mixed */ public function invoke(Invocation $invocation); } diff --git a/src/Framework/RiskyTest.php b/src/Framework/RiskyTest.php index d49760d99f9..e0132178c97 100644 --- a/src/Framework/RiskyTest.php +++ b/src/Framework/RiskyTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; interface RiskyTest diff --git a/src/Framework/SelfDescribing.php b/src/Framework/SelfDescribing.php index af658eb29a0..faf92904ea5 100644 --- a/src/Framework/SelfDescribing.php +++ b/src/Framework/SelfDescribing.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; /** diff --git a/src/Framework/SkippedTest.php b/src/Framework/SkippedTest.php index d17ac75f0fa..8151f2d8cc1 100644 --- a/src/Framework/SkippedTest.php +++ b/src/Framework/SkippedTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; interface SkippedTest diff --git a/src/Framework/SkippedTestError.php b/src/Framework/SkippedTestError.php index b796a506d57..0893a5dbe6b 100644 --- a/src/Framework/SkippedTestError.php +++ b/src/Framework/SkippedTestError.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class SkippedTestError extends AssertionFailedError implements SkippedTest diff --git a/src/Framework/SkippedTestSuiteError.php b/src/Framework/SkippedTestSuiteError.php index 93a1ed5fb4d..c74015b2040 100644 --- a/src/Framework/SkippedTestSuiteError.php +++ b/src/Framework/SkippedTestSuiteError.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class SkippedTestSuiteError extends AssertionFailedError implements SkippedTest diff --git a/src/Framework/SyntheticError.php b/src/Framework/SyntheticError.php index bc9def44329..db2280f391b 100644 --- a/src/Framework/SyntheticError.php +++ b/src/Framework/SyntheticError.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; /** diff --git a/src/Framework/Test.php b/src/Framework/Test.php index 9a72d66ad17..347a63ff526 100644 --- a/src/Framework/Test.php +++ b/src/Framework/Test.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use Countable; diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php index 2184b9cc94e..9e53841a332 100644 --- a/src/Framework/TestCase.php +++ b/src/Framework/TestCase.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use DeepCopy\DeepCopy; @@ -56,7 +55,7 @@ abstract class TestCase extends Assert implements Test, SelfDescribing { - private const LOCALE_CATEGORIES = [LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME]; + private const LOCALE_CATEGORIES = [\LC_ALL, \LC_COLLATE, \LC_CTYPE, \LC_MONETARY, \LC_NUMERIC, \LC_TIME]; /** * @var bool @@ -334,9 +333,6 @@ public static function at(int $index): InvokedAtIndexMatcher return new InvokedAtIndexMatcher($index); } - /** - * @param mixed $value - */ public static function returnValue($value): ReturnStub { return new ReturnStub($value); @@ -352,9 +348,6 @@ public static function returnArgument(int $argumentIndex): ReturnArgumentStub return new ReturnArgumentStub($argumentIndex); } - /** - * @param mixed $callback - */ public static function returnCallback($callback): ReturnCallbackStub { return new ReturnCallbackStub($callback); @@ -382,7 +375,6 @@ public static function onConsecutiveCalls(...$args): ConsecutiveCallsStub /** * @param string $name - * @param array $data * @param string $dataName */ public function __construct($name = null, array $data = [], $dataName = '') @@ -1026,17 +1018,11 @@ public function isInIsolation(): bool return $this->inIsolation; } - /** - * @return mixed - */ public function getResult() { return $this->testResult; } - /** - * @param mixed $result - */ public function setResult($result): void { $this->testResult = $result; @@ -1139,8 +1125,6 @@ public function getDataSetAsString(bool $includeData = true): string * @throws ExpectationFailedException * @throws SebastianBergmann\ObjectEnumerator\InvalidArgumentException * @throws Throwable - * - * @return mixed */ protected function runTest() { @@ -1248,8 +1232,6 @@ protected function runTest() * resets the modified php.ini setting to its original value after the * test is run. * - * @param mixed $newValue - * * @throws Exception */ protected function iniSet(string $varName, $newValue): void @@ -1284,7 +1266,7 @@ protected function setLocale(...$args): void [$category, $locale] = $args; if (\defined('LC_MESSAGES')) { - $categories[] = LC_MESSAGES; + $categories[] = \LC_MESSAGES; } if (!\in_array($category, self::LOCALE_CATEGORIES, true)) { @@ -1330,7 +1312,6 @@ protected function createMock($originalClassName): MockObject * Returns a configured test double for the specified class. * * @param string|string[] $originalClassName - * @param array $configuration * * @throws Exception * @throws \InvalidArgumentException @@ -1385,7 +1366,6 @@ protected function createTestProxy(string $originalClassName, array $constructor * * @param string $originalClassName * @param array $methods - * @param array $arguments * @param string $mockClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -1418,7 +1398,6 @@ protected function getMockClass($originalClassName, $methods = [], array $argume * To mock concrete methods, use the 7th parameter ($mockedMethods). * * @param string $originalClassName - * @param array $arguments * @param string $mockClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -1454,7 +1433,6 @@ protected function getMockForAbstractClass($originalClassName, array $arguments * @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 * @@ -1465,7 +1443,7 @@ protected function getMockForAbstractClass($originalClassName, array $arguments protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = [], $callOriginalConstructor = true, array $options = []): MockObject { if ($originalClassName === '') { - $originalClassName = \pathinfo(\basename(\parse_url($wsdlFile)['path']), PATHINFO_FILENAME); + $originalClassName = \pathinfo(\basename(\parse_url($wsdlFile)['path']), \PATHINFO_FILENAME); } if (!\class_exists($originalClassName)) { @@ -1500,7 +1478,6 @@ protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClas * `$mockedMethods` parameter. * * @param string $traitName - * @param array $arguments * @param string $mockClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -1534,7 +1511,6 @@ protected function getMockForTrait($traitName, array $arguments = [], $mockClass * Returns an object for the specified trait. * * @param string $traitName - * @param array $arguments * @param string $traitClassName * @param bool $callOriginalConstructor * @param bool $callOriginalClone @@ -1666,7 +1642,7 @@ private function checkRequirements(): void ); if (!empty($missingRequirements)) { - $this->markTestSkipped(\implode(PHP_EOL, $missingRequirements)); + $this->markTestSkipped(\implode(\PHP_EOL, $missingRequirements)); } } diff --git a/src/Framework/TestFailure.php b/src/Framework/TestFailure.php index 1dda756bbbf..fce6af7a7f3 100644 --- a/src/Framework/TestFailure.php +++ b/src/Framework/TestFailure.php @@ -26,6 +26,7 @@ class TestFailure * @var Throwable */ protected $thrownException; + /** * @var string */ @@ -34,8 +35,6 @@ class TestFailure /** * Returns a description for an exception. * - * @param Throwable $e - * * @throws \InvalidArgumentException */ public static function exceptionToString(Throwable $e): string @@ -68,7 +67,6 @@ public static function exceptionToString(Throwable $e): string /** * Constructs a TestFailure with the given test and exception. * - * @param Test $failedTest * @param Throwable $t */ public function __construct(Test $failedTest, $t) diff --git a/src/Framework/TestResult.php b/src/Framework/TestResult.php index a3df32df493..e8a84a1563f 100644 --- a/src/Framework/TestResult.php +++ b/src/Framework/TestResult.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use AssertionError; @@ -588,7 +587,7 @@ public function run(Test $test): void if ($this->convertErrorsToExceptions) { $oldErrorHandler = \set_error_handler( [ErrorHandler::class, 'handleError'], - E_ALL | E_STRICT + \E_ALL | \E_STRICT ); if ($oldErrorHandler === null) { @@ -767,7 +766,7 @@ public function run(Test $test): void $test, new UnintentionallyCoveredCodeError( 'This test executed code that is not listed as code to be covered or used:' . - PHP_EOL . $cce->getMessage() + \PHP_EOL . $cce->getMessage() ), $time ); @@ -776,7 +775,7 @@ public function run(Test $test): void $test, new CoveredCodeNotExecutedException( 'This test did not execute all the code that is listed as code to be covered:' . - PHP_EOL . $cce->getMessage() + \PHP_EOL . $cce->getMessage() ), $time ); diff --git a/src/Framework/TestSuite.php b/src/Framework/TestSuite.php index 7192ab98b72..869911cbd25 100644 --- a/src/Framework/TestSuite.php +++ b/src/Framework/TestSuite.php @@ -81,6 +81,7 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate * @var array */ protected $foundClasses = []; + /** * Last count of tests in this suite. * @@ -104,8 +105,7 @@ class TestSuite implements Test, SelfDescribing, IteratorAggregate private $declaredClasses; /** - * @param ReflectionClass $theClass - * @param string $name + * @param string $name * * @throws Exception */ @@ -305,9 +305,6 @@ public static function createTest(ReflectionClass $theClass, $name): Test return $test; } - /** - * @param ReflectionMethod $method - */ public static function isTestMethod(ReflectionMethod $method): bool { if (\strpos($method->name, 'test') === 0) { @@ -336,7 +333,6 @@ public static function isTestMethod(ReflectionMethod $method): bool * name of an existing class) or constructs an empty TestSuite * with the given name. * - * @param mixed $theClass * @param string $name * * @throws Exception @@ -451,7 +447,6 @@ public function toString(): string /** * Adds a test to the suite. * - * @param Test $test * @param array $groups */ public function addTest(Test $test, $groups = []): void @@ -487,8 +482,6 @@ public function addTest(Test $test, $groups = []): void /** * Adds the tests from the given class to the suite. * - * @param mixed $testClass - * * @throws Exception */ public function addTestSuite($testClass): void @@ -539,8 +532,6 @@ public function addTestSuite($testClass): void * added, a PHPUnit\Framework\WarningTestCase will be created instead, * leaving the current test run untouched. * - * @param string $filename - * * @throws Exception */ public function addTestFile(string $filename): void @@ -682,8 +673,6 @@ public function getGroupDetails() /** * Set tests groups of the test case - * - * @param array $groups */ public function setGroupDetails(array $groups): void { @@ -717,7 +706,7 @@ public function run(TestResult $result = null): TestResult \class_exists($this->name, false) && \method_exists($this->name, $beforeClassMethod)) { if ($missingRequirements = \PHPUnit\Util\Test::getMissingRequirements($this->name, $beforeClassMethod)) { - $this->markTestSuiteSkipped(\implode(PHP_EOL, $missingRequirements)); + $this->markTestSuiteSkipped(\implode(\PHP_EOL, $missingRequirements)); } \call_user_func([$this->name, $beforeClassMethod]); @@ -823,8 +812,6 @@ public function tests(): array /** * Set tests of the test suite - * - * @param array $tests */ public function setTests(array $tests): void { @@ -907,9 +894,6 @@ protected function createResult(): TestResult } /** - * @param ReflectionClass $class - * @param ReflectionMethod $method - * * @throws Exception */ protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method): void diff --git a/src/Runner/BaseTestRunner.php b/src/Runner/BaseTestRunner.php index 9c7fbbcf8d4..899c737eab6 100644 --- a/src/Runner/BaseTestRunner.php +++ b/src/Runner/BaseTestRunner.php @@ -22,13 +22,21 @@ abstract class BaseTestRunner { public const STATUS_UNKNOWN = -1; + public const STATUS_PASSED = 0; + public const STATUS_SKIPPED = 1; + public const STATUS_INCOMPLETE = 2; + public const STATUS_FAILURE = 3; + public const STATUS_ERROR = 4; + public const STATUS_RISKY = 5; + public const STATUS_WARNING = 6; + public const SUITE_METHODNAME = 'suite'; /** @@ -44,8 +52,6 @@ public function getLoader(): TestSuiteLoader * This is a template method, subclasses override * the runFailed() and clearStatus() methods. * - * @param string $suiteClassName - * @param string $suiteClassFile * @param array|string $suffixes * * @throws Exception diff --git a/src/Runner/Filter/Factory.php b/src/Runner/Filter/Factory.php index c5670126853..139e097d712 100644 --- a/src/Runner/Filter/Factory.php +++ b/src/Runner/Filter/Factory.php @@ -23,9 +23,6 @@ class Factory private $filters = []; /** - * @param ReflectionClass $filter - * @param mixed $args - * * @throws InvalidArgumentException */ public function addFilter(ReflectionClass $filter, $args): void diff --git a/src/Runner/Filter/NameFilterIterator.php b/src/Runner/Filter/NameFilterIterator.php index 15057d9baa0..09dfb9d8e4c 100644 --- a/src/Runner/Filter/NameFilterIterator.php +++ b/src/Runner/Filter/NameFilterIterator.php @@ -27,6 +27,7 @@ class NameFilterIterator extends RecursiveFilterIterator * @var int */ protected $filterMin; + /** * @var int */ diff --git a/src/Runner/Hook/AfterIncompleteTestHook.php b/src/Runner/Hook/AfterIncompleteTestHook.php index 1b352d30c66..35ded5d09da 100644 --- a/src/Runner/Hook/AfterIncompleteTestHook.php +++ b/src/Runner/Hook/AfterIncompleteTestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterIncompleteTestHook extends TestHook diff --git a/src/Runner/Hook/AfterLastTestHook.php b/src/Runner/Hook/AfterLastTestHook.php index b5d2e2efd6c..7dee9f9e8b7 100644 --- a/src/Runner/Hook/AfterLastTestHook.php +++ b/src/Runner/Hook/AfterLastTestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterLastTestHook extends Hook diff --git a/src/Runner/Hook/AfterRiskyTestHook.php b/src/Runner/Hook/AfterRiskyTestHook.php index 0a7cb980a85..7fe9ee72ecd 100644 --- a/src/Runner/Hook/AfterRiskyTestHook.php +++ b/src/Runner/Hook/AfterRiskyTestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterRiskyTestHook extends TestHook diff --git a/src/Runner/Hook/AfterSkippedTestHook.php b/src/Runner/Hook/AfterSkippedTestHook.php index 460c81d9ee9..f9253b5ba46 100644 --- a/src/Runner/Hook/AfterSkippedTestHook.php +++ b/src/Runner/Hook/AfterSkippedTestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterSkippedTestHook extends TestHook diff --git a/src/Runner/Hook/AfterSuccessfulTestHook.php b/src/Runner/Hook/AfterSuccessfulTestHook.php index 175f463dbc5..6b55cc877e9 100644 --- a/src/Runner/Hook/AfterSuccessfulTestHook.php +++ b/src/Runner/Hook/AfterSuccessfulTestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterSuccessfulTestHook extends TestHook diff --git a/src/Runner/Hook/AfterTestErrorHook.php b/src/Runner/Hook/AfterTestErrorHook.php index ff2ba0ed84b..f5c23fb2156 100644 --- a/src/Runner/Hook/AfterTestErrorHook.php +++ b/src/Runner/Hook/AfterTestErrorHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterTestErrorHook extends TestHook diff --git a/src/Runner/Hook/AfterTestFailureHook.php b/src/Runner/Hook/AfterTestFailureHook.php index 351667e5275..9ed2939bf13 100644 --- a/src/Runner/Hook/AfterTestFailureHook.php +++ b/src/Runner/Hook/AfterTestFailureHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterTestFailureHook extends TestHook diff --git a/src/Runner/Hook/AfterTestWarningHook.php b/src/Runner/Hook/AfterTestWarningHook.php index 19ec90875a5..12de80f9c91 100644 --- a/src/Runner/Hook/AfterTestWarningHook.php +++ b/src/Runner/Hook/AfterTestWarningHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface AfterTestWarningHook extends TestHook diff --git a/src/Runner/Hook/BeforeFirstTestHook.php b/src/Runner/Hook/BeforeFirstTestHook.php index 99c4dbd2bde..59b66664984 100644 --- a/src/Runner/Hook/BeforeFirstTestHook.php +++ b/src/Runner/Hook/BeforeFirstTestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface BeforeFirstTestHook extends Hook diff --git a/src/Runner/Hook/BeforeTestHook.php b/src/Runner/Hook/BeforeTestHook.php index a0383445bb7..8bbf8a99d77 100644 --- a/src/Runner/Hook/BeforeTestHook.php +++ b/src/Runner/Hook/BeforeTestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface BeforeTestHook extends TestHook diff --git a/src/Runner/Hook/Hook.php b/src/Runner/Hook/Hook.php index 2eeaf5b59fe..546f1a35164 100644 --- a/src/Runner/Hook/Hook.php +++ b/src/Runner/Hook/Hook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface Hook diff --git a/src/Runner/Hook/TestHook.php b/src/Runner/Hook/TestHook.php index 02d7fc6c08a..47c41f9eba7 100644 --- a/src/Runner/Hook/TestHook.php +++ b/src/Runner/Hook/TestHook.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; interface TestHook extends Hook diff --git a/src/Runner/Hook/TestListenerAdapter.php b/src/Runner/Hook/TestListenerAdapter.php index 5be8298fd27..3f922056d42 100644 --- a/src/Runner/Hook/TestListenerAdapter.php +++ b/src/Runner/Hook/TestListenerAdapter.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; use PHPUnit\Framework\AssertionFailedError; diff --git a/src/Runner/PhptTestCase.php b/src/Runner/PhptTestCase.php index f268ade40c4..70940704975 100644 --- a/src/Runner/PhptTestCase.php +++ b/src/Runner/PhptTestCase.php @@ -51,6 +51,7 @@ class PhptTestCase implements Test, SelfDescribing 'safe_mode=0', 'xdebug.default_enable=0' ]; + /** * @var string */ @@ -205,8 +206,6 @@ public function toString(): string * Parse --INI-- section key value pairs and return as array. * * @param array|string - * @param mixed $content - * @param mixed $ini */ private function parseIniSection($content, $ini = []): array { @@ -401,7 +400,7 @@ private function parseExternal(array &$sections): void 'EXPECTF', 'EXPECTREGEX' ]; - $testDirectory = \dirname($this->filename) . DIRECTORY_SEPARATOR; + $testDirectory = \dirname($this->filename) . \DIRECTORY_SEPARATOR; foreach ($allowSections as $section) { if (isset($sections[$section . '_EXTERNAL'])) { @@ -480,7 +479,7 @@ private function render(string $code): string private function getCoverageFiles(): array { - $baseDir = \dirname($this->filename) . DIRECTORY_SEPARATOR; + $baseDir = \dirname($this->filename) . \DIRECTORY_SEPARATOR; $basename = \basename($this->filename, 'phpt'); return [ diff --git a/src/Runner/TestSuiteLoader.php b/src/Runner/TestSuiteLoader.php index 0af0ac8b55e..74cf753f8a9 100644 --- a/src/Runner/TestSuiteLoader.php +++ b/src/Runner/TestSuiteLoader.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; use ReflectionClass; diff --git a/src/Runner/TestSuiteSorter.php b/src/Runner/TestSuiteSorter.php index 45587db8ee7..c15aac873c6 100644 --- a/src/Runner/TestSuiteSorter.php +++ b/src/Runner/TestSuiteSorter.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; use PHPUnit\Framework\Test; diff --git a/src/Runner/Version.php b/src/Runner/Version.php index 56674d9833c..43b2513fea2 100644 --- a/src/Runner/Version.php +++ b/src/Runner/Version.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; use SebastianBergmann\Version as VersionId; @@ -18,6 +17,7 @@ class Version { private static $pharVersion; + private static $version; /** diff --git a/src/TextUI/Command.php b/src/TextUI/Command.php index 828f14c1eaa..ae57ea88acc 100644 --- a/src/TextUI/Command.php +++ b/src/TextUI/Command.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\TextUI; use PharIo\Manifest\ApplicationName; @@ -194,15 +193,13 @@ public function run(array $argv, bool $exit = true): int return $this->handleListTestsXml($suite, $this->arguments['listTestsXml'], $exit); } - unset( - $this->arguments['test'], - $this->arguments['testFile'] + unset($this->arguments['test'], $this->arguments['testFile'] ); try { $result = $runner->doRun($suite, $this->arguments, $exit); } catch (Exception $e) { - print $e->getMessage() . PHP_EOL; + print $e->getMessage() . \PHP_EOL; } $return = TestRunner::FAILURE_EXIT; @@ -386,16 +383,16 @@ protected function handleArguments(array $argv): void case '--generate-configuration': $this->printVersionString(); - print 'Generating phpunit.xml in ' . \getcwd() . PHP_EOL . PHP_EOL; + print 'Generating phpunit.xml in ' . \getcwd() . \PHP_EOL . \PHP_EOL; print 'Bootstrap script (relative to path shown above; default: vendor/autoload.php): '; - $bootstrapScript = \trim(\fgets(STDIN)); + $bootstrapScript = \trim(\fgets(\STDIN)); print 'Tests directory (relative to path shown above; default: tests): '; - $testsDirectory = \trim(\fgets(STDIN)); + $testsDirectory = \trim(\fgets(\STDIN)); print 'Source directory (relative to path shown above; default: src): '; - $src = \trim(\fgets(STDIN)); + $src = \trim(\fgets(\STDIN)); if ($bootstrapScript === '') { $bootstrapScript = 'vendor/autoload.php'; @@ -421,7 +418,7 @@ protected function handleArguments(array $argv): void ) ); - print PHP_EOL . 'Generated phpunit.xml in ' . \getcwd() . PHP_EOL; + print \PHP_EOL . 'Generated phpunit.xml in ' . \getcwd() . \PHP_EOL; exit(TestRunner::SUCCESS_EXIT); @@ -765,7 +762,7 @@ protected function handleArguments(array $argv): void if (isset($includePath)) { \ini_set( 'include_path', - $includePath . PATH_SEPARATOR . \ini_get('include_path') + $includePath . \PATH_SEPARATOR . \ini_get('include_path') ); } @@ -803,7 +800,7 @@ protected function handleArguments(array $argv): void $this->arguments['configuration'] ); } catch (Throwable $t) { - print $t->getMessage() . PHP_EOL; + print $t->getMessage() . \PHP_EOL; exit(TestRunner::FAILURE_EXIT); } @@ -1027,12 +1024,12 @@ protected function handleVersionCheck(): void if ($isOutdated) { \printf( - 'You are not using the latest version of PHPUnit.' . PHP_EOL . - 'The latest version is PHPUnit %s.' . PHP_EOL, + 'You are not using the latest version of PHPUnit.' . \PHP_EOL . + 'The latest version is PHPUnit %s.' . \PHP_EOL, $latestVersion ); } else { - print 'You are using the latest version of PHPUnit.' . PHP_EOL; + print 'You are using the latest version of PHPUnit.' . \PHP_EOL; } exit(TestRunner::SUCCESS_EXIT); @@ -1160,7 +1157,7 @@ private function printVersionString(): void return; } - print Version::getVersionString() . PHP_EOL . PHP_EOL; + print Version::getVersionString() . \PHP_EOL . \PHP_EOL; $this->versionStringPrinted = true; } @@ -1169,7 +1166,7 @@ private function exitWithErrorMessage(string $message): void { $this->printVersionString(); - print $message . PHP_EOL; + print $message . \PHP_EOL; exit(TestRunner::FAILURE_EXIT); } @@ -1217,14 +1214,14 @@ private function handleListGroups(TestSuite $suite, bool $exit): int { $this->printVersionString(); - print 'Available test group(s):' . PHP_EOL; + print 'Available test group(s):' . \PHP_EOL; $groups = $suite->getGroups(); \sort($groups); foreach ($groups as $group) { \printf( - ' - %s' . PHP_EOL, + ' - %s' . \PHP_EOL, $group ); } @@ -1240,7 +1237,7 @@ private function handleListSuites(bool $exit): int { $this->printVersionString(); - print 'Available test suite(s):' . PHP_EOL; + print 'Available test suite(s):' . \PHP_EOL; $configuration = Configuration::getInstance( $this->arguments['configuration'] @@ -1250,7 +1247,7 @@ private function handleListSuites(bool $exit): int foreach ($suiteNames as $suiteName) { \printf( - ' - %s' . PHP_EOL, + ' - %s' . \PHP_EOL, $suiteName ); } diff --git a/src/TextUI/ResultPrinter.php b/src/TextUI/ResultPrinter.php index 7fe0cb18c27..e8b5c30708a 100644 --- a/src/TextUI/ResultPrinter.php +++ b/src/TextUI/ResultPrinter.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\TextUI; use PHPUnit\Framework\AssertionFailedError; @@ -31,13 +30,19 @@ class ResultPrinter extends Printer implements TestListener { public const EVENT_TEST_START = 0; + public const EVENT_TEST_END = 1; + public const EVENT_TESTSUITE_START = 2; + public const EVENT_TESTSUITE_END = 3; public const COLOR_NEVER = 'never'; + public const COLOR_AUTO = 'auto'; + public const COLOR_ALWAYS = 'always'; + public const COLOR_DEFAULT = self::COLOR_NEVER; private const AVAILABLE_COLORS = [self::COLOR_NEVER, self::COLOR_AUTO, self::COLOR_ALWAYS]; @@ -133,12 +138,9 @@ class ResultPrinter extends Printer implements TestListener /** * Constructor. * - * @param mixed $out - * @param bool $verbose * @param string $colors - * @param bool $debug * @param int|string $numberOfColumns - * @param bool $reverse + * @param null|mixed $out * * @throws Exception */ diff --git a/src/TextUI/TestRunner.php b/src/TextUI/TestRunner.php index 6b6f55e35d9..82c0894a037 100644 --- a/src/TextUI/TestRunner.php +++ b/src/TextUI/TestRunner.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\TextUI; use PHPUnit\Framework\Error\Deprecated; @@ -59,7 +58,9 @@ class TestRunner extends BaseTestRunner { public const SUCCESS_EXIT = 0; + public const FAILURE_EXIT = 1; + public const EXCEPTION_EXIT = 2; /** @@ -99,7 +100,6 @@ class TestRunner extends BaseTestRunner /** * @param ReflectionClass|Test $test - * @param array $arguments * @param bool $exit * * @throws \RuntimeException @@ -751,14 +751,14 @@ protected function createTestResult(): TestResult */ protected function runFailed(string $message): void { - $this->write($message . PHP_EOL); + $this->write($message . \PHP_EOL); exit(self::FAILURE_EXIT); } protected function write(string $buffer): void { - if (PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg') { + if (\PHP_SAPI != 'cli' && \PHP_SAPI != 'phpdbg') { $buffer = \htmlspecialchars($buffer); } diff --git a/src/Util/Blacklist.php b/src/Util/Blacklist.php index 6a44da6b320..d2cc0b5d016 100644 --- a/src/Util/Blacklist.php +++ b/src/Util/Blacklist.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use Composer\Autoload\ClassLoader; @@ -118,7 +117,7 @@ private function initialize(): void } // Hide process isolation workaround on Windows. - if (DIRECTORY_SEPARATOR === '\\') { + if (\DIRECTORY_SEPARATOR === '\\') { // tempnam() prefix is limited to first 3 chars. // @see https://php.net/manual/en/function.tempnam.php self::$directories[] = \sys_get_temp_dir() . '\\PHP'; diff --git a/src/Util/Configuration.php b/src/Util/Configuration.php index 21542b654a6..d86b60f76ce 100644 --- a/src/Util/Configuration.php +++ b/src/Util/Configuration.php @@ -532,8 +532,8 @@ public function handlePHPConfiguration(): void if (!empty($configuration['include_path'])) { \ini_set( 'include_path', - \implode(PATH_SEPARATOR, $configuration['include_path']) . - PATH_SEPARATOR . + \implode(\PATH_SEPARATOR, $configuration['include_path']) . + \PATH_SEPARATOR . \ini_get('include_path') ); } @@ -1066,7 +1066,7 @@ private function getTestSuite(DOMElement $testSuiteNode, string $testSuiteFilter continue; } - $phpVersion = PHP_VERSION; + $phpVersion = \PHP_VERSION; $phpVersionOperator = '>='; $prefix = ''; $suffix = 'Test.php'; @@ -1079,7 +1079,7 @@ private function getTestSuite(DOMElement $testSuiteNode, string $testSuiteFilter $phpVersionOperator = (string) $directoryNode->getAttribute('phpVersionOperator'); } - if (!\version_compare(PHP_VERSION, $phpVersion, $phpVersionOperator)) { + if (!\version_compare(\PHP_VERSION, $phpVersion, $phpVersionOperator)) { continue; } @@ -1122,7 +1122,7 @@ private function getTestSuite(DOMElement $testSuiteNode, string $testSuiteFilter } $file = $file[0]; - $phpVersion = PHP_VERSION; + $phpVersion = \PHP_VERSION; $phpVersionOperator = '>='; if ($fileNode->hasAttribute('phpVersion')) { @@ -1133,7 +1133,7 @@ private function getTestSuite(DOMElement $testSuiteNode, string $testSuiteFilter $phpVersionOperator = (string) $fileNode->getAttribute('phpVersionOperator'); } - if (!\version_compare(PHP_VERSION, $phpVersion, $phpVersionOperator)) { + if (!\version_compare(\PHP_VERSION, $phpVersion, $phpVersionOperator)) { continue; } @@ -1148,7 +1148,6 @@ private function getTestSuite(DOMElement $testSuiteNode, string $testSuiteFilter * Otherwise, returns $default, which may be a string in rare cases. * See PHPUnit\Util\ConfigurationTest::testPHPConfigurationIsReadCorrectly * - * @param string $value * @param bool|string $default * * @return bool|string @@ -1257,7 +1256,7 @@ private function toAbsolutePath(string $path, bool $useIncludePath = false): str return $path; } - $file = \dirname($this->filename) . DIRECTORY_SEPARATOR . $path; + $file = \dirname($this->filename) . \DIRECTORY_SEPARATOR . $path; if ($useIncludePath && !\file_exists($file)) { $includePathFile = \stream_resolve_include_path($path); diff --git a/src/Util/ConfigurationGenerator.php b/src/Util/ConfigurationGenerator.php index 3c8e82f694e..655c54dba9c 100644 --- a/src/Util/ConfigurationGenerator.php +++ b/src/Util/ConfigurationGenerator.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; final class ConfigurationGenerator diff --git a/src/Util/ErrorHandler.php b/src/Util/ErrorHandler.php index ed0a380e208..e71cedb9643 100644 --- a/src/Util/ErrorHandler.php +++ b/src/Util/ErrorHandler.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\Error\Deprecated; @@ -47,19 +46,19 @@ public static function handleError(int $errorNumber, string $errorString, string } } - if ($errorNumber === E_NOTICE || $errorNumber === E_USER_NOTICE || $errorNumber === E_STRICT) { + if ($errorNumber === \E_NOTICE || $errorNumber === \E_USER_NOTICE || $errorNumber === \E_STRICT) { if (Notice::$enabled !== true) { return false; } $exception = Notice::class; - } elseif ($errorNumber === E_WARNING || $errorNumber === E_USER_WARNING) { + } elseif ($errorNumber === \E_WARNING || $errorNumber === \E_USER_WARNING) { if (Warning::$enabled !== true) { return false; } $exception = Warning::class; - } elseif ($errorNumber === E_DEPRECATED || $errorNumber === E_USER_DEPRECATED) { + } elseif ($errorNumber === \E_DEPRECATED || $errorNumber === \E_USER_DEPRECATED) { if (Deprecated::$enabled !== true) { return false; } @@ -80,7 +79,7 @@ public static function handleError(int $errorNumber, string $errorString, string * * @throws \Exception if event of specified severity is emitted */ - public static function handleErrorOnce($severity = E_WARNING): callable + public static function handleErrorOnce($severity = \E_WARNING): callable { $terminator = function () { static $expired = false; diff --git a/src/Util/FileLoader.php b/src/Util/FileLoader.php index e1198d2b071..cad4bdc5a74 100644 --- a/src/Util/FileLoader.php +++ b/src/Util/FileLoader.php @@ -29,7 +29,7 @@ final class FileLoader public static function checkAndLoad(string $filename): string { $includePathFilename = \stream_resolve_include_path($filename); - $localFile = __DIR__ . DIRECTORY_SEPARATOR . $filename; + $localFile = __DIR__ . \DIRECTORY_SEPARATOR . $filename; /** * @see https://github.com/sebastianbergmann/phpunit/pull/2751 diff --git a/src/Util/Filesystem.php b/src/Util/Filesystem.php index 6c9932f2713..a2ea804f7ec 100644 --- a/src/Util/Filesystem.php +++ b/src/Util/Filesystem.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; /** @@ -24,7 +23,7 @@ public static function classNameToFilename(string $className): string { return \str_replace( ['_', '\\'], - DIRECTORY_SEPARATOR, + \DIRECTORY_SEPARATOR, $className ) . '.php'; } diff --git a/src/Util/Json.php b/src/Util/Json.php index 23d803f3a47..1cb2c3b243f 100644 --- a/src/Util/Json.php +++ b/src/Util/Json.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\Exception; @@ -29,7 +28,7 @@ public static function prettify(string $json): string ); } - return \json_encode($decodedJson, JSON_PRETTY_PRINT); + return \json_encode($decodedJson, \JSON_PRETTY_PRINT); } /* diff --git a/src/Util/Log/JUnit.php b/src/Util/Log/JUnit.php index 2793ab35310..4a3d193b45a 100644 --- a/src/Util/Log/JUnit.php +++ b/src/Util/Log/JUnit.php @@ -101,8 +101,7 @@ class JUnit extends Printer implements TestListener /** * Constructor. * - * @param mixed $out - * @param bool $reportUselessTests + * @param null|mixed $out * * @throws \PHPUnit\Framework\Exception */ @@ -364,8 +363,6 @@ public function getXML(): string * * This is a "hack" needed for the integration of * PHPUnit with Phing. - * - * @param mixed $flag */ public function setWriteDocument($flag): ?string { @@ -377,8 +374,6 @@ public function setWriteDocument($flag): ?string /** * Method which generalizes addError() and addFailure() * - * @param mixed $type - * * @throws \InvalidArgumentException */ private function doAddFault(Test $test, \Throwable $t, float $time, $type): void diff --git a/src/Util/Log/TeamCity.php b/src/Util/Log/TeamCity.php index f663da8236d..43f601b1a8a 100644 --- a/src/Util/Log/TeamCity.php +++ b/src/Util/Log/TeamCity.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util\Log; use PHPUnit\Framework\AssertionFailedError; @@ -265,9 +264,6 @@ public function startTest(Test $test): void /** * A test ended. - * - * @param Test $test - * @param float $time */ public function endTest(Test $test, float $time): void { @@ -306,9 +302,6 @@ private function printEvent($eventName, $params = []): void $this->write("]\n"); } - /** - * @param \Throwable $t - */ private static function getMessage(\Throwable $t): string { $message = ''; @@ -327,8 +320,6 @@ private static function getMessage(\Throwable $t): string } /** - * @param \Throwable $t - * * @throws \InvalidArgumentException */ private static function getDetails(\Throwable $t): string @@ -348,9 +339,6 @@ private static function getDetails(\Throwable $t): string return ' ' . \str_replace("\n", "\n ", $stackTrace); } - /** - * @param mixed $value - */ private static function getPrimitiveValueAsString($value): ?string { if ($value === null) { @@ -368,9 +356,6 @@ private static function getPrimitiveValueAsString($value): ?string return null; } - /** - * @param string $text - */ private static function escapeValue(string $text): string { return \str_replace( diff --git a/src/Util/PHP/AbstractPhpProcess.php b/src/Util/PHP/AbstractPhpProcess.php index 7cffa6b23f0..99a7907450c 100644 --- a/src/Util/PHP/AbstractPhpProcess.php +++ b/src/Util/PHP/AbstractPhpProcess.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util\PHP; use __PHP_Incomplete_Class; @@ -57,7 +56,7 @@ abstract class AbstractPhpProcess public static function factory(): self { - if (DIRECTORY_SEPARATOR === '\\') { + if (\DIRECTORY_SEPARATOR === '\\') { return new WindowsPhpProcess; } @@ -180,7 +179,7 @@ public function getCommand(array $settings, string $file = null): string $command = $this->runtime->getBinary(); $command .= $this->settingsToParameters($settings); - if (PHP_SAPI === 'phpdbg') { + if (\PHP_SAPI === 'phpdbg') { $command .= ' -qrr '; if ($file) { diff --git a/src/Util/Printer.php b/src/Util/Printer.php index b5cb6d5fd8f..505bce6157d 100644 --- a/src/Util/Printer.php +++ b/src/Util/Printer.php @@ -102,8 +102,8 @@ public function write(string $buffer): void $this->incrementalFlush(); } } else { - if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') { - $buffer = \htmlspecialchars($buffer, ENT_SUBSTITUTE); + if (\PHP_SAPI !== 'cli' && \PHP_SAPI !== 'phpdbg') { + $buffer = \htmlspecialchars($buffer, \ENT_SUBSTITUTE); } print $buffer; diff --git a/src/Util/Test.php b/src/Util/Test.php index 59740c2b968..7544de3ff87 100644 --- a/src/Util/Test.php +++ b/src/Util/Test.php @@ -243,11 +243,11 @@ public static function getMissingRequirements(string $className, string $methodN if (!empty($required['PHP'])) { $operator = empty($required['PHP']['operator']) ? '>=' : $required['PHP']['operator']; - if (!\version_compare(PHP_VERSION, $required['PHP']['version'], $operator)) { + if (!\version_compare(\PHP_VERSION, $required['PHP']['version'], $operator)) { $missing[] = \sprintf('PHP %s %s is required.', $operator, $required['PHP']['version']); } } elseif (!empty($required['PHP_constraint'])) { - $version = new \PharIo\Version\Version(self::sanitizeVersionNumber(PHP_VERSION)); + $version = new \PharIo\Version\Version(self::sanitizeVersionNumber(\PHP_VERSION)); if (!$required['PHP_constraint']['constraint']->complies($version)) { $missing[] = \sprintf( @@ -283,7 +283,7 @@ public static function getMissingRequirements(string $className, string $methodN if (!empty($required['OS'])) { $requiredOsPattern = \sprintf('/%s/i', \addcslashes($required['OS'], '/')); - if (!\preg_match($requiredOsPattern, PHP_OS)) { + if (!\preg_match($requiredOsPattern, \PHP_OS)) { $missing[] = \sprintf('Operating system matching %s is required.', $requiredOsPattern); } } @@ -440,7 +440,7 @@ public static function getDataFromTestWithAnnotation(string $docComment): ?array { $docComment = self::cleanUpMultiLineAnnotation($docComment); - if (\preg_match(self::REGEX_TEST_WITH, $docComment, $matches, PREG_OFFSET_CAPTURE)) { + if (\preg_match(self::REGEX_TEST_WITH, $docComment, $matches, \PREG_OFFSET_CAPTURE)) { $offset = \strlen($matches[0][0]) + $matches[0][1]; $annotationContent = \substr($docComment, $offset); $data = []; @@ -454,7 +454,7 @@ public static function getDataFromTestWithAnnotation(string $docComment): ?array $dataSet = \json_decode($candidateRow, true); - if (\json_last_error() !== JSON_ERROR_NONE) { + if (\json_last_error() !== \JSON_ERROR_NONE) { throw new Exception( 'The data set for the @testWith annotation cannot be parsed: ' . \json_last_error_msg() ); @@ -879,9 +879,8 @@ private static function cleanUpMultiLineAnnotation(string $docComment): string $docComment = \str_replace("\r\n", "\n", $docComment); $docComment = \preg_replace('/' . '\n' . '\s*' . '\*' . '\s?' . '/', "\n", $docComment); $docComment = \substr($docComment, 0, -1); - $docComment = \rtrim($docComment, "\n"); - return $docComment; + return \rtrim($docComment, "\n"); } private static function emptyHookMethodsArray(): array @@ -1083,8 +1082,6 @@ private static function isAfterMethod(ReflectionMethod $method): bool /** * Trims any extensions from version string that follows after * the .[.] format - * - * @return mixed */ private static function sanitizeVersionNumber(string $version) { diff --git a/src/Util/TestDox/HtmlResultPrinter.php b/src/Util/TestDox/HtmlResultPrinter.php index e4d89a0ef3e..71675434f17 100644 --- a/src/Util/TestDox/HtmlResultPrinter.php +++ b/src/Util/TestDox/HtmlResultPrinter.php @@ -100,8 +100,6 @@ protected function startClass(string $name): void /** * Handler for 'on test' event. - * - * @param mixed $name */ protected function onTest($name, bool $success = true): void { diff --git a/src/Util/TestDox/NamePrettifier.php b/src/Util/TestDox/NamePrettifier.php index 4974f247a13..c0cb44bdc43 100644 --- a/src/Util/TestDox/NamePrettifier.php +++ b/src/Util/TestDox/NamePrettifier.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util\TestDox; /** diff --git a/src/Util/TestDox/ResultPrinter.php b/src/Util/TestDox/ResultPrinter.php index d35d094a304..edf2a36b1ac 100644 --- a/src/Util/TestDox/ResultPrinter.php +++ b/src/Util/TestDox/ResultPrinter.php @@ -96,8 +96,6 @@ abstract class ResultPrinter extends Printer implements TestListener /** * @param resource $out - * @param array $groups - * @param array $excludeGroups * * @throws \PHPUnit\Framework\Exception */ @@ -304,8 +302,6 @@ protected function startClass(string $name): void /** * Handler for 'on test' event. - * - * @param mixed $name */ protected function onTest($name, bool $success = true): void { diff --git a/src/Util/TestDox/TextResultPrinter.php b/src/Util/TestDox/TextResultPrinter.php index a9cd66c4764..818a0ac59e5 100644 --- a/src/Util/TestDox/TextResultPrinter.php +++ b/src/Util/TestDox/TextResultPrinter.php @@ -25,8 +25,6 @@ protected function startClass(string $name): void /** * Handler for 'on test' event. - * - * @param mixed $name */ protected function onTest($name, bool $success = true): void { diff --git a/src/Util/TestDox/XmlResultPrinter.php b/src/Util/TestDox/XmlResultPrinter.php index a3d08d0cb17..104c8157ccd 100644 --- a/src/Util/TestDox/XmlResultPrinter.php +++ b/src/Util/TestDox/XmlResultPrinter.php @@ -170,7 +170,7 @@ function ($group) { $inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(\get_class($test), $test->getName()); - if (isset($inlineAnnotations['given']) && isset($inlineAnnotations['when']) && isset($inlineAnnotations['then'])) { + if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) { $node->setAttribute('given', $inlineAnnotations['given']['value']); $node->setAttribute('givenStartLine', $inlineAnnotations['given']['line']); $node->setAttribute('when', $inlineAnnotations['when']['value']); diff --git a/src/Util/TextTestListRenderer.php b/src/Util/TextTestListRenderer.php index ee004bf572e..467a41e2b34 100644 --- a/src/Util/TextTestListRenderer.php +++ b/src/Util/TextTestListRenderer.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\TestCase; @@ -18,7 +17,7 @@ final class TextTestListRenderer { public function render(TestSuite $suite): string { - $buffer = 'Available test(s):' . PHP_EOL; + $buffer = 'Available test(s):' . \PHP_EOL; foreach (new \RecursiveIteratorIterator($suite->getIterator()) as $test) { if ($test instanceof TestCase) { @@ -34,7 +33,7 @@ public function render(TestSuite $suite): string } $buffer .= \sprintf( - ' - %s' . PHP_EOL, + ' - %s' . \PHP_EOL, $name ); } diff --git a/src/Util/Type.php b/src/Util/Type.php index 7aecb63d8ac..587761eaae1 100644 --- a/src/Util/Type.php +++ b/src/Util/Type.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; final class Type diff --git a/src/Util/Xml.php b/src/Util/Xml.php index 09e751b0b28..f807b0ca237 100644 --- a/src/Util/Xml.php +++ b/src/Util/Xml.php @@ -34,10 +34,6 @@ final class Xml * DOMDocument, use loadFile() instead. * * @param DOMDocument|string $actual - * @param bool $isHtml - * @param string $filename - * @param bool $xinclude - * @param bool $strict * * @throws Exception */ @@ -165,15 +161,13 @@ public static function prepareString(string $string): string '', \htmlspecialchars( self::convertToUtf8($string), - ENT_QUOTES + \ENT_QUOTES ) ); } /** * "Convert" a DOMElement object into a PHP variable. - * - * @return mixed */ public static function xmlToVariable(DOMElement $element) { diff --git a/src/Util/XmlTestListRenderer.php b/src/Util/XmlTestListRenderer.php index a05f5d3b1c3..e374a871b12 100644 --- a/src/Util/XmlTestListRenderer.php +++ b/src/Util/XmlTestListRenderer.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\TestCase; diff --git a/tests/Framework/AssertTest.php b/tests/Framework/AssertTest.php index b8b8a4e3192..b98461c3602 100644 --- a/tests/Framework/AssertTest.php +++ b/tests/Framework/AssertTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use PHPUnit\Util\Xml; @@ -32,7 +31,7 @@ public static function validInvalidJsonDataprovider() protected function setUp(): void { - $this->filesDirectory = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; + $this->filesDirectory = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR; } public function testFail(): void @@ -229,9 +228,6 @@ public function testAssertArraySubsetWithStrictCheckAndObjects(): void /** * @dataProvider assertArraySubsetInvalidArgumentProvider * - * @param mixed $partial - * @param mixed $subject - * * @throws Exception * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -542,12 +538,6 @@ public function notSameProvider() /** * @dataProvider equalProvider * - * @param mixed $a - * @param mixed $b - * @param mixed $delta - * @param mixed $canonicalize - * @param mixed $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -559,12 +549,6 @@ public function testAssertEqualsSucceeds($a, $b, $delta = 0.0, $canonicalize = f /** * @dataProvider notEqualProvider * - * @param mixed $a - * @param mixed $b - * @param mixed $delta - * @param mixed $canonicalize - * @param mixed $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -578,12 +562,6 @@ public function testAssertEqualsFails($a, $b, $delta = 0.0, $canonicalize = fals /** * @dataProvider notEqualProvider * - * @param mixed $a - * @param mixed $b - * @param mixed $delta - * @param mixed $canonicalize - * @param mixed $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -595,12 +573,6 @@ public function testAssertNotEqualsSucceeds($a, $b, $delta = 0.0, $canonicalize /** * @dataProvider equalProvider * - * @param mixed $a - * @param mixed $b - * @param mixed $delta - * @param mixed $canonicalize - * @param mixed $ignoreCase - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -614,9 +586,6 @@ public function testAssertNotEqualsFails($a, $b, $delta = 0.0, $canonicalize = f /** * @dataProvider sameProvider * - * @param mixed $a - * @param mixed $b - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -628,9 +597,6 @@ public function testAssertSameSucceeds($a, $b): void /** * @dataProvider notSameProvider * - * @param mixed $a - * @param mixed $b - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -644,9 +610,6 @@ public function testAssertSameFails($a, $b): void /** * @dataProvider notSameProvider * - * @param mixed $a - * @param mixed $b - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -658,9 +621,6 @@ public function testAssertNotSameSucceeds($a, $b): void /** * @dataProvider sameProvider * - * @param mixed $a - * @param mixed $b - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -895,7 +855,7 @@ public function testAssertIsReadable(): void $this->expectException(AssertionFailedError::class); - $this->assertIsReadable(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertIsReadable(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertNotIsReadable(): void @@ -911,7 +871,7 @@ public function testAssertIsWritable(): void $this->expectException(AssertionFailedError::class); - $this->assertIsWritable(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertIsWritable(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertNotIsWritable(): void @@ -927,12 +887,12 @@ public function testAssertDirectoryExists(): void $this->expectException(AssertionFailedError::class); - $this->assertDirectoryExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertDirectoryExists(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertDirectoryNotExists(): void { - $this->assertDirectoryNotExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertDirectoryNotExists(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); $this->expectException(AssertionFailedError::class); @@ -945,7 +905,7 @@ public function testAssertDirectoryIsReadable(): void $this->expectException(AssertionFailedError::class); - $this->assertDirectoryIsReadable(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertDirectoryIsReadable(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertDirectoryIsWritable(): void @@ -954,7 +914,7 @@ public function testAssertDirectoryIsWritable(): void $this->expectException(AssertionFailedError::class); - $this->assertDirectoryIsWritable(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertDirectoryIsWritable(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertFileExists(): void @@ -963,12 +923,12 @@ public function testAssertFileExists(): void $this->expectException(AssertionFailedError::class); - $this->assertFileExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertFileExists(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertFileNotExists(): void { - $this->assertFileNotExists(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertFileNotExists(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); $this->expectException(AssertionFailedError::class); @@ -981,7 +941,7 @@ public function testAssertFileIsReadable(): void $this->expectException(AssertionFailedError::class); - $this->assertFileIsReadable(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertFileIsReadable(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertFileIsWritable(): void @@ -990,7 +950,7 @@ public function testAssertFileIsWritable(): void $this->expectException(AssertionFailedError::class); - $this->assertFileIsWritable(__DIR__ . DIRECTORY_SEPARATOR . 'NotExisting'); + $this->assertFileIsWritable(__DIR__ . \DIRECTORY_SEPARATOR . 'NotExisting'); } public function testAssertObjectHasAttribute(): void @@ -1021,12 +981,12 @@ public function testAssertFinite(): void $this->expectException(AssertionFailedError::class); - $this->assertFinite(INF); + $this->assertFinite(\INF); } public function testAssertInfinite(): void { - $this->assertInfinite(INF); + $this->assertInfinite(\INF); $this->expectException(AssertionFailedError::class); @@ -1035,7 +995,7 @@ public function testAssertInfinite(): void public function testAssertNan(): void { - $this->assertNan(NAN); + $this->assertNan(\NAN); $this->expectException(AssertionFailedError::class); @@ -2366,9 +2326,6 @@ public function testAssertJsonStringEqualsJsonString(): void /** * @dataProvider validInvalidJsonDataprovider * - * @param mixed $expected - * @param mixed $actual - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2391,9 +2348,6 @@ public function testAssertJsonStringNotEqualsJsonString(): void /** * @dataProvider validInvalidJsonDataprovider * - * @param mixed $expected - * @param mixed $actual - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -2573,7 +2527,7 @@ protected function sameValues() $object = new \SampleClass(4, 8, 15); // cannot use $filesDirectory, because neither setUp() nor // setUpBeforeClass() are executed before the data providers - $file = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'foo.xml'; + $file = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'foo.xml'; $resource = \fopen($file, 'r'); return [ @@ -2624,7 +2578,7 @@ protected function notEqualValues() // cannot use $filesDirectory, because neither setUp() nor // setUpBeforeClass() are executed before the data providers - $file = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'foo.xml'; + $file = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'foo.xml'; return [ // strings @@ -2643,7 +2597,7 @@ protected function notEqualValues() [new \Struct(2.3), new \Struct(4.2), 0.5], [[new \Struct(2.3)], [new \Struct(4.2)], 0.5], // NAN - [NAN, NAN], + [\NAN, \NAN], // arrays [[], [0 => 1]], [[0 => 1], []], diff --git a/tests/Framework/Constraint/ArrayHasKeyTest.php b/tests/Framework/Constraint/ArrayHasKeyTest.php index dafe28f3ac2..f7a5bbce32e 100644 --- a/tests/Framework/Constraint/ArrayHasKeyTest.php +++ b/tests/Framework/Constraint/ArrayHasKeyTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/ArraySubsetTest.php b/tests/Framework/Constraint/ArraySubsetTest.php index 9cf24ae337a..d887f952f89 100644 --- a/tests/Framework/Constraint/ArraySubsetTest.php +++ b/tests/Framework/Constraint/ArraySubsetTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/AttributeTest.php b/tests/Framework/Constraint/AttributeTest.php index 6a41e60b25a..b7ea107bd85 100644 --- a/tests/Framework/Constraint/AttributeTest.php +++ b/tests/Framework/Constraint/AttributeTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/CallbackTest.php b/tests/Framework/Constraint/CallbackTest.php index b906629c742..7eef19af965 100644 --- a/tests/Framework/Constraint/CallbackTest.php +++ b/tests/Framework/Constraint/CallbackTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/ClassHasAttributeTest.php b/tests/Framework/Constraint/ClassHasAttributeTest.php index 13abab8c7ef..be203c9442b 100644 --- a/tests/Framework/Constraint/ClassHasAttributeTest.php +++ b/tests/Framework/Constraint/ClassHasAttributeTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/ClassHasStaticAttributeTest.php b/tests/Framework/Constraint/ClassHasStaticAttributeTest.php index 02099d92f5b..35991e7592d 100644 --- a/tests/Framework/Constraint/ClassHasStaticAttributeTest.php +++ b/tests/Framework/Constraint/ClassHasStaticAttributeTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/ConstraintTestCase.php b/tests/Framework/Constraint/ConstraintTestCase.php index 2e39e47adc5..a278e7955e7 100644 --- a/tests/Framework/Constraint/ConstraintTestCase.php +++ b/tests/Framework/Constraint/ConstraintTestCase.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\SelfDescribing; @@ -43,8 +42,6 @@ final public function testIsSelfDescribing(): void /** * Returns the class name of the constraint. - * - * @return string */ final protected function className(): string { diff --git a/tests/Framework/Constraint/CountTest.php b/tests/Framework/Constraint/CountTest.php index 71a2b3bd360..5656939e4d9 100644 --- a/tests/Framework/Constraint/CountTest.php +++ b/tests/Framework/Constraint/CountTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; class CountTest extends ConstraintTestCase diff --git a/tests/Framework/Constraint/DirectoryExistsTest.php b/tests/Framework/Constraint/DirectoryExistsTest.php index 887e64247c4..98eae50f508 100644 --- a/tests/Framework/Constraint/DirectoryExistsTest.php +++ b/tests/Framework/Constraint/DirectoryExistsTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/ExceptionMessageRegExpTest.php b/tests/Framework/Constraint/ExceptionMessageRegExpTest.php index 82915efb447..4052f8cf4a4 100644 --- a/tests/Framework/Constraint/ExceptionMessageRegExpTest.php +++ b/tests/Framework/Constraint/ExceptionMessageRegExpTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\TestCase; diff --git a/tests/Framework/Constraint/ExceptionMessageTest.php b/tests/Framework/Constraint/ExceptionMessageTest.php index 76fe778f5f3..fafb2f57685 100644 --- a/tests/Framework/Constraint/ExceptionMessageTest.php +++ b/tests/Framework/Constraint/ExceptionMessageTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\TestCase; diff --git a/tests/Framework/Constraint/FileExistsTest.php b/tests/Framework/Constraint/FileExistsTest.php index e5942bfd2ef..7c6911d87ad 100644 --- a/tests/Framework/Constraint/FileExistsTest.php +++ b/tests/Framework/Constraint/FileExistsTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/GreaterThanTest.php b/tests/Framework/Constraint/GreaterThanTest.php index 4ba6d6d2863..e62bdf76a7d 100644 --- a/tests/Framework/Constraint/GreaterThanTest.php +++ b/tests/Framework/Constraint/GreaterThanTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/IsEmptyTest.php b/tests/Framework/Constraint/IsEmptyTest.php index 5e68d07eb00..d5a03d416c7 100644 --- a/tests/Framework/Constraint/IsEmptyTest.php +++ b/tests/Framework/Constraint/IsEmptyTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/IsEqualTest.php b/tests/Framework/Constraint/IsEqualTest.php index b208bd82b8c..65987787de3 100644 --- a/tests/Framework/Constraint/IsEqualTest.php +++ b/tests/Framework/Constraint/IsEqualTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; @@ -44,10 +43,6 @@ public function testConstraintIsEqual(): void /** * @dataProvider isEqualProvider - * - * @param mixed $expected - * @param mixed $actual - * @param mixed $message */ public function testConstraintIsEqual2($expected, $actual, $message): void { diff --git a/tests/Framework/Constraint/IsIdenticalTest.php b/tests/Framework/Constraint/IsIdenticalTest.php index ef53b843b3f..b7e31ba0f41 100644 --- a/tests/Framework/Constraint/IsIdenticalTest.php +++ b/tests/Framework/Constraint/IsIdenticalTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/IsInstanceOfTest.php b/tests/Framework/Constraint/IsInstanceOfTest.php index 61a8e7fdd5b..ff66ba6d580 100644 --- a/tests/Framework/Constraint/IsInstanceOfTest.php +++ b/tests/Framework/Constraint/IsInstanceOfTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/IsJsonTest.php b/tests/Framework/Constraint/IsJsonTest.php index 3e5b5beee84..49f7811cf9c 100644 --- a/tests/Framework/Constraint/IsJsonTest.php +++ b/tests/Framework/Constraint/IsJsonTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; class IsJsonTest extends ConstraintTestCase @@ -23,9 +22,6 @@ public static function evaluateDataprovider() /** * @dataProvider evaluateDataprovider * - * @param mixed $expected - * @param mixed $jsonOther - * * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ diff --git a/tests/Framework/Constraint/IsNullTest.php b/tests/Framework/Constraint/IsNullTest.php index d371bedae68..cc5e01a4e67 100644 --- a/tests/Framework/Constraint/IsNullTest.php +++ b/tests/Framework/Constraint/IsNullTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/IsReadableTest.php b/tests/Framework/Constraint/IsReadableTest.php index 7083c2b87bb..30c5593e69b 100644 --- a/tests/Framework/Constraint/IsReadableTest.php +++ b/tests/Framework/Constraint/IsReadableTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/IsTypeTest.php b/tests/Framework/Constraint/IsTypeTest.php index 8504da0755f..effe57b6520 100644 --- a/tests/Framework/Constraint/IsTypeTest.php +++ b/tests/Framework/Constraint/IsTypeTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\Assert; @@ -68,8 +67,6 @@ public function testConstraintIsType2(): void /** * @dataProvider resources - * - * @param mixed $resource */ public function testConstraintIsResourceTypeEvaluatesCorrectlyWithResources($resource): void { diff --git a/tests/Framework/Constraint/IsWritableTest.php b/tests/Framework/Constraint/IsWritableTest.php index bbceea7d55c..e2e2476ac62 100644 --- a/tests/Framework/Constraint/IsWritableTest.php +++ b/tests/Framework/Constraint/IsWritableTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php b/tests/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php index 4d5b10658f0..b1bac85f592 100644 --- a/tests/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php +++ b/tests/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\TestCase; @@ -21,23 +20,23 @@ public static function determineJsonErrorDataprovider() null, 'json_error_none', '' ], 'JSON_ERROR_DEPTH' => [ - 'Maximum stack depth exceeded', JSON_ERROR_DEPTH, '' + 'Maximum stack depth exceeded', \JSON_ERROR_DEPTH, '' ], 'prefixed JSON_ERROR_DEPTH' => [ - 'TUX: Maximum stack depth exceeded', JSON_ERROR_DEPTH, 'TUX: ' + 'TUX: Maximum stack depth exceeded', \JSON_ERROR_DEPTH, 'TUX: ' ], 'JSON_ERROR_STATE_MISMatch' => [ - 'Underflow or the modes mismatch', JSON_ERROR_STATE_MISMATCH, '' + 'Underflow or the modes mismatch', \JSON_ERROR_STATE_MISMATCH, '' ], 'JSON_ERROR_CTRL_CHAR' => [ - 'Unexpected control character found', JSON_ERROR_CTRL_CHAR, '' + 'Unexpected control character found', \JSON_ERROR_CTRL_CHAR, '' ], 'JSON_ERROR_SYNTAX' => [ - 'Syntax error, malformed JSON', JSON_ERROR_SYNTAX, '' + 'Syntax error, malformed JSON', \JSON_ERROR_SYNTAX, '' ], 'JSON_ERROR_UTF8`' => [ 'Malformed UTF-8 characters, possibly incorrectly encoded', - JSON_ERROR_UTF8, + \JSON_ERROR_UTF8, '' ], 'Invalid error indicator' => [ @@ -58,9 +57,6 @@ public static function translateTypeToPrefixDataprovider() /** * @dataProvider translateTypeToPrefixDataprovider * - * @param mixed $expected - * @param mixed $type - * * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -75,10 +71,6 @@ public function testTranslateTypeToPrefix($expected, $type): void /** * @dataProvider determineJsonErrorDataprovider * - * @param mixed $expected - * @param mixed $error - * @param mixed $prefix - * * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ diff --git a/tests/Framework/Constraint/JsonMatchesTest.php b/tests/Framework/Constraint/JsonMatchesTest.php index 1a7b440c033..f48c109da52 100644 --- a/tests/Framework/Constraint/JsonMatchesTest.php +++ b/tests/Framework/Constraint/JsonMatchesTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; @@ -51,10 +50,6 @@ public static function evaluateThrowsExpectationFailedExceptionWhenJsonIsValidBu /** * @dataProvider evaluateDataprovider * - * @param mixed $expected - * @param mixed $jsonOther - * @param mixed $jsonValue - * * @throws ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -68,9 +63,6 @@ public function testEvaluate($expected, $jsonOther, $jsonValue): void /** * @dataProvider evaluateThrowsExpectationFailedExceptionWhenJsonIsValidButDoesNotMatchDataprovider * - * @param mixed $jsonOther - * @param mixed $jsonValue - * * @throws ExpectationFailedException * @throws \PHPUnit\Framework\AssertionFailedError * @throws \PHPUnit\Framework\Exception diff --git a/tests/Framework/Constraint/LessThanTest.php b/tests/Framework/Constraint/LessThanTest.php index f98a449a8e1..b21f02f206f 100644 --- a/tests/Framework/Constraint/LessThanTest.php +++ b/tests/Framework/Constraint/LessThanTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/LogicalAndTest.php b/tests/Framework/Constraint/LogicalAndTest.php index 0f279ae4819..6f94da3745c 100644 --- a/tests/Framework/Constraint/LogicalAndTest.php +++ b/tests/Framework/Constraint/LogicalAndTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\Exception; diff --git a/tests/Framework/Constraint/LogicalOrTest.php b/tests/Framework/Constraint/LogicalOrTest.php index fa3479646cc..db9437cafad 100644 --- a/tests/Framework/Constraint/LogicalOrTest.php +++ b/tests/Framework/Constraint/LogicalOrTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/ObjectHasAttributeTest.php b/tests/Framework/Constraint/ObjectHasAttributeTest.php index 5bf08dc0442..3c042cf1516 100644 --- a/tests/Framework/Constraint/ObjectHasAttributeTest.php +++ b/tests/Framework/Constraint/ObjectHasAttributeTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/RegularExpressionTest.php b/tests/Framework/Constraint/RegularExpressionTest.php index 6c50033c099..176c86fbe34 100644 --- a/tests/Framework/Constraint/RegularExpressionTest.php +++ b/tests/Framework/Constraint/RegularExpressionTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/SameSizeTest.php b/tests/Framework/Constraint/SameSizeTest.php index dd595a0d695..9e24f7ff6df 100644 --- a/tests/Framework/Constraint/SameSizeTest.php +++ b/tests/Framework/Constraint/SameSizeTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/StringContainsTest.php b/tests/Framework/Constraint/StringContainsTest.php index 26f4a6ea313..b056128c988 100644 --- a/tests/Framework/Constraint/StringContainsTest.php +++ b/tests/Framework/Constraint/StringContainsTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/StringEndsWithTest.php b/tests/Framework/Constraint/StringEndsWithTest.php index 8a06a94eed3..481cf3e0d6c 100644 --- a/tests/Framework/Constraint/StringEndsWithTest.php +++ b/tests/Framework/Constraint/StringEndsWithTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/StringMatchesFormatDescriptionTest.php b/tests/Framework/Constraint/StringMatchesFormatDescriptionTest.php index 393b43bd896..55c2785636c 100644 --- a/tests/Framework/Constraint/StringMatchesFormatDescriptionTest.php +++ b/tests/Framework/Constraint/StringMatchesFormatDescriptionTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/StringStartsWithTest.php b/tests/Framework/Constraint/StringStartsWithTest.php index 993b102582e..37a91c47cad 100644 --- a/tests/Framework/Constraint/StringStartsWithTest.php +++ b/tests/Framework/Constraint/StringStartsWithTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/Constraint/TraversableContainsTest.php b/tests/Framework/Constraint/TraversableContainsTest.php index a238e90274b..aa7ba3aacd2 100644 --- a/tests/Framework/Constraint/TraversableContainsTest.php +++ b/tests/Framework/Constraint/TraversableContainsTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework\Constraint; use PHPUnit\Framework\ExpectationFailedException; diff --git a/tests/Framework/ConstraintTest.php b/tests/Framework/ConstraintTest.php index b3b88d37c2f..c683968245e 100644 --- a/tests/Framework/ConstraintTest.php +++ b/tests/Framework/ConstraintTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use PHPUnit\Framework\Constraint\Count; @@ -72,7 +71,7 @@ public function testConstraintArrayNotHasKey2(): void public function testConstraintFileNotExists(): void { - $file = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; + $file = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; $constraint = Assert::logicalNot( Assert::fileExists() @@ -102,7 +101,7 @@ public function testConstraintFileNotExists(): void public function testConstraintFileNotExists2(): void { - $file = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; + $file = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'ClassWithNonPublicAttributes.php'; $constraint = Assert::logicalNot( Assert::fileExists() diff --git a/tests/Framework/ExceptionWrapperTest.php b/tests/Framework/ExceptionWrapperTest.php index b005084433f..f0d85f03a0d 100644 --- a/tests/Framework/ExceptionWrapperTest.php +++ b/tests/Framework/ExceptionWrapperTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class ExceptionWrapperTest extends TestCase diff --git a/tests/Framework/MockObject/GeneratorTest.php b/tests/Framework/MockObject/GeneratorTest.php index c79363c0f42..ae11b53f85e 100644 --- a/tests/Framework/MockObject/GeneratorTest.php +++ b/tests/Framework/MockObject/GeneratorTest.php @@ -111,9 +111,6 @@ public function testGetMockForAbstractClassShouldCreateStubsOnlyForAbstractMetho /** * @dataProvider getMockForAbstractClassExpectsInvalidArgumentExceptionDataprovider - * - * @param mixed $className - * @param mixed $mockClassName */ public function testGetMockForAbstractClassExpectingInvalidArgumentException($className, $mockClassName): void { diff --git a/tests/Framework/MockObject/Invocation/ObjectInvocationTest.php b/tests/Framework/MockObject/Invocation/ObjectInvocationTest.php index 743bdbb4818..4d0cfa9463c 100644 --- a/tests/Framework/MockObject/Invocation/ObjectInvocationTest.php +++ b/tests/Framework/MockObject/Invocation/ObjectInvocationTest.php @@ -71,7 +71,7 @@ public function testAllowToGetObjectSetInConstructor(): void public function testAllowToGetMethodParametersSetInConstructor(): void { $expectedParameters = [ - 'foo', 5, ['a', 'b'], new stdClass, null, false + 'foo', 5, ['a', 'b'], new stdClass, null, false ]; $invocation = new ObjectInvocation( diff --git a/tests/Framework/MockObject/Invocation/StaticInvocationTest.php b/tests/Framework/MockObject/Invocation/StaticInvocationTest.php index 6e9fca736c1..2b98c6c0740 100644 --- a/tests/Framework/MockObject/Invocation/StaticInvocationTest.php +++ b/tests/Framework/MockObject/Invocation/StaticInvocationTest.php @@ -53,7 +53,7 @@ public function testAllowToGetMethodNameSetInConstructor(): void public function testAllowToGetMethodParametersSetInConstructor(): void { $expectedParameters = [ - 'foo', 5, ['a', 'b'], new stdClass, null, false + 'foo', 5, ['a', 'b'], new stdClass, null, false ]; $invocation = new StaticInvocation( diff --git a/tests/Framework/MockObject/MockObjectTest.php b/tests/Framework/MockObject/MockObjectTest.php index a5a15c93083..806468ab61f 100644 --- a/tests/Framework/MockObject/MockObjectTest.php +++ b/tests/Framework/MockObject/MockObjectTest.php @@ -476,8 +476,6 @@ public function testGetMockForAbstractClass(): void /** * @dataProvider traversableProvider - * - * @param mixed $type */ public function testGetMockForTraversable($type): void { @@ -1005,12 +1003,12 @@ public function testStringableClassCanBeMocked(): void public function traversableProvider() { return [ - ['Traversable'], - ['\Traversable'], - ['TraversableMockTestInterface'], - [['Traversable']], - [['Iterator', 'Traversable']], - [['\Iterator', '\Traversable']] + ['Traversable'], + ['\Traversable'], + ['TraversableMockTestInterface'], + [['Traversable']], + [['Iterator', 'Traversable']], + [['\Iterator', '\Traversable']] ]; } diff --git a/tests/Framework/TestCaseTest.php b/tests/Framework/TestCaseTest.php index 5d35b93bf04..5c3b24efad2 100644 --- a/tests/Framework/TestCaseTest.php +++ b/tests/Framework/TestCaseTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use PHPUnit\Framework\MockObject\MockObject; @@ -16,6 +15,7 @@ class TestCaseTest extends TestCase { protected static $testStatic = 0; + protected $backupGlobalsBlacklist = ['i', 'singleton']; public static function setUpBeforeClass(): void @@ -573,14 +573,14 @@ public function testSkipsProvidesMessagesForAllSkippingReasons(): void $test->run(); $this->assertEquals( - 'PHP >= 99-dev is required.' . PHP_EOL . - 'PHPUnit >= 9-dev is required.' . PHP_EOL . - 'Operating system matching /DOESNOTEXIST/i is required.' . PHP_EOL . - 'Function testFuncOne is required.' . PHP_EOL . - 'Function testFuncTwo is required.' . PHP_EOL . - 'Setting "not_a_setting" must be "Off".' . PHP_EOL . - 'Extension testExtOne is required.' . PHP_EOL . - 'Extension testExtTwo is required.' . PHP_EOL . + 'PHP >= 99-dev is required.' . \PHP_EOL . + 'PHPUnit >= 9-dev is required.' . \PHP_EOL . + 'Operating system matching /DOESNOTEXIST/i is required.' . \PHP_EOL . + 'Function testFuncOne is required.' . \PHP_EOL . + 'Function testFuncTwo is required.' . \PHP_EOL . + 'Setting "not_a_setting" must be "Off".' . \PHP_EOL . + 'Extension testExtOne is required.' . \PHP_EOL . + 'Extension testExtTwo is required.' . \PHP_EOL . 'Extension testExtThree >= 2.0 is required.', $test->getStatusMessage() ); diff --git a/tests/Framework/TestFailureTest.php b/tests/Framework/TestFailureTest.php index 26b8ebdf58f..5654a1a2374 100644 --- a/tests/Framework/TestFailureTest.php +++ b/tests/Framework/TestFailureTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class TestFailureTest extends TestCase diff --git a/tests/Framework/TestImplementorTest.php b/tests/Framework/TestImplementorTest.php index a17b16e048d..67ca038004c 100644 --- a/tests/Framework/TestImplementorTest.php +++ b/tests/Framework/TestImplementorTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class TestImplementorTest extends TestCase diff --git a/tests/Framework/TestListenerTest.php b/tests/Framework/TestListenerTest.php index fe4a727b83b..f0ac4079219 100644 --- a/tests/Framework/TestListenerTest.php +++ b/tests/Framework/TestListenerTest.php @@ -7,19 +7,26 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class TestListenerTest extends TestCase implements TestListener { protected $endCount; + protected $errorCount; + protected $failureCount; + protected $warningCount; + protected $notImplementedCount; + protected $riskyCount; + protected $skippedCount; + protected $result; + protected $startCount; protected function setUp(): void diff --git a/tests/Framework/TestSuiteTest.php b/tests/Framework/TestSuiteTest.php index 7bceb56c221..fdf526f389b 100644 --- a/tests/Framework/TestSuiteTest.php +++ b/tests/Framework/TestSuiteTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; class TestSuiteTest extends TestCase @@ -192,7 +191,7 @@ public function testDoNotSkipInheritedClass(): void 'DontSkipInheritedClass' ); - $dir = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'Inheritance' . DIRECTORY_SEPARATOR; + $dir = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'Inheritance' . \DIRECTORY_SEPARATOR; $suite->addTestFile($dir . 'InheritanceA.php'); $suite->addTestFile($dir . 'InheritanceB.php'); diff --git a/tests/Regression/GitHub/1337/Issue1337Test.php b/tests/Regression/GitHub/1337/Issue1337Test.php index 0678dbbaf75..0a90ad11f5e 100644 --- a/tests/Regression/GitHub/1337/Issue1337Test.php +++ b/tests/Regression/GitHub/1337/Issue1337Test.php @@ -13,8 +13,6 @@ class Issue1337Test extends TestCase { /** * @dataProvider dataProvider - * - * @param mixed $a */ public function testProvider($a): void { @@ -24,8 +22,8 @@ public function testProvider($a): void public function dataProvider() { return [ - 'c:\\'=> [true], - 0.9 => [true] + 'c:\\'=> [true], + 0.9 => [true] ]; } } diff --git a/tests/Regression/GitHub/1348/Issue1348Test.php b/tests/Regression/GitHub/1348/Issue1348Test.php index 0ab9a14ce9d..2f42b4edfd1 100644 --- a/tests/Regression/GitHub/1348/Issue1348Test.php +++ b/tests/Regression/GitHub/1348/Issue1348Test.php @@ -13,12 +13,12 @@ class Issue1348Test extends TestCase { public function testSTDOUT(): void { - \fwrite(STDOUT, "\nSTDOUT does not break test result\n"); + \fwrite(\STDOUT, "\nSTDOUT does not break test result\n"); $this->assertTrue(true); } public function testSTDERR(): void { - \fwrite(STDERR, 'STDERR works as usual.'); + \fwrite(\STDERR, 'STDERR works as usual.'); } } diff --git a/tests/Regression/GitHub/2137/Issue2137Test.php b/tests/Regression/GitHub/2137/Issue2137Test.php index 0e3aa5a0e6b..e620af2b86c 100644 --- a/tests/Regression/GitHub/2137/Issue2137Test.php +++ b/tests/Regression/GitHub/2137/Issue2137Test.php @@ -12,9 +12,6 @@ class Issue2137Test extends PHPUnit\Framework\TestCase /** * @dataProvider provideBrandService * - * @param mixed $provided - * @param mixed $expected - * * @throws Exception * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -35,9 +32,6 @@ public function provideBrandService() /** * @dataProvider provideBrandService * - * @param mixed $provided - * @param mixed $expected - * * @throws Exception * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException diff --git a/tests/Regression/GitHub/2366/Issue2366Test.php b/tests/Regression/GitHub/2366/Issue2366Test.php index b7790c64d35..8a03d7b115a 100644 --- a/tests/Regression/GitHub/2366/Issue2366Test.php +++ b/tests/Regression/GitHub/2366/Issue2366Test.php @@ -21,8 +21,6 @@ class Issue2366Test extends TestCase { /** * @dataProvider provider - * - * @param mixed $o */ public function testOne($o): void { diff --git a/tests/Regression/GitHub/2380/Issue2380Test.php b/tests/Regression/GitHub/2380/Issue2380Test.php index abc36be101e..78ada8f52ce 100644 --- a/tests/Regression/GitHub/2380/Issue2380Test.php +++ b/tests/Regression/GitHub/2380/Issue2380Test.php @@ -13,8 +13,6 @@ class Issue2380Test extends TestCase { /** * @dataProvider generatorData - * - * @param mixed $data */ public function testGeneratorProvider($data): void { diff --git a/tests/Regression/GitHub/2382/Issue2382Test.php b/tests/Regression/GitHub/2382/Issue2382Test.php index b12349b9777..9466691c8a8 100644 --- a/tests/Regression/GitHub/2382/Issue2382Test.php +++ b/tests/Regression/GitHub/2382/Issue2382Test.php @@ -13,8 +13,6 @@ class Issue2382Test extends TestCase { /** * @dataProvider dataProvider - * - * @param mixed $test */ public function testOne($test): void { diff --git a/tests/Regression/GitHub/2724/SeparateClassRunMethodInNewProcessTest.php b/tests/Regression/GitHub/2724/SeparateClassRunMethodInNewProcessTest.php index 1c73862d6ab..d76dfe07058 100644 --- a/tests/Regression/GitHub/2724/SeparateClassRunMethodInNewProcessTest.php +++ b/tests/Regression/GitHub/2724/SeparateClassRunMethodInNewProcessTest.php @@ -14,10 +14,13 @@ class SeparateClassRunMethodInNewProcessTest extends PHPUnit\Framework\TestCase { const PROCESS_ID_FILE_PATH = __DIR__ . '/parent_process_id.txt'; + const INITIAL_MASTER_PID = 0; + const INITIAL_PID1 = 1; public static $masterPid = self::INITIAL_MASTER_PID; + public static $pid1 = self::INITIAL_PID1; public static function setUpBeforeClass(): void diff --git a/tests/Regression/GitHub/3156/Issue3156Test.php b/tests/Regression/GitHub/3156/Issue3156Test.php index d4eec8544d7..ef652fdf9c5 100644 --- a/tests/Regression/GitHub/3156/Issue3156Test.php +++ b/tests/Regression/GitHub/3156/Issue3156Test.php @@ -8,7 +8,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Regression/GitHub/498/Issue498Test.php b/tests/Regression/GitHub/498/Issue498Test.php index b049421f218..0f8a9df23ae 100644 --- a/tests/Regression/GitHub/498/Issue498Test.php +++ b/tests/Regression/GitHub/498/Issue498Test.php @@ -15,8 +15,6 @@ class Issue498Test extends TestCase * @test * @dataProvider shouldBeTrueDataProvider * @group falseOnly - * - * @param mixed $testData */ public function shouldBeTrue($testData): void { @@ -27,8 +25,6 @@ public function shouldBeTrue($testData): void * @test * @dataProvider shouldBeFalseDataProvider * @group trueOnly - * - * @param mixed $testData */ public function shouldBeFalse($testData): void { diff --git a/tests/Regression/GitHub/765/Issue765Test.php b/tests/Regression/GitHub/765/Issue765Test.php index 577761959d0..0a487e2b8d6 100644 --- a/tests/Regression/GitHub/765/Issue765Test.php +++ b/tests/Regression/GitHub/765/Issue765Test.php @@ -19,8 +19,6 @@ public function testDependee(): void /** * @depends testDependee * @dataProvider dependentProvider - * - * @param mixed $a */ public function testDependent($a): void { diff --git a/tests/Regression/Trac/1021/Issue1021Test.php b/tests/Regression/Trac/1021/Issue1021Test.php index 13877f7afb2..cf11f1651cb 100644 --- a/tests/Regression/Trac/1021/Issue1021Test.php +++ b/tests/Regression/Trac/1021/Issue1021Test.php @@ -13,8 +13,6 @@ class Issue1021Test extends TestCase { /** * @dataProvider provider - * - * @param mixed $data */ public function testSomething($data): void { diff --git a/tests/Regression/Trac/578/Issue578Test.php b/tests/Regression/Trac/578/Issue578Test.php index 2a0b239162a..b7cde2cb2df 100644 --- a/tests/Regression/Trac/578/Issue578Test.php +++ b/tests/Regression/Trac/578/Issue578Test.php @@ -13,14 +13,14 @@ class Issue578Test extends TestCase { public function testNoticesDoublePrintStackTrace(): void { - $this->iniSet('error_reporting', E_ALL | E_NOTICE); - \trigger_error('Stack Trace Test Notice', E_NOTICE); + $this->iniSet('error_reporting', \E_ALL | \E_NOTICE); + \trigger_error('Stack Trace Test Notice', \E_NOTICE); } public function testWarningsDoublePrintStackTrace(): void { - $this->iniSet('error_reporting', E_ALL | E_NOTICE); - \trigger_error('Stack Trace Test Notice', E_WARNING); + $this->iniSet('error_reporting', \E_ALL | \E_NOTICE); + \trigger_error('Stack Trace Test Notice', \E_WARNING); } public function testUnexpectedExceptionsPrintsCorrectly(): void diff --git a/tests/Runner/PhptTestCaseTest.php b/tests/Runner/PhptTestCaseTest.php index c500ca99416..4ab2865bb38 100644 --- a/tests/Runner/PhptTestCaseTest.php +++ b/tests/Runner/PhptTestCaseTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Runner; use PHPUnit\Framework\TestCase; @@ -89,7 +88,7 @@ public function testShouldRunFileSectionAsTest(): void { $this->setPhpContent($this->ensureCorrectEndOfLine(self::EXPECT_CONTENT)); - $fileSection = '' . PHP_EOL; + $fileSection = '' . \PHP_EOL; $this->phpProcess ->expects($this->once()) @@ -113,7 +112,7 @@ public function testRenderFileSection(): void EOF )); - $renderedCode = "dirname . "' . '" . $this->filename . "'; ?>" . PHP_EOL; + $renderedCode = "dirname . "' . '" . $this->filename . "'; ?>" . \PHP_EOL; $this->phpProcess ->expects($this->once()) @@ -126,13 +125,13 @@ public function testRenderFileSection(): void public function testRenderSkipifSection(): void { - $phptContent = self::EXPECT_CONTENT . PHP_EOL; - $phptContent .= '--SKIPIF--' . PHP_EOL; - $phptContent .= "" . PHP_EOL; + $phptContent = self::EXPECT_CONTENT . \PHP_EOL; + $phptContent .= '--SKIPIF--' . \PHP_EOL; + $phptContent .= "" . \PHP_EOL; $this->setPhpContent($phptContent); - $renderedCode = "filename . "'; ?>" . PHP_EOL; + $renderedCode = "filename . "'; ?>" . \PHP_EOL; $this->phpProcess ->expects($this->at(0)) @@ -145,10 +144,10 @@ public function testRenderSkipifSection(): void public function testShouldRunSkipifSectionWhenExists(): void { - $skipifSection = '' . PHP_EOL; + $skipifSection = '' . \PHP_EOL; - $phptContent = self::EXPECT_CONTENT . PHP_EOL; - $phptContent .= '--SKIPIF--' . PHP_EOL; + $phptContent = self::EXPECT_CONTENT . \PHP_EOL; + $phptContent .= '--SKIPIF--' . \PHP_EOL; $phptContent .= $skipifSection; $this->setPhpContent($phptContent); @@ -164,10 +163,10 @@ public function testShouldRunSkipifSectionWhenExists(): void public function testShouldNotRunTestSectionIfSkipifSectionReturnsOutputWithSkipWord(): void { - $skipifSection = '' . PHP_EOL; + $skipifSection = '' . \PHP_EOL; - $phptContent = self::EXPECT_CONTENT . PHP_EOL; - $phptContent .= '--SKIPIF--' . PHP_EOL; + $phptContent = self::EXPECT_CONTENT . \PHP_EOL; + $phptContent .= '--SKIPIF--' . \PHP_EOL; $phptContent .= $skipifSection; $this->setPhpContent($phptContent); @@ -183,10 +182,10 @@ public function testShouldNotRunTestSectionIfSkipifSectionReturnsOutputWithSkipW public function testShouldRunCleanSectionWhenDefined(): void { - $cleanSection = '' . PHP_EOL; + $cleanSection = '' . \PHP_EOL; - $phptContent = self::EXPECT_CONTENT . PHP_EOL; - $phptContent .= '--CLEAN--' . PHP_EOL; + $phptContent = self::EXPECT_CONTENT . \PHP_EOL; + $phptContent .= '--CLEAN--' . \PHP_EOL; $phptContent .= $cleanSection; $this->setPhpContent($phptContent); @@ -312,9 +311,9 @@ private function ensureCorrectEndOfLine($content) return \strtr( $content, [ - "\r\n" => PHP_EOL, - "\r" => PHP_EOL, - "\n" => PHP_EOL + "\r\n" => \PHP_EOL, + "\r" => \PHP_EOL, + "\n" => \PHP_EOL ] ); } diff --git a/tests/Runner/TestSuiteSorterTest.php b/tests/Runner/TestSuiteSorterTest.php index 82967dce853..cdf08044af2 100644 --- a/tests/Runner/TestSuiteSorterTest.php +++ b/tests/Runner/TestSuiteSorterTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Framework; use PHPUnit\Runner\TestSuiteSorter; diff --git a/tests/TextUI/_files/Extension.php b/tests/TextUI/_files/Extension.php index 3936f0d4822..ea0f707083f 100644 --- a/tests/TextUI/_files/Extension.php +++ b/tests/TextUI/_files/Extension.php @@ -31,57 +31,57 @@ public function __construct() public function tellAmountOfInjectedArguments(): void { - print __METHOD__ . ': ' . $this->amountOfInjectedArguments . PHP_EOL; + print __METHOD__ . ': ' . $this->amountOfInjectedArguments . \PHP_EOL; } public function executeBeforeFirstTest(): void { $this->tellAmountOfInjectedArguments(); - print __METHOD__ . PHP_EOL; + print __METHOD__ . \PHP_EOL; } public function executeBeforeTest(string $test): void { - print __METHOD__ . ': ' . $test . PHP_EOL; + print __METHOD__ . ': ' . $test . \PHP_EOL; } public function executeAfterSuccessfulTest(string $test, float $time): void { - print __METHOD__ . ': ' . $test . PHP_EOL; + print __METHOD__ . ': ' . $test . \PHP_EOL; } public function executeAfterIncompleteTest(string $test, string $message, float $time): void { - print __METHOD__ . ': ' . $test . ': ' . $message . PHP_EOL; + print __METHOD__ . ': ' . $test . ': ' . $message . \PHP_EOL; } public function executeAfterRiskyTest(string $test, string $message, float $time): void { - print __METHOD__ . ': ' . $test . ': ' . $message . PHP_EOL; + print __METHOD__ . ': ' . $test . ': ' . $message . \PHP_EOL; } public function executeAfterSkippedTest(string $test, string $message, float $time): void { - print __METHOD__ . ': ' . $test . ': ' . $message . PHP_EOL; + print __METHOD__ . ': ' . $test . ': ' . $message . \PHP_EOL; } public function executeAfterTestError(string $test, string $message, float $time): void { - print __METHOD__ . ': ' . $test . ': ' . $message . PHP_EOL; + print __METHOD__ . ': ' . $test . ': ' . $message . \PHP_EOL; } public function executeAfterTestFailure(string $test, string $message, float $time): void { - print __METHOD__ . ': ' . $test . ': ' . $message . PHP_EOL; + print __METHOD__ . ': ' . $test . ': ' . $message . \PHP_EOL; } public function executeAfterTestWarning(string $test, string $message, float $time): void { - print __METHOD__ . ': ' . $test . ': ' . $message . PHP_EOL; + print __METHOD__ . ': ' . $test . ': ' . $message . \PHP_EOL; } public function executeAfterLastTest(): void { - print __METHOD__ . PHP_EOL; + print __METHOD__ . \PHP_EOL; } } diff --git a/tests/Util/ConfigurationGeneratorTest.php b/tests/Util/ConfigurationGeneratorTest.php index e1678f68ab0..70f4073d631 100644 --- a/tests/Util/ConfigurationGeneratorTest.php +++ b/tests/Util/ConfigurationGeneratorTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\TestCase; diff --git a/tests/Util/ConfigurationTest.php b/tests/Util/ConfigurationTest.php index 738ae98452c..dcccfd8e210 100644 --- a/tests/Util/ConfigurationTest.php +++ b/tests/Util/ConfigurationTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\Exception; @@ -25,7 +24,7 @@ class ConfigurationTest extends TestCase protected function setUp(): void { $this->configuration = Configuration::getInstance( - \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.xml' + \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.xml' ); } @@ -38,7 +37,7 @@ public function testExceptionIsThrownForNotExistingConfigurationFile(): void public function testShouldReadColorsWhenTrueInConfigurationFile(): void { - $configurationFilename = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.true.xml'; + $configurationFilename = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.colors.true.xml'; $configurationInstance = Configuration::getInstance($configurationFilename); $configurationValues = $configurationInstance->getPHPUnitConfiguration(); @@ -47,7 +46,7 @@ public function testShouldReadColorsWhenTrueInConfigurationFile(): void public function testShouldReadColorsWhenFalseInConfigurationFile(): void { - $configurationFilename = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.false.xml'; + $configurationFilename = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.colors.false.xml'; $configurationInstance = Configuration::getInstance($configurationFilename); $configurationValues = $configurationInstance->getPHPUnitConfiguration(); @@ -56,7 +55,7 @@ public function testShouldReadColorsWhenFalseInConfigurationFile(): void public function testShouldReadColorsWhenEmptyInConfigurationFile(): void { - $configurationFilename = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.empty.xml'; + $configurationFilename = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.colors.empty.xml'; $configurationInstance = Configuration::getInstance($configurationFilename); $configurationValues = $configurationInstance->getPHPUnitConfiguration(); @@ -65,7 +64,7 @@ public function testShouldReadColorsWhenEmptyInConfigurationFile(): void public function testShouldReadColorsWhenInvalidInConfigurationFile(): void { - $configurationFilename = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.invalid.xml'; + $configurationFilename = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.colors.invalid.xml'; $configurationInstance = Configuration::getInstance($configurationFilename); $configurationValues = $configurationInstance->getPHPUnitConfiguration(); @@ -74,7 +73,7 @@ public function testShouldReadColorsWhenInvalidInConfigurationFile(): void public function testInvalidConfigurationGeneratesValidationErrors(): void { - $configurationFilename = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.colors.invalid.xml'; + $configurationFilename = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.colors.invalid.xml'; $configurationInstance = Configuration::getInstance($configurationFilename); $this->assertTrue($configurationInstance->hasValidationErrors()); @@ -83,7 +82,7 @@ public function testInvalidConfigurationGeneratesValidationErrors(): void public function testNonIntegerValueReturnsDefault(): void { - $configurationFilename = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.columns.default.xml'; + $configurationFilename = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.columns.default.xml'; $configurationInstance = Configuration::getInstance($configurationFilename); $configurationValues = $configurationInstance->getPHPUnitConfiguration(); @@ -97,8 +96,8 @@ public function testNonIntegerValueReturnsDefault(): void */ public function testConfigurationRootOptions(string $optionName, string $optionValue, $expected): void { - $tmpFilename = \sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'phpunit.' . $optionName . \uniqid() . '.xml'; - $xml = "" . PHP_EOL; + $tmpFilename = \sys_get_temp_dir() . \DIRECTORY_SEPARATOR . 'phpunit.' . $optionName . \uniqid() . '.xml'; + $xml = "" . \PHP_EOL; \file_put_contents($tmpFilename, $xml); $configurationInstance = Configuration::getInstance($tmpFilename); @@ -136,46 +135,37 @@ public function testFilterConfigurationIsReadCorrectly(): void { $this->assertEquals( [ - 'whitelist' => - [ - 'addUncoveredFilesFromWhitelist' => true, - 'processUncoveredFilesFromWhitelist' => false, - 'include' => - [ - 'directory' => - [ - 0 => - [ - 'path' => '/path/to/files', - 'prefix' => '', - 'suffix' => '.php', - 'group' => 'DEFAULT' - ], - ], - 'file' => - [ - 0 => '/path/to/file', - 1 => '/path/to/file', - ], + 'whitelist' => [ + 'addUncoveredFilesFromWhitelist' => true, + 'processUncoveredFilesFromWhitelist' => false, + 'include' => [ + 'directory' => [ + 0 => [ + 'path' => '/path/to/files', + 'prefix' => '', + 'suffix' => '.php', + 'group' => 'DEFAULT' ], - 'exclude' => - [ - 'directory' => - [ - 0 => - [ - 'path' => '/path/to/files', - 'prefix' => '', - 'suffix' => '.php', - 'group' => 'DEFAULT' - ], - ], - 'file' => - [ - 0 => '/path/to/file', - ], + ], + 'file' => [ + 0 => '/path/to/file', + 1 => '/path/to/file', + ], + ], + 'exclude' => [ + 'directory' => [ + 0 => [ + 'path' => '/path/to/files', + 'prefix' => '', + 'suffix' => '.php', + 'group' => 'DEFAULT' ], + ], + 'file' => [ + 0 => '/path/to/file', + ], ], + ], ], $this->configuration->getFilterConfiguration() ); @@ -185,14 +175,12 @@ public function testGroupConfigurationIsReadCorrectly(): void { $this->assertEquals( [ - 'include' => - [ - 0 => 'name', - ], - 'exclude' => - [ - 0 => 'name', - ], + 'include' => [ + 0 => 'name', + ], + 'exclude' => [ + 0 => 'name', + ], ], $this->configuration->getGroupConfiguration() ); @@ -202,14 +190,12 @@ public function testTestdoxGroupConfigurationIsReadCorrectly(): void { $this->assertEquals( [ - 'include' => - [ - 0 => 'name', - ], - 'exclude' => - [ - 0 => 'name', - ], + 'include' => [ + 0 => 'name', + ], + 'exclude' => [ + 0 => 'name', + ], ], $this->configuration->getTestdoxGroupConfiguration() ); @@ -220,30 +206,27 @@ public function testListenerConfigurationIsReadCorrectly(): void $dir = __DIR__; $includePath = \ini_get('include_path'); - \ini_set('include_path', $dir . PATH_SEPARATOR . $includePath); + \ini_set('include_path', $dir . \PATH_SEPARATOR . $includePath); $this->assertEquals( [ - 0 => - [ - 'class' => 'MyListener', - 'file' => '/optional/path/to/MyListener.php', - 'arguments' => - [ - 0 => - [ - 0 => 'Sebastian', - ], - 1 => 22, - 2 => 'April', - 3 => 19.78, - 4 => null, - 5 => new \stdClass, - 6 => \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyTestFile.php', - 7 => \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyRelativePath', - 8 => true, - ], + 0 => [ + 'class' => 'MyListener', + 'file' => '/optional/path/to/MyListener.php', + 'arguments' => [ + 0 => [ + 0 => 'Sebastian', + ], + 1 => 22, + 2 => 'April', + 3 => 19.78, + 4 => null, + 5 => new \stdClass, + 6 => \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'MyTestFile.php', + 7 => \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'MyRelativePath', + 8 => true, ], + ], [ 'class' => 'IncludePathListener', 'file' => __FILE__, @@ -252,11 +235,10 @@ public function testListenerConfigurationIsReadCorrectly(): void [ 'class' => 'CompactArgumentsListener', 'file' => '/CompactArgumentsListener.php', - 'arguments' => - [ - 0 => 42, - 1 => false, - ], + 'arguments' => [ + 0 => 42, + 1 => false, + ], ], ], $this->configuration->getListenerConfiguration() @@ -270,29 +252,26 @@ public function testExtensionConfigurationIsReadCorrectly(): void $dir = __DIR__; $includePath = \ini_get('include_path'); - \ini_set('include_path', $dir . PATH_SEPARATOR . $includePath); + \ini_set('include_path', $dir . \PATH_SEPARATOR . $includePath); $this->assertEquals( [ - 0 => - [ - 'class' => 'MyExtension', - 'file' => '/optional/path/to/MyExtension.php', - 'arguments' => - [ - 0 => - [ - 0 => 'Sebastian', - ], - 1 => 22, - 2 => 'April', - 3 => 19.78, - 4 => null, - 5 => new \stdClass, - 6 => \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyTestFile.php', - 7 => \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'MyRelativePath', - ], + 0 => [ + 'class' => 'MyExtension', + 'file' => '/optional/path/to/MyExtension.php', + 'arguments' => [ + 0 => [ + 0 => 'Sebastian', + ], + 1 => 22, + 2 => 'April', + 3 => 19.78, + 4 => null, + 5 => new \stdClass, + 6 => \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'MyTestFile.php', + 7 => \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'MyRelativePath', ], + ], [ 'class' => 'IncludePathExtension', 'file' => __FILE__, @@ -301,10 +280,9 @@ public function testExtensionConfigurationIsReadCorrectly(): void [ 'class' => 'CompactArgumentsExtension', 'file' => '/CompactArgumentsExtension.php', - 'arguments' => - [ - 0 => 42 - ], + 'arguments' => [ + 0 => 42 + ], ], ], $this->configuration->getExtensionConfiguration() @@ -342,11 +320,10 @@ public function testPHPConfigurationIsReadCorrectly(): void { $this->assertEquals( [ - 'include_path' => - [ - \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.', - '/path/to/lib' - ], + 'include_path' => [ + \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . '.', + '/path/to/lib' + ], 'ini' => ['foo' => ['value' => 'bar']], 'const' => ['FOO' => ['value' => false], 'BAR' => ['value' => true]], 'var' => ['foo' => ['value' => false]], @@ -369,7 +346,7 @@ public function testPHPConfigurationIsHandledCorrectly(): void { $this->configuration->handlePHPConfiguration(); - $path = \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . '.' . PATH_SEPARATOR . '/path/to/lib'; + $path = \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . '.' . \PATH_SEPARATOR . '/path/to/lib'; $this->assertStringStartsWith($path, \ini_get('include_path')); $this->assertFalse(\FOO); $this->assertTrue(\BAR); @@ -486,7 +463,7 @@ public function testPHPUnitConfigurationIsReadCorrectly(): void public function testXincludeInConfiguration(): void { $configurationWithXinclude = Configuration::getInstance( - \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration_xinclude.xml' + \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration_xinclude.xml' ); $this->assertConfigurationEquals( @@ -501,7 +478,7 @@ public function testXincludeInConfiguration(): void public function testWithEmptyConfigurations(): void { $emptyConfiguration = Configuration::getInstance( - \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration_empty.xml' + \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration_empty.xml' ); $logging = $emptyConfiguration->getLoggingConfiguration(); @@ -528,7 +505,7 @@ public function testWithEmptyConfigurations(): void public function testGetTestSuiteNamesReturnsTheNamesIfDefined(): void { $configuration = Configuration::getInstance( - \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.suites.xml' + \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.suites.xml' ); $names = $configuration->getTestSuiteNames(); @@ -539,7 +516,7 @@ public function testGetTestSuiteNamesReturnsTheNamesIfDefined(): void public function testTestSuiteConfigurationForASingleFileInASuite(): void { $configuration = Configuration::getInstance( - \dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'configuration.one-file-suite.xml' + \dirname(__DIR__) . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR . 'configuration.one-file-suite.xml' ); $config = $configuration->getTestSuiteConfiguration(); @@ -551,9 +528,6 @@ public function testTestSuiteConfigurationForASingleFileInASuite(): void /** * Asserts that the values in $actualConfiguration equal $expectedConfiguration. * - * @param Configuration $expectedConfiguration - * @param Configuration $actualConfiguration - * * @throws Exception * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException diff --git a/tests/Util/GetoptTest.php b/tests/Util/GetoptTest.php index 4546fa9223e..be9ae97575d 100644 --- a/tests/Util/GetoptTest.php +++ b/tests/Util/GetoptTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\Exception; diff --git a/tests/Util/GlobalStateTest.php b/tests/Util/GlobalStateTest.php index 2767a229535..c2a2ecc448d 100644 --- a/tests/Util/GlobalStateTest.php +++ b/tests/Util/GlobalStateTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\TestCase; diff --git a/tests/Util/JsonTest.php b/tests/Util/JsonTest.php index 9cfff9611fb..04eaf7aaeb0 100644 --- a/tests/Util/JsonTest.php +++ b/tests/Util/JsonTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\TestCase; @@ -17,10 +16,6 @@ class JsonTest extends TestCase /** * @dataProvider canonicalizeProvider * - * @param mixed $actual - * @param mixed $expected - * @param mixed $expectError - * * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException */ @@ -49,9 +44,6 @@ public function canonicalizeProvider() /** * @dataProvider prettifyProvider * - * @param mixed $actual - * @param mixed $expected - * * @throws \PHPUnit\Framework\Exception * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -75,8 +67,6 @@ public function prettifyProvider() * @dataProvider prettifyExceptionProvider * @expectedException \PHPUnit\Framework\Exception * @expectedExceptionMessage Cannot prettify invalid json - * - * @param mixed $json */ public function testPrettifyException($json): void { diff --git a/tests/Util/PHP/AbstractPhpProcessTest.php b/tests/Util/PHP/AbstractPhpProcessTest.php index 93e26dc3f23..5544a0985e9 100644 --- a/tests/Util/PHP/AbstractPhpProcessTest.php +++ b/tests/Util/PHP/AbstractPhpProcessTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util\PHP; use PHPUnit\Framework\TestCase; @@ -84,7 +83,7 @@ public function testShouldUseArgsToCreateCommand(): void public function testShouldHaveFileToCreateCommand(): void { - $argumentEscapingCharacter = DIRECTORY_SEPARATOR === '\\' ? '"' : '\''; + $argumentEscapingCharacter = \DIRECTORY_SEPARATOR === '\\' ? '"' : '\''; $expectedCommandFormat = \sprintf('%%s -%%c %1$sfile.php%1$s', $argumentEscapingCharacter); $actualCommand = $this->phpProcess->getCommand([], 'file.php'); diff --git a/tests/Util/RegularExpressionTest.php b/tests/Util/RegularExpressionTest.php index 90191dc34d6..6d5494e9eda 100644 --- a/tests/Util/RegularExpressionTest.php +++ b/tests/Util/RegularExpressionTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\TestCase; @@ -17,29 +16,25 @@ class RegularExpressionTest extends TestCase public function validRegexpProvider() { return [ - ['#valid regexp#', 'valid regexp', 1], - [';val.*xp;', 'valid regexp', 1], - ['/val.*xp/i', 'VALID REGEXP', 1], - ['/a val.*p/', 'valid regexp', 0], + ['#valid regexp#', 'valid regexp', 1], + [';val.*xp;', 'valid regexp', 1], + ['/val.*xp/i', 'VALID REGEXP', 1], + ['/a val.*p/', 'valid regexp', 0], ]; } public function invalidRegexpProvider() { return [ - ['valid regexp', 'valid regexp'], - [';val.*xp', 'valid regexp'], - ['val.*xp/i', 'VALID REGEXP'], + ['valid regexp', 'valid regexp'], + [';val.*xp', 'valid regexp'], + ['val.*xp/i', 'VALID REGEXP'], ]; } /** * @dataProvider validRegexpProvider * - * @param mixed $pattern - * @param mixed $subject - * @param mixed $return - * * @throws \Exception * @throws \PHPUnit\Framework\ExpectationFailedException */ @@ -51,9 +46,6 @@ public function testValidRegex($pattern, $subject, $return): void /** * @dataProvider invalidRegexpProvider * - * @param mixed $pattern - * @param mixed $subject - * * @throws \Exception * @throws \PHPUnit\Framework\ExpectationFailedException */ diff --git a/tests/Util/TestDox/NamePrettifierTest.php b/tests/Util/TestDox/NamePrettifierTest.php index a31637f0dd0..1c215bff358 100644 --- a/tests/Util/TestDox/NamePrettifierTest.php +++ b/tests/Util/TestDox/NamePrettifierTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util\TestDox; use PHPUnit\Framework\TestCase; diff --git a/tests/Util/TestTest.php b/tests/Util/TestTest.php index b6e30991ff3..a9873e122ca 100644 --- a/tests/Util/TestTest.php +++ b/tests/Util/TestTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PharIo\Version\VersionConstraint; @@ -111,9 +110,6 @@ public function testGetExpectedRegExp(): void /** * @dataProvider requirementsProvider * - * @param mixed $test - * @param mixed $result - * * @throws Warning * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -326,9 +322,6 @@ public function requirementsProvider() /** * @dataProvider requirementsWithVersionConstraintsProvider * - * @param mixed $test - * @param array $result - * * @throws Exception * @throws Warning * @throws \PHPUnit\Framework\ExpectationFailedException @@ -466,8 +459,6 @@ public function requirementsWithVersionConstraintsProvider() /** * @dataProvider requirementsWithInvalidVersionConstraintsThrowsExceptionProvider * - * @param mixed $test - * * @throws Warning */ public function testGetRequirementsWithInvalidVersionConstraintsThrowsException($test): void @@ -491,12 +482,12 @@ public function testGetRequirementsMergesClassAndMethodDocBlocks(): void 'PHPUnit' => ['version' => '3.7', 'operator' => ''], 'OS' => 'WINNT', 'functions' => [ - 'testFuncClass', - 'testFuncMethod', + 'testFuncClass', + 'testFuncMethod', ], 'extensions' => [ - 'testExtClass', - 'testExtMethod', + 'testExtClass', + 'testExtMethod', ] ]; @@ -509,9 +500,6 @@ public function testGetRequirementsMergesClassAndMethodDocBlocks(): void /** * @dataProvider missingRequirementsProvider * - * @param mixed $test - * @param mixed $result - * * @throws Warning * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -534,15 +522,15 @@ public function missingRequirementsProvider() ['testAlwaysSkip2', ['PHP >= 9999999 is required.']], ['testAlwaysSkip3', ['Operating system matching /DOESNOTEXIST/i is required.']], ['testAllPossibleRequirements', [ - 'PHP >= 99-dev is required.', - 'PHPUnit >= 9-dev is required.', - 'Operating system matching /DOESNOTEXIST/i is required.', - 'Function testFuncOne is required.', - 'Function testFuncTwo is required.', - 'Setting "not_a_setting" must be "Off".', - 'Extension testExtOne is required.', - 'Extension testExtTwo is required.', - 'Extension testExtThree >= 2.0 is required.', + 'PHP >= 99-dev is required.', + 'PHPUnit >= 9-dev is required.', + 'Operating system matching /DOESNOTEXIST/i is required.', + 'Function testFuncOne is required.', + 'Function testFuncTwo is required.', + 'Setting "not_a_setting" must be "Off".', + 'Extension testExtOne is required.', + 'Extension testExtTwo is required.', + 'Extension testExtThree >= 2.0 is required.', ]], ['testPHPVersionOperatorLessThan', ['PHP < 5.4 is required.']], ['testPHPVersionOperatorLessThanEquals', ['PHP <= 5.4 is required.']], @@ -784,9 +772,6 @@ public function methodForTestParseAnnotationThatIsOnlyOneLine(): void /** * @dataProvider getLinesToBeCoveredProvider * - * @param mixed $test - * @param mixed $lines - * * @throws CodeCoverageException * @throws \PHPUnit\Framework\ExpectationFailedException * @throws \SebastianBergmann\RecursionContext\InvalidArgumentException @@ -795,7 +780,7 @@ public function testGetLinesToBeCovered($test, $lines): void { if (\strpos($test, 'Namespace') === 0) { $expected = [ - TEST_FILES_PATH . 'NamespaceCoveredClass.php' => $lines + TEST_FILES_PATH . 'NamespaceCoveredClass.php' => $lines ]; } elseif ($test === 'CoverageCoversOverridesCoversNothingTest') { $expected = [TEST_FILES_PATH . 'CoveredClass.php' => $lines]; @@ -805,7 +790,7 @@ public function testGetLinesToBeCovered($test, $lines): void $expected = false; } elseif ($test === 'CoverageFunctionTest') { $expected = [ - TEST_FILES_PATH . 'CoveredFunction.php' => $lines + TEST_FILES_PATH . 'CoveredFunction.php' => $lines ]; } else { $expected = [TEST_FILES_PATH . 'CoveredClass.php' => $lines]; @@ -931,106 +916,106 @@ public function testNamespacedFunctionCanBeCoveredOrUsed(): void public function getLinesToBeCoveredProvider() { return [ - [ - 'CoverageNoneTest', - [] - ], - [ - 'CoverageClassExtendedTest', - \array_merge(\range(27, 44), \range(10, 25)) - ], - [ - 'CoverageClassTest', - \range(27, 44) - ], - [ - 'CoverageMethodTest', - \range(29, 33) - ], - [ - 'CoverageMethodOneLineAnnotationTest', - \range(29, 33) - ], - [ - 'CoverageNotPrivateTest', - \array_merge(\range(29, 33), \range(35, 39)) - ], - [ - 'CoverageNotProtectedTest', - \array_merge(\range(29, 33), \range(41, 43)) - ], - [ - 'CoverageNotPublicTest', - \array_merge(\range(35, 39), \range(41, 43)) - ], - [ - 'CoveragePrivateTest', - \range(41, 43) - ], - [ - 'CoverageProtectedTest', - \range(35, 39) - ], - [ - 'CoveragePublicTest', - \range(29, 33) - ], - [ - 'CoverageFunctionTest', - \range(10, 12) - ], - [ - 'NamespaceCoverageClassExtendedTest', - \array_merge(\range(29, 46), \range(12, 27)) - ], - [ - 'NamespaceCoverageClassTest', - \range(29, 46) - ], - [ - 'NamespaceCoverageMethodTest', - \range(31, 35) - ], - [ - 'NamespaceCoverageNotPrivateTest', - \array_merge(\range(31, 35), \range(37, 41)) - ], - [ - 'NamespaceCoverageNotProtectedTest', - \array_merge(\range(31, 35), \range(43, 45)) - ], - [ - 'NamespaceCoverageNotPublicTest', - \array_merge(\range(37, 41), \range(43, 45)) - ], - [ - 'NamespaceCoveragePrivateTest', - \range(43, 45) - ], - [ - 'NamespaceCoverageProtectedTest', - \range(37, 41) - ], - [ - 'NamespaceCoveragePublicTest', - \range(31, 35) - ], - [ - 'NamespaceCoverageCoversClassTest', - \array_merge(\range(43, 45), \range(37, 41), \range(31, 35), \range(24, 26), \range(19, 22), \range(14, 17)) - ], - [ - 'NamespaceCoverageCoversClassPublicTest', - \range(31, 35) - ], - [ - 'CoverageNothingTest', - false - ], - [ - 'CoverageCoversOverridesCoversNothingTest', - \range(29, 33) - ], + [ + 'CoverageNoneTest', + [] + ], + [ + 'CoverageClassExtendedTest', + \array_merge(\range(27, 44), \range(10, 25)) + ], + [ + 'CoverageClassTest', + \range(27, 44) + ], + [ + 'CoverageMethodTest', + \range(29, 33) + ], + [ + 'CoverageMethodOneLineAnnotationTest', + \range(29, 33) + ], + [ + 'CoverageNotPrivateTest', + \array_merge(\range(29, 33), \range(35, 39)) + ], + [ + 'CoverageNotProtectedTest', + \array_merge(\range(29, 33), \range(41, 43)) + ], + [ + 'CoverageNotPublicTest', + \array_merge(\range(35, 39), \range(41, 43)) + ], + [ + 'CoveragePrivateTest', + \range(41, 43) + ], + [ + 'CoverageProtectedTest', + \range(35, 39) + ], + [ + 'CoveragePublicTest', + \range(29, 33) + ], + [ + 'CoverageFunctionTest', + \range(10, 12) + ], + [ + 'NamespaceCoverageClassExtendedTest', + \array_merge(\range(29, 46), \range(12, 27)) + ], + [ + 'NamespaceCoverageClassTest', + \range(29, 46) + ], + [ + 'NamespaceCoverageMethodTest', + \range(31, 35) + ], + [ + 'NamespaceCoverageNotPrivateTest', + \array_merge(\range(31, 35), \range(37, 41)) + ], + [ + 'NamespaceCoverageNotProtectedTest', + \array_merge(\range(31, 35), \range(43, 45)) + ], + [ + 'NamespaceCoverageNotPublicTest', + \array_merge(\range(37, 41), \range(43, 45)) + ], + [ + 'NamespaceCoveragePrivateTest', + \range(43, 45) + ], + [ + 'NamespaceCoverageProtectedTest', + \range(37, 41) + ], + [ + 'NamespaceCoveragePublicTest', + \range(31, 35) + ], + [ + 'NamespaceCoverageCoversClassTest', + \array_merge(\range(43, 45), \range(37, 41), \range(31, 35), \range(24, 26), \range(19, 22), \range(14, 17)) + ], + [ + 'NamespaceCoverageCoversClassPublicTest', + \range(31, 35) + ], + [ + 'CoverageNothingTest', + false + ], + [ + 'CoverageCoversOverridesCoversNothingTest', + \range(29, 33) + ], ]; } diff --git a/tests/Util/XmlTest.php b/tests/Util/XmlTest.php index a07a3bb1dff..33e7cc9e54c 100644 --- a/tests/Util/XmlTest.php +++ b/tests/Util/XmlTest.php @@ -7,7 +7,6 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ - namespace PHPUnit\Util; use PHPUnit\Framework\Exception; diff --git a/tests/_files/BeforeAndAfterTest.php b/tests/_files/BeforeAndAfterTest.php index bfa53f5ac91..0ac856d967a 100644 --- a/tests/_files/BeforeAndAfterTest.php +++ b/tests/_files/BeforeAndAfterTest.php @@ -12,6 +12,7 @@ class BeforeAndAfterTest extends TestCase { public static $beforeWasRun; + public static $afterWasRun; public static function resetProperties(): void diff --git a/tests/_files/BeforeClassAndAfterClassTest.php b/tests/_files/BeforeClassAndAfterClassTest.php index e74e9dfe454..6344af44fad 100644 --- a/tests/_files/BeforeClassAndAfterClassTest.php +++ b/tests/_files/BeforeClassAndAfterClassTest.php @@ -12,6 +12,7 @@ class BeforeClassAndAfterClassTest extends TestCase { public static $beforeClassWasRun = 0; + public static $afterClassWasRun = 0; public static function resetProperties(): void diff --git a/tests/_files/BeforeClassWithOnlyDataProviderTest.php b/tests/_files/BeforeClassWithOnlyDataProviderTest.php index c5217fd5392..ea686598645 100644 --- a/tests/_files/BeforeClassWithOnlyDataProviderTest.php +++ b/tests/_files/BeforeClassWithOnlyDataProviderTest.php @@ -10,6 +10,7 @@ class BeforeClassWithOnlyDataProviderTest extends \PHPUnit\Framework\TestCase { public static $setUpBeforeClassWasCalled; + public static $beforeClassWasCalled; public static function resetProperties(): void diff --git a/tests/_files/Calculator.php b/tests/_files/Calculator.php index b8040418d41..c8ab513cb73 100644 --- a/tests/_files/Calculator.php +++ b/tests/_files/Calculator.php @@ -14,9 +14,6 @@ class Calculator * @assert (0, 1) == 1 * @assert (1, 0) == 1 * @assert (1, 1) == 2 - * - * @param mixed $a - * @param mixed $b */ public function add($a, $b) { diff --git a/tests/_files/ClassWithNonPublicAttributes.php b/tests/_files/ClassWithNonPublicAttributes.php index bec350e8d2b..3cabd9a508b 100644 --- a/tests/_files/ClassWithNonPublicAttributes.php +++ b/tests/_files/ClassWithNonPublicAttributes.php @@ -10,28 +10,38 @@ class ParentClassWithPrivateAttributes { private static $privateStaticParentAttribute = 'foo'; + private $privateParentAttribute = 'bar'; } class ParentClassWithProtectedAttributes extends ParentClassWithPrivateAttributes { protected static $protectedStaticParentAttribute = 'foo'; + protected $protectedParentAttribute = 'bar'; } class ClassWithNonPublicAttributes extends ParentClassWithProtectedAttributes { public static $publicStaticAttribute = 'foo'; + protected static $protectedStaticAttribute = 'bar'; + protected static $privateStaticAttribute = 'baz'; public $publicAttribute = 'foo'; + public $foo = 1; + public $bar = 2; public $publicArray = ['foo']; + protected $protectedAttribute = 'bar'; + protected $privateAttribute = 'baz'; + protected $protectedArray = ['bar']; + protected $privateArray = ['baz']; } diff --git a/tests/_files/ClonedDependencyTest.php b/tests/_files/ClonedDependencyTest.php index 50bb6547d87..93adb1ecddc 100644 --- a/tests/_files/ClonedDependencyTest.php +++ b/tests/_files/ClonedDependencyTest.php @@ -27,8 +27,6 @@ public function testOne() /** * @depends testOne - * - * @param mixed $dependency */ public function testTwo($dependency): void { @@ -37,8 +35,6 @@ public function testTwo($dependency): void /** * @depends !clone testOne - * - * @param mixed $dependency */ public function testThree($dependency): void { @@ -47,8 +43,6 @@ public function testThree($dependency): void /** * @depends clone testOne - * - * @param mixed $dependency */ public function testFour($dependency): void { @@ -57,8 +51,6 @@ public function testFour($dependency): void /** * @depends !shallowClone testOne - * - * @param mixed $dependency */ public function testFive($dependency): void { @@ -67,8 +59,6 @@ public function testFive($dependency): void /** * @depends shallowClone testOne - * - * @param mixed $dependency */ public function testSix($dependency): void { diff --git a/tests/_files/DataProviderDependencyTest.php b/tests/_files/DataProviderDependencyTest.php index a5f745aa3c7..38ed4bd25d6 100644 --- a/tests/_files/DataProviderDependencyTest.php +++ b/tests/_files/DataProviderDependencyTest.php @@ -19,8 +19,6 @@ public function testReference(): void * @see https://github.com/sebastianbergmann/phpunit/issues/1896 * @depends testReference * @dataProvider provider - * - * @param mixed $param */ public function testDependency($param): void { diff --git a/tests/_files/DataProviderFilterTest.php b/tests/_files/DataProviderFilterTest.php index 0eba83d42c9..1cae5cd5c8c 100644 --- a/tests/_files/DataProviderFilterTest.php +++ b/tests/_files/DataProviderFilterTest.php @@ -14,27 +14,25 @@ class DataProviderFilterTest extends TestCase public static function truthProvider() { return [ - [true], - [true], - [true], - [true] + [true], + [true], + [true], + [true] ]; } public static function falseProvider() { return [ - 'false test' => [false], - 'false test 2' => [false], - 'other false test' => [false], - 'other false test2'=> [false] + 'false test' => [false], + 'false test 2' => [false], + 'other false test' => [false], + 'other false test2'=> [false] ]; } /** * @dataProvider truthProvider - * - * @param mixed $truth */ public function testTrue($truth): void { @@ -43,8 +41,6 @@ public function testTrue($truth): void /** * @dataProvider falseProvider - * - * @param mixed $false */ public function testFalse($false): void { diff --git a/tests/_files/DataProviderIncompleteTest.php b/tests/_files/DataProviderIncompleteTest.php index 60753e25e18..24af21e393a 100644 --- a/tests/_files/DataProviderIncompleteTest.php +++ b/tests/_files/DataProviderIncompleteTest.php @@ -14,17 +14,13 @@ class DataProviderIncompleteTest extends TestCase public static function providerMethod() { return [ - [0, 0, 0], - [0, 1, 1], + [0, 0, 0], + [0, 1, 1], ]; } /** * @dataProvider incompleteTestProviderMethod - * - * @param mixed $a - * @param mixed $b - * @param mixed $c */ public function testIncomplete($a, $b, $c): void { @@ -33,10 +29,6 @@ public function testIncomplete($a, $b, $c): void /** * @dataProvider providerMethod - * - * @param mixed $a - * @param mixed $b - * @param mixed $c */ public function testAdd($a, $b, $c): void { @@ -48,8 +40,8 @@ public function incompleteTestProviderMethod() $this->markTestIncomplete('incomplete'); return [ - [0, 0, 0], - [0, 1, 1], + [0, 0, 0], + [0, 1, 1], ]; } } diff --git a/tests/_files/DataProviderIssue2833/FirstTest.php b/tests/_files/DataProviderIssue2833/FirstTest.php index 074a7449c3d..4c10ce830f6 100644 --- a/tests/_files/DataProviderIssue2833/FirstTest.php +++ b/tests/_files/DataProviderIssue2833/FirstTest.php @@ -15,8 +15,6 @@ class FirstTest extends TestCase { /** * @dataProvider provide - * - * @param mixed $x */ public function testFirst($x): void { diff --git a/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php b/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php index 29963df394c..69323f86553 100644 --- a/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php +++ b/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php @@ -15,8 +15,6 @@ class TestWithDataProviderTest extends TestCase { /** * @dataProvider provide - * - * @param mixed $x */ public function testFirst($x): void { diff --git a/tests/_files/DataProviderIssue2922/FirstTest.php b/tests/_files/DataProviderIssue2922/FirstTest.php index 873c543f8ef..019418c8752 100644 --- a/tests/_files/DataProviderIssue2922/FirstTest.php +++ b/tests/_files/DataProviderIssue2922/FirstTest.php @@ -18,8 +18,6 @@ class FirstTest extends TestCase { /** * @dataProvider provide - * - * @param mixed $x */ public function testFirst($x): void { diff --git a/tests/_files/DataProviderSkippedTest.php b/tests/_files/DataProviderSkippedTest.php index 70d6614347f..9ca1b986034 100644 --- a/tests/_files/DataProviderSkippedTest.php +++ b/tests/_files/DataProviderSkippedTest.php @@ -14,17 +14,13 @@ class DataProviderSkippedTest extends TestCase public static function providerMethod() { return [ - [0, 0, 0], - [0, 1, 1], + [0, 0, 0], + [0, 1, 1], ]; } /** * @dataProvider skippedTestProviderMethod - * - * @param mixed $a - * @param mixed $b - * @param mixed $c */ public function testSkipped($a, $b, $c): void { @@ -33,10 +29,6 @@ public function testSkipped($a, $b, $c): void /** * @dataProvider providerMethod - * - * @param mixed $a - * @param mixed $b - * @param mixed $c */ public function testAdd($a, $b, $c): void { @@ -48,8 +40,8 @@ public function skippedTestProviderMethod() $this->markTestSkipped('skipped'); return [ - [0, 0, 0], - [0, 1, 1], + [0, 0, 0], + [0, 1, 1], ]; } } diff --git a/tests/_files/DataProviderTest.php b/tests/_files/DataProviderTest.php index 50ee9aef4bd..810b59e6c7a 100644 --- a/tests/_files/DataProviderTest.php +++ b/tests/_files/DataProviderTest.php @@ -14,19 +14,15 @@ class DataProviderTest extends TestCase public static function providerMethod() { return [ - [0, 0, 0], - [0, 1, 1], - [1, 1, 3], - [1, 0, 1] + [0, 0, 0], + [0, 1, 1], + [1, 1, 3], + [1, 0, 1] ]; } /** * @dataProvider providerMethod - * - * @param mixed $a - * @param mixed $b - * @param mixed $c */ public function testAdd($a, $b, $c): void { diff --git a/tests/_files/ExceptionInAssertPostConditionsTest.php b/tests/_files/ExceptionInAssertPostConditionsTest.php index 5b5f6c24ea0..ff2ea0a5098 100644 --- a/tests/_files/ExceptionInAssertPostConditionsTest.php +++ b/tests/_files/ExceptionInAssertPostConditionsTest.php @@ -12,9 +12,13 @@ class ExceptionInAssertPostConditionsTest extends TestCase { public $setUp = false; + public $assertPreConditions = false; + public $assertPostConditions = false; + public $tearDown = false; + public $testSomething = false; protected function setUp(): void diff --git a/tests/_files/ExceptionInAssertPreConditionsTest.php b/tests/_files/ExceptionInAssertPreConditionsTest.php index ccc9d1acd39..f9e55157d75 100644 --- a/tests/_files/ExceptionInAssertPreConditionsTest.php +++ b/tests/_files/ExceptionInAssertPreConditionsTest.php @@ -12,9 +12,13 @@ class ExceptionInAssertPreConditionsTest extends TestCase { public $setUp = false; + public $assertPreConditions = false; + public $assertPostConditions = false; + public $tearDown = false; + public $testSomething = false; protected function setUp(): void diff --git a/tests/_files/ExceptionInSetUpTest.php b/tests/_files/ExceptionInSetUpTest.php index 154fe12da2e..52a630da30e 100644 --- a/tests/_files/ExceptionInSetUpTest.php +++ b/tests/_files/ExceptionInSetUpTest.php @@ -12,9 +12,13 @@ class ExceptionInSetUpTest extends TestCase { public $setUp = false; + public $assertPreConditions = false; + public $assertPostConditions = false; + public $tearDown = false; + public $testSomething = false; protected function setUp(): void diff --git a/tests/_files/ExceptionInTearDownTest.php b/tests/_files/ExceptionInTearDownTest.php index c26f254bdb3..cc696ff416c 100644 --- a/tests/_files/ExceptionInTearDownTest.php +++ b/tests/_files/ExceptionInTearDownTest.php @@ -12,9 +12,13 @@ class ExceptionInTearDownTest extends TestCase { public $setUp = false; + public $assertPreConditions = false; + public $assertPostConditions = false; + public $tearDown = false; + public $testSomething = false; protected function setUp(): void diff --git a/tests/_files/ExceptionInTest.php b/tests/_files/ExceptionInTest.php index d33049d735b..2e483990ccc 100644 --- a/tests/_files/ExceptionInTest.php +++ b/tests/_files/ExceptionInTest.php @@ -12,9 +12,13 @@ class ExceptionInTest extends TestCase { public $setUp = false; + public $assertPreConditions = false; + public $assertPostConditions = false; + public $tearDown = false; + public $testSomething = false; protected function setUp(): void diff --git a/tests/_files/Mockable.php b/tests/_files/Mockable.php index a86ab2b6aa8..f5369d106d9 100644 --- a/tests/_files/Mockable.php +++ b/tests/_files/Mockable.php @@ -10,6 +10,7 @@ class Mockable { public $constructorArgs; + public $cloned; public function __construct($arg1 = null, $arg2 = null) diff --git a/tests/_files/MultiDependencyTest.php b/tests/_files/MultiDependencyTest.php index 54306ac7ae2..21945dcaace 100644 --- a/tests/_files/MultiDependencyTest.php +++ b/tests/_files/MultiDependencyTest.php @@ -28,9 +28,6 @@ public function testTwo() /** * @depends testOne * @depends testTwo - * - * @param mixed $a - * @param mixed $b */ public function testThree($a, $b): void { diff --git a/tests/_files/SampleArrayAccess.php b/tests/_files/SampleArrayAccess.php index 3bd6501ed46..6c2fd59f22e 100644 --- a/tests/_files/SampleArrayAccess.php +++ b/tests/_files/SampleArrayAccess.php @@ -18,7 +18,7 @@ public function __construct() public function offsetSet($offset, $value): void { - if (\is_null($offset)) { + if (null === $offset) { $this->container[] = $value; } else { $this->container[$offset] = $value; diff --git a/tests/_files/SampleClass.php b/tests/_files/SampleClass.php index 1042a1c4d85..d4e0bf6c088 100644 --- a/tests/_files/SampleClass.php +++ b/tests/_files/SampleClass.php @@ -10,7 +10,9 @@ class SampleClass { public $a; + public $b; + public $c; public function __construct($a, $b, $c) diff --git a/tests/_files/SomeClass.php b/tests/_files/SomeClass.php index 221a9107255..9ee1249b186 100644 --- a/tests/_files/SomeClass.php +++ b/tests/_files/SomeClass.php @@ -11,11 +11,9 @@ class SomeClass { public function doSomething($a, $b) { - return; } public function doSomethingElse($c) { - return; } } diff --git a/tests/_files/TestIterator.php b/tests/_files/TestIterator.php index 23eee3f045f..f191db5ba47 100644 --- a/tests/_files/TestIterator.php +++ b/tests/_files/TestIterator.php @@ -10,6 +10,7 @@ class TestIterator implements Iterator { protected $array; + protected $position = 0; public function __construct($array = []) diff --git a/tests/_files/TestWithTest.php b/tests/_files/TestWithTest.php index 7806c804c5d..724463d17a6 100644 --- a/tests/_files/TestWithTest.php +++ b/tests/_files/TestWithTest.php @@ -14,10 +14,10 @@ class TestWithTest extends TestCase public static function providerMethod() { return [ - [0, 0, 0], - [0, 1, 1], - [1, 1, 3], - [1, 0, 1] + [0, 0, 0], + [0, 1, 1], + [1, 1, 3], + [1, 0, 1] ]; } @@ -26,10 +26,6 @@ public static function providerMethod() * [0, 1, 1] * [1, 2, 3] * [20, 22, 42] - * - * @param mixed $a - * @param mixed $b - * @param mixed $c */ public function testAdd($a, $b, $c): void { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 96eeff56f4d..22639815a23 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -8,7 +8,7 @@ * file that was distributed with this source code. */ if (!\defined('TEST_FILES_PATH')) { - \define('TEST_FILES_PATH', __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR); + \define('TEST_FILES_PATH', __DIR__ . \DIRECTORY_SEPARATOR . '_files' . \DIRECTORY_SEPARATOR); } \ini_set('precision', 14);