From 35c6ddf3636e4821740cae490de9d0d91a042443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 6 Mar 2022 18:42:56 +0100 Subject: [PATCH 01/93] Fix: Remove unused test fixtures --- tests/_files/AnotherInterface.php | 13 --- tests/_files/Calculator.php | 22 ---- tests/_files/DataProviderDebugTest.php | 58 --------- tests/_files/ExceptionNamespaceTest.php | 45 ------- tests/_files/ExceptionTest.php | 149 ------------------------ tests/_files/MockRunner.php | 17 --- tests/_files/NoTestCaseClass.php | 12 -- tests/_files/NonStatic.php | 15 --- tests/_files/RouterTest.php | 33 ------ tests/_files/StaticMockTestClass.php | 20 ---- tests/_files/StopsOnWarningTest.php | 17 --- tests/_files/TemplateMethodsTest.php | 62 ---------- 12 files changed, 463 deletions(-) delete mode 100644 tests/_files/AnotherInterface.php delete mode 100644 tests/_files/Calculator.php delete mode 100644 tests/_files/DataProviderDebugTest.php delete mode 100644 tests/_files/ExceptionNamespaceTest.php delete mode 100644 tests/_files/ExceptionTest.php delete mode 100644 tests/_files/MockRunner.php delete mode 100644 tests/_files/NoTestCaseClass.php delete mode 100644 tests/_files/NonStatic.php delete mode 100644 tests/_files/RouterTest.php delete mode 100644 tests/_files/StaticMockTestClass.php delete mode 100644 tests/_files/StopsOnWarningTest.php delete mode 100644 tests/_files/TemplateMethodsTest.php diff --git a/tests/_files/AnotherInterface.php b/tests/_files/AnotherInterface.php deleted file mode 100644 index 50d63864466..00000000000 --- a/tests/_files/AnotherInterface.php +++ /dev/null @@ -1,13 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -interface AnotherInterface -{ - public function doSomethingElse(); -} diff --git a/tests/_files/Calculator.php b/tests/_files/Calculator.php deleted file mode 100644 index ac51ce2335a..00000000000 --- a/tests/_files/Calculator.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class Calculator -{ - /** - * @assert (0, 0) == 0 - * @assert (0, 1) == 1 - * @assert (1, 0) == 1 - * @assert (1, 1) == 2 - */ - public function add($a, $b) - { - return $a + $b; - } -} diff --git a/tests/_files/DataProviderDebugTest.php b/tests/_files/DataProviderDebugTest.php deleted file mode 100644 index b5df807e370..00000000000 --- a/tests/_files/DataProviderDebugTest.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use PHPUnit\Framework\TestCase; - -class DataProviderDebugTest extends TestCase -{ - public static function provider() - { - $obj2 = new \stdClass; - $obj2->foo = 'bar'; - - $obj3 = (object) [1, 2, "Test\r\n", 4, 5, 6, 7, 8]; - - $obj = new \stdClass; - //@codingStandardsIgnoreStart - $obj->null = null; - //@codingStandardsIgnoreEnd - $obj->boolean = true; - $obj->integer = 1; - $obj->double = 1.2; - $obj->string = '1'; - $obj->text = "this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"; - $obj->object = $obj2; - $obj->objectagain = $obj2; - $obj->array = ['foo' => 'bar']; - $obj->self = $obj; - - $storage = new \SplObjectStorage; - $storage->attach($obj2); - $storage->foo = $obj; - - return [ - [null, true, 1, 1.0], - [1.2, \fopen('php://memory', 'r'), '1'], - [[[1, 2, 3], [3, 4, 5]]], - // \n\r and \r is converted to \n - ["this\nis\na\nvery\nvery\nvery\nvery\nvery\nvery\rlong\n\rtext"], - [new \stdClass, $obj, [], $storage, $obj3], - [\chr(0) . \chr(1) . \chr(2) . \chr(3) . \chr(4) . \chr(5), \implode('', \array_map('chr', \range(0x0e, 0x1f)))], - [\chr(0x00) . \chr(0x09)], - ]; - } - - /** - * @dataProvider provider - */ - public function testProvider(): void - { - $this->assertTrue(true); - } -} diff --git a/tests/_files/ExceptionNamespaceTest.php b/tests/_files/ExceptionNamespaceTest.php deleted file mode 100644 index 244fcd6d565..00000000000 --- a/tests/_files/ExceptionNamespaceTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace My\Space; - -class ExceptionNamespaceTest extends \PHPUnit\Framework\TestCase -{ - /** - * Exception message. - * - * @var string - */ - public const ERROR_MESSAGE = 'Exception namespace message'; - - /** - * Exception code. - * - * @var int - */ - public const ERROR_CODE = 200; - - /** - * @expectedException Class - * @expectedExceptionMessage My\Space\ExceptionNamespaceTest::ERROR_MESSAGE - * @expectedExceptionCode My\Space\ExceptionNamespaceTest::ERROR_CODE - */ - public function testConstants(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionCode My\Space\ExceptionNamespaceTest::UNKNOWN_CODE_CONSTANT - * @expectedExceptionMessage My\Space\ExceptionNamespaceTest::UNKNOWN_MESSAGE_CONSTANT - */ - public function testUnknownConstants(): void - { - } -} diff --git a/tests/_files/ExceptionTest.php b/tests/_files/ExceptionTest.php deleted file mode 100644 index b9b923d267b..00000000000 --- a/tests/_files/ExceptionTest.php +++ /dev/null @@ -1,149 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use PHPUnit\Framework\TestCase; - -class ExceptionTest extends TestCase -{ - /** - * Exception message. - * - * @var string - */ - public const ERROR_MESSAGE = 'Exception message'; - - /** - * Exception message. - * - * @var string - */ - public const ERROR_MESSAGE_REGEX = '#regex#'; - - /** - * Exception code. - * - * @var int - */ - public const ERROR_CODE = 500; - - /** - * @expectedException FooBarBaz - */ - public function testOne(): void - { - } - - /** - * @expectedException Foo_Bar_Baz - */ - public function testTwo(): void - { - } - - /** - * @expectedException Foo\Bar\Baz - */ - public function testThree(): void - { - } - - /** - * @expectedException ほげ - */ - public function testFour(): void - { - } - - /** - * @expectedException Class Message 1234 - */ - public function testFive(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionMessage Message - * @expectedExceptionCode 1234 - */ - public function testSix(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionMessage Message - * @expectedExceptionCode ExceptionCode - */ - public function testSeven(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionMessage Message - * @expectedExceptionCode 0 - */ - public function testEight(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionMessage ExceptionTest::ERROR_MESSAGE - * @expectedExceptionCode ExceptionTest::ERROR_CODE - */ - public function testNine(): void - { - } - - /** @expectedException Class */ - public function testSingleLine(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionCode ExceptionTest::UNKNOWN_CODE_CONSTANT - * @expectedExceptionMessage ExceptionTest::UNKNOWN_MESSAGE_CONSTANT - */ - public function testUnknownConstants(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionCode 1234 - * @expectedExceptionMessage Message - * @expectedExceptionMessageRegExp #regex# - */ - public function testWithRegexMessage(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionCode 1234 - * @expectedExceptionMessage Message - * @expectedExceptionMessageRegExp ExceptionTest::ERROR_MESSAGE_REGEX - */ - public function testWithRegexMessageFromClassConstant(): void - { - } - - /** - * @expectedException Class - * @expectedExceptionCode 1234 - * @expectedExceptionMessage Message - * @expectedExceptionMessageRegExp ExceptionTest::UNKNOWN_MESSAGE_REGEX_CONSTANT - */ - public function testWithUnknowRegexMessageFromClassConstant(): void - { - } -} diff --git a/tests/_files/MockRunner.php b/tests/_files/MockRunner.php deleted file mode 100644 index 23d8755b47a..00000000000 --- a/tests/_files/MockRunner.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use PHPUnit\Runner\BaseTestRunner; - -class MockRunner extends BaseTestRunner -{ - protected function runFailed($message): void - { - } -} diff --git a/tests/_files/NoTestCaseClass.php b/tests/_files/NoTestCaseClass.php deleted file mode 100644 index 1c77098ad57..00000000000 --- a/tests/_files/NoTestCaseClass.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class NoTestCaseClass -{ -} diff --git a/tests/_files/NonStatic.php b/tests/_files/NonStatic.php deleted file mode 100644 index 07b6841d1e0..00000000000 --- a/tests/_files/NonStatic.php +++ /dev/null @@ -1,15 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class NonStatic -{ - public function suite(): void - { - } -} diff --git a/tests/_files/RouterTest.php b/tests/_files/RouterTest.php deleted file mode 100644 index fce5e18b667..00000000000 --- a/tests/_files/RouterTest.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use PHPUnit\Framework\TestCase; - -final class RouterTest extends TestCase -{ - /** - * @dataProvider routesProvider - * @testdox Routes $url to $handler - */ - public function testRoutesRequest(string $url, string $handler): void - { - $this->assertTrue(true); - } - - public function routesProvider() - { - return [ - '/foo/bar' => [ - '/foo/bar', - FooBarHandler::class, - // ... - ], - ]; - } -} diff --git a/tests/_files/StaticMockTestClass.php b/tests/_files/StaticMockTestClass.php deleted file mode 100644 index d15ab41aa2e..00000000000 --- a/tests/_files/StaticMockTestClass.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -class StaticMockTestClass -{ - public static function doSomething(): void - { - } - - public static function doSomethingElse() - { - return static::doSomething(); - } -} diff --git a/tests/_files/StopsOnWarningTest.php b/tests/_files/StopsOnWarningTest.php deleted file mode 100644 index 731479507ac..00000000000 --- a/tests/_files/StopsOnWarningTest.php +++ /dev/null @@ -1,17 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use PHPUnit\Framework\TestCase; - -class StopsOnWarningTest extends TestCase -{ - public function testOne(): void - { - } -} diff --git a/tests/_files/TemplateMethodsTest.php b/tests/_files/TemplateMethodsTest.php deleted file mode 100644 index f05b7b360d2..00000000000 --- a/tests/_files/TemplateMethodsTest.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -use PHPUnit\Framework\TestCase; - -class TemplateMethodsTest extends TestCase -{ - public static function setUpBeforeClass(): void - { - print __METHOD__ . "\n"; - } - - public static function tearDownAfterClass(): void - { - print __METHOD__ . "\n"; - } - - protected function setUp(): void - { - print __METHOD__ . "\n"; - } - - protected function assertPreConditions(): void - { - print __METHOD__ . "\n"; - } - - protected function assertPostConditions(): void - { - print __METHOD__ . "\n"; - } - - protected function tearDown(): void - { - print __METHOD__ . "\n"; - } - - public function testOne(): void - { - print __METHOD__ . "\n"; - $this->assertTrue(true); - } - - public function testTwo(): void - { - print __METHOD__ . "\n"; - $this->assertTrue(false); - } - - protected function onNotSuccessfulTest(Throwable $t): void - { - print __METHOD__ . "\n"; - - throw $t; - } -} From 1da0ad97792dde749b6f654abba5f9ca2f97f755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 7 Mar 2022 17:44:43 +0100 Subject: [PATCH 02/93] Fix: Use class keyword --- tests/unit/Framework/AssertTest.php | 22 +-- .../Constraint/ClassHasAttributeTest.php | 18 ++- .../ClassHasStaticAttributeTest.php | 18 ++- .../Framework/Constraint/IsIdenticalTest.php | 8 +- .../Framework/Constraint/IsInstanceOfTest.php | 17 ++- .../unit/Framework/Constraint/IsTypeTest.php | 16 ++- .../Constraint/ObjectHasAttributeTest.php | 18 ++- tests/unit/Framework/ConstraintTest.php | 135 +++++++++++++----- .../Builder/InvocationMockerTest.php | 5 +- .../Framework/MockObject/MockBuilderTest.php | 12 +- .../Framework/MockObject/MockObjectTest.php | 85 +++++++---- tests/unit/Framework/TestCaseTest.php | 10 +- tests/unit/Framework/TestSuiteTest.php | 2 +- tests/unit/Runner/TestSuiteSorterTest.php | 8 +- tests/unit/Util/TestClassTest.php | 6 - tests/unit/Util/XmlTest.php | 6 +- 16 files changed, 269 insertions(+), 117 deletions(-) diff --git a/tests/unit/Framework/AssertTest.php b/tests/unit/Framework/AssertTest.php index 65c7967e3f9..32d1470bf2a 100644 --- a/tests/unit/Framework/AssertTest.php +++ b/tests/unit/Framework/AssertTest.php @@ -221,20 +221,20 @@ public function testAssertArrayNotContainsOnlyIntegers(): void public function testAssertArrayContainsOnlyStdClass(): void { - $this->assertContainsOnly('StdClass', [new stdClass]); + $this->assertContainsOnly(stdClass::class, [new stdClass]); $this->expectException(AssertionFailedError::class); - $this->assertContainsOnly('StdClass', ['StdClass']); + $this->assertContainsOnly(stdClass::class, [stdClass::class]); } public function testAssertArrayNotContainsOnlyStdClass(): void { - $this->assertNotContainsOnly('StdClass', ['StdClass']); + $this->assertNotContainsOnly(stdClass::class, [stdClass::class]); $this->expectException(AssertionFailedError::class); - $this->assertNotContainsOnly('StdClass', [new stdClass]); + $this->assertNotContainsOnly(stdClass::class, [new stdClass]); } public function equalProvider(): array @@ -964,7 +964,7 @@ public function testAssertClassHasAttributeThrowsExceptionIfClassDoesNotExist(): { $this->expectException(Exception::class); - $this->assertClassHasAttribute('attribute', 'ClassThatDoesNotExist'); + $this->assertClassHasAttribute('attribute', ClassThatDoesNotExist::class); } public function testAssertClassNotHasAttributeThrowsExceptionIfAttributeNameIsNotValid(): void @@ -978,7 +978,7 @@ public function testAssertClassNotHasAttributeThrowsExceptionIfClassDoesNotExist { $this->expectException(Exception::class); - $this->assertClassNotHasAttribute('attribute', 'ClassThatDoesNotExist'); + $this->assertClassNotHasAttribute('attribute', ClassThatDoesNotExist::class); } public function testAssertClassHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid(): void @@ -992,7 +992,7 @@ public function testAssertClassHasStaticAttributeThrowsExceptionIfClassDoesNotEx { $this->expectException(Exception::class); - $this->assertClassHasStaticAttribute('attribute', 'ClassThatDoesNotExist'); + $this->assertClassHasStaticAttribute('attribute', ClassThatDoesNotExist::class); } public function testAssertClassNotHasStaticAttributeThrowsExceptionIfAttributeNameIsNotValid(): void @@ -1006,7 +1006,7 @@ public function testAssertClassNotHasStaticAttributeThrowsExceptionIfClassDoesNo { $this->expectException(Exception::class); - $this->assertClassNotHasStaticAttribute('attribute', 'ClassThatDoesNotExist'); + $this->assertClassNotHasStaticAttribute('attribute', ClassThatDoesNotExist::class); } public function testAssertObjectHasAttributeThrowsException2(): void @@ -1292,7 +1292,7 @@ public function testAssertThatIdenticalTo(): void public function testAssertThatIsInstanceOf(): void { - $this->assertThat(new stdClass, $this->isInstanceOf('StdClass')); + $this->assertThat(new stdClass, $this->isInstanceOf(stdClass::class)); } public function testAssertThatIsType(): void @@ -1799,7 +1799,7 @@ public function testAssertInstanceOfThrowsExceptionIfTypeDoesNotExist(): void { $this->expectException(Exception::class); - $this->assertInstanceOf('ClassThatDoesNotExist', new stdClass); + $this->assertInstanceOf(ClassThatDoesNotExist::class, new stdClass); } public function testAssertInstanceOf(): void @@ -1815,7 +1815,7 @@ public function testAssertNotInstanceOfThrowsExceptionIfTypeDoesNotExist(): void { $this->expectException(Exception::class); - $this->assertNotInstanceOf('ClassThatDoesNotExist', new stdClass); + $this->assertNotInstanceOf(ClassThatDoesNotExist::class, new stdClass); } public function testAssertNotInstanceOf(): void diff --git a/tests/unit/Framework/Constraint/ClassHasAttributeTest.php b/tests/unit/Framework/Constraint/ClassHasAttributeTest.php index ce52a81feb0..69577341972 100644 --- a/tests/unit/Framework/Constraint/ClassHasAttributeTest.php +++ b/tests/unit/Framework/Constraint/ClassHasAttributeTest.php @@ -34,11 +34,14 @@ public function testConstraintClassHasAttribute(): void $constraint->evaluate(stdClass::class); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' -Failed asserting that class "stdClass" has attribute "privateAttribute". + sprintf( + <<<'EOF' +Failed asserting that class "%s" has attribute "privateAttribute". EOF - , + , + stdClass::class + ), TestFailure::exceptionToString($e) ); @@ -58,12 +61,15 @@ public function testConstraintClassHasAttribute2(): void $constraint->evaluate(stdClass::class, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' + sprintf( + <<<'EOF' custom message -Failed asserting that class "stdClass" has attribute "privateAttribute". +Failed asserting that class "%s" has attribute "privateAttribute". EOF - , + , + stdClass::class + ), TestFailure::exceptionToString($e) ); diff --git a/tests/unit/Framework/Constraint/ClassHasStaticAttributeTest.php b/tests/unit/Framework/Constraint/ClassHasStaticAttributeTest.php index 832b4fdca77..166ef1878ed 100644 --- a/tests/unit/Framework/Constraint/ClassHasStaticAttributeTest.php +++ b/tests/unit/Framework/Constraint/ClassHasStaticAttributeTest.php @@ -32,11 +32,14 @@ public function testConstraintClassHasStaticAttribute(): void $constraint->evaluate(stdClass::class); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' -Failed asserting that class "stdClass" has static attribute "privateStaticAttribute". + sprintf( + <<<'EOF' +Failed asserting that class "%s" has static attribute "privateStaticAttribute". EOF - , + , + stdClass::class + ), TestFailure::exceptionToString($e) ); @@ -54,12 +57,15 @@ public function testConstraintClassHasStaticAttribute2(): void $constraint->evaluate(stdClass::class, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' + sprintf( + <<<'EOF' custom message -Failed asserting that class "stdClass" has static attribute "foo". +Failed asserting that class "%s" has static attribute "foo". EOF - , + , + stdClass::class + ), TestFailure::exceptionToString($e) ); diff --git a/tests/unit/Framework/Constraint/IsIdenticalTest.php b/tests/unit/Framework/Constraint/IsIdenticalTest.php index 5ee4cddd857..f5e132cf899 100644 --- a/tests/unit/Framework/Constraint/IsIdenticalTest.php +++ b/tests/unit/Framework/Constraint/IsIdenticalTest.php @@ -27,7 +27,13 @@ public function testConstraintIsIdentical(): void $this->assertFalse($constraint->evaluate($b, '', true)); $this->assertTrue($constraint->evaluate($a, '', true)); - $this->assertEquals('is identical to an object of class "stdClass"', $constraint->toString()); + $this->assertEquals( + sprintf( + 'is identical to an object of class "%s"', + stdClass::class + ), + $constraint->toString() + ); $this->assertCount(1, $constraint); try { diff --git a/tests/unit/Framework/Constraint/IsInstanceOfTest.php b/tests/unit/Framework/Constraint/IsInstanceOfTest.php index a0d728ec697..bde67d1afe2 100644 --- a/tests/unit/Framework/Constraint/IsInstanceOfTest.php +++ b/tests/unit/Framework/Constraint/IsInstanceOfTest.php @@ -31,14 +31,18 @@ public function testConstraintFailsOnString(): void $constraint = new IsInstanceOf(stdClass::class); try { - $constraint->evaluate('stdClass'); + $constraint->evaluate(stdClass::class); } catch (ExpectationFailedException $e) { $this->assertSame( - <<<'EOT' -Failed asserting that 'stdClass' is an instance of class "stdClass". + sprintf( + <<<'EOT' +Failed asserting that '%s' is an instance of class "%s". EOT - , + , + stdClass::class, + stdClass::class + ), TestFailure::exceptionToString($e) ); } @@ -51,7 +55,10 @@ public function testCronstraintsThrowsReflectionException(): void $constraint = new IsInstanceOf(NotExistingClass::class); $this->assertSame( - 'is instance of class "PHPUnit\Framework\Constraint\NotExistingClass"', + sprintf( + 'is instance of class "%s"', + NotExistingClass::class + ), $constraint->toString() ); } diff --git a/tests/unit/Framework/Constraint/IsTypeTest.php b/tests/unit/Framework/Constraint/IsTypeTest.php index 0aebdefe495..9e29a14b9df 100644 --- a/tests/unit/Framework/Constraint/IsTypeTest.php +++ b/tests/unit/Framework/Constraint/IsTypeTest.php @@ -36,11 +36,14 @@ public function testConstraintIsType(): void $constraint->evaluate(new stdClass); } catch (ExpectationFailedException $e) { $this->assertStringMatchesFormat( - <<<'EOF' -Failed asserting that stdClass Object &%x () is of type "string". + sprintf( + <<<'EOF' +Failed asserting that %s Object &%%x () is of type "string". EOF - , + , + stdClass::class + ), $this->trimnl(TestFailure::exceptionToString($e)) ); @@ -58,12 +61,15 @@ public function testConstraintIsType2(): void $constraint->evaluate(new stdClass, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertStringMatchesFormat( - <<<'EOF' + sprintf( + <<<'EOF' custom message -Failed asserting that stdClass Object &%x () is of type "string". +Failed asserting that %s Object &%%x () is of type "string". EOF , + stdClass::class + ), $this->trimnl(TestFailure::exceptionToString($e)) ); diff --git a/tests/unit/Framework/Constraint/ObjectHasAttributeTest.php b/tests/unit/Framework/Constraint/ObjectHasAttributeTest.php index 4501ffe2183..1d6502596ed 100644 --- a/tests/unit/Framework/Constraint/ObjectHasAttributeTest.php +++ b/tests/unit/Framework/Constraint/ObjectHasAttributeTest.php @@ -32,11 +32,14 @@ public function testConstraintObjectHasAttribute(): void $constraint->evaluate(new stdClass); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' -Failed asserting that object of class "stdClass" has attribute "privateAttribute". + sprintf( + <<<'EOF' +Failed asserting that object of class "%s" has attribute "privateAttribute". EOF - , + , + stdClass::class + ), TestFailure::exceptionToString($e) ); @@ -54,12 +57,15 @@ public function testConstraintObjectHasAttribute2(): void $constraint->evaluate(new stdClass, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' + sprintf( + <<<'EOF' custom message -Failed asserting that object of class "stdClass" has attribute "privateAttribute". +Failed asserting that object of class "%s" has attribute "privateAttribute". EOF - , + , + stdClass::class + ), TestFailure::exceptionToString($e) ); diff --git a/tests/unit/Framework/ConstraintTest.php b/tests/unit/Framework/ConstraintTest.php index 6bb3b87101a..7ba8ab5989a 100644 --- a/tests/unit/Framework/ConstraintTest.php +++ b/tests/unit/Framework/ConstraintTest.php @@ -394,7 +394,13 @@ public function testConstraintIsNotIdentical(): void $this->assertTrue($constraint->evaluate($b, '', true)); $this->assertFalse($constraint->evaluate($a, '', true)); - $this->assertEquals('is not identical to an object of class "stdClass"', $constraint->toString()); + $this->assertEquals( + sprintf( + 'is not identical to an object of class "%s"', + stdClass::class + ), + $constraint->toString() + ); $this->assertCount(1, $constraint); try { @@ -473,23 +479,39 @@ public function testConstraintIsInstanceOf(): void $this->assertFalse($constraint->evaluate(new stdClass, '', true)); $this->assertTrue($constraint->evaluate(new \Exception, '', true)); - $this->assertEquals('is instance of class "Exception"', $constraint->toString()); + $this->assertEquals( + sprintf( + 'is instance of class "%s"', + \Exception::class + ), + $constraint->toString() + ); $this->assertCount(1, $constraint); $interfaceConstraint = Assert::isInstanceOf(Countable::class); $this->assertFalse($interfaceConstraint->evaluate(new stdClass, '', true)); $this->assertTrue($interfaceConstraint->evaluate(new ArrayObject, '', true)); - $this->assertEquals('is instance of interface "Countable"', $interfaceConstraint->toString()); + $this->assertEquals( + sprintf( + 'is instance of interface "%s"', + Countable::class + ), + $interfaceConstraint->toString() + ); try { $constraint->evaluate(new stdClass); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' -Failed asserting that stdClass Object () is an instance of class "Exception". + sprintf( + <<<'EOF' +Failed asserting that %s Object () is an instance of class "%s". EOF - , + , + stdClass::class, + \Exception::class + ), TestFailure::exceptionToString($e) ); @@ -507,12 +529,16 @@ public function testConstraintIsInstanceOf2(): void $constraint->evaluate(new stdClass, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' + sprintf( + <<<'EOF' custom message -Failed asserting that stdClass Object () is an instance of class "Exception". +Failed asserting that %s Object () is an instance of class "%s". EOF - , + , + stdClass::class, + \Exception::class + ), TestFailure::exceptionToString($e) ); @@ -530,18 +556,28 @@ public function testConstraintIsNotInstanceOf(): void $this->assertFalse($constraint->evaluate(new stdClass, '', true)); $this->assertTrue($constraint->evaluate(new Exception, '', true)); - $this->assertEquals('is not instance of class "stdClass"', $constraint->toString()); + $this->assertEquals( + sprintf( + 'is not instance of class "%s"', + stdClass::class + ), + $constraint->toString() + ); $this->assertCount(1, $constraint); try { $constraint->evaluate(new stdClass); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' -Failed asserting that stdClass Object () is not an instance of class "stdClass". + sprintf( + <<<'EOF' +Failed asserting that %s Object () is not an instance of class "%s". EOF - , + , + stdClass::class, + stdClass::class + ), TestFailure::exceptionToString($e) ); @@ -561,12 +597,16 @@ public function testConstraintIsNotInstanceOf2(): void $constraint->evaluate(new stdClass, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<<'EOF' + sprintf( + <<<'EOF' custom message -Failed asserting that stdClass Object () is not an instance of class "stdClass". +Failed asserting that %s Object () is not an instance of class "%s". EOF - , + , + stdClass::class, + stdClass::class + ), TestFailure::exceptionToString($e) ); @@ -857,11 +897,14 @@ public function testConstraintClassNotHasAttribute(): void $constraint->evaluate(ClassWithNonPublicAttributes::class); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<evaluate(ClassWithNonPublicAttributes::class, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<evaluate(ClassWithNonPublicAttributes::class); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<evaluate(ClassWithNonPublicAttributes::class, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<evaluate(new ClassWithNonPublicAttributes); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<evaluate(new ClassWithNonPublicAttributes, 'custom message'); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<evaluate($exception); } catch (ExpectationFailedException $e) { $this->assertEquals( - <<method('methodWithClassReturnTypeDeclaration'); $this->expectException(IncompatibleReturnValueException::class); - $this->expectExceptionMessage('Method methodWithClassReturnTypeDeclaration may not return value of type Foo, its declared return type is "stdClass"'); + $this->expectExceptionMessage(sprintf( + 'Method methodWithClassReturnTypeDeclaration may not return value of type Foo, its declared return type is "%s"', + stdClass::class + )); $invocationMocker->willReturn(new Foo); } diff --git a/tests/unit/Framework/MockObject/MockBuilderTest.php b/tests/unit/Framework/MockObject/MockBuilderTest.php index 659a169cb94..e1fa081df7a 100644 --- a/tests/unit/Framework/MockObject/MockBuilderTest.php +++ b/tests/unit/Framework/MockObject/MockBuilderTest.php @@ -55,7 +55,10 @@ public function testSetMethodsAllowsNonExistentMethodNames(): void public function testOnlyMethodsWithNonExistentMethodNames(): void { $this->expectException(CannotUseOnlyMethodsException::class); - $this->expectExceptionMessage('Trying to configure method "mockableMethodWithCrazyName" with onlyMethods(), but it does not exist in class "PHPUnit\TestFixture\Mockable". Use addMethods() for methods that do not exist in the class'); + $this->expectExceptionMessage(sprintf( + 'Trying to configure method "mockableMethodWithCrazyName" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class', + Mockable::class + )); $this->getMockBuilder(Mockable::class) ->onlyMethods(['mockableMethodWithCrazyName']) @@ -84,7 +87,10 @@ public function testOnlyMethodsWithEmptyArray(): void public function testAddMethodsWithNonExistentMethodNames(): void { $this->expectException(CannotUseAddMethodsException::class); - $this->expectExceptionMessage('Trying to configure method "mockableMethod" with addMethods(), but it exists in class "PHPUnit\TestFixture\Mockable". Use onlyMethods() for methods that exist in the class'); + $this->expectExceptionMessage(sprintf( + 'Trying to configure method "mockableMethod" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class', + Mockable::class + )); $this->getMockBuilder(Mockable::class) ->addMethods(['mockableMethod']) @@ -194,7 +200,7 @@ public function testByDefaultDoesNotPassArgumentsToTheConstructor(): void public function testMockClassNameCanBeSpecified(): void { $mock = $this->getMockBuilder(Mockable::class) - ->setMockClassName('ACustomClassName') + ->setMockClassName(ACustomClassName::class) ->getMock(); $this->assertInstanceOf(ACustomClassName::class, $mock); diff --git a/tests/unit/Framework/MockObject/MockObjectTest.php b/tests/unit/Framework/MockObject/MockObjectTest.php index 015f091a0c7..8d617a4e844 100644 --- a/tests/unit/Framework/MockObject/MockObjectTest.php +++ b/tests/unit/Framework/MockObject/MockObjectTest.php @@ -26,6 +26,7 @@ use PHPUnit\TestFixture\ClassWithStaticReturnTypes; use PHPUnit\TestFixture\ClassWithUnionReturnTypes; use PHPUnit\TestFixture\ExampleTrait; +use PHPUnit\TestFixture\FunctionCallbackWrapper; use PHPUnit\TestFixture\InterfaceWithMethodsThatDeclareBooleanReturnTypes; use PHPUnit\TestFixture\InterfaceWithStaticMethod; use PHPUnit\TestFixture\MethodCallback; @@ -295,7 +296,10 @@ public function testFunctionCallback(): void $mock->expects($this->once()) ->method('doSomething') - ->willReturnCallback('PHPUnit\TestFixture\FunctionCallbackWrapper::functionCallback'); + ->will($this->returnCallback(sprintf( + '%s::functionCallback', + FunctionCallbackWrapper::class + ))); $this->assertEquals('pass', $mock->doSomething('foo', 'bar')); @@ -305,7 +309,10 @@ public function testFunctionCallback(): void $mock->expects($this->once()) ->method('doSomething') - ->willReturnCallback('PHPUnit\TestFixture\FunctionCallbackWrapper::functionCallback'); + ->willReturnCallback(sprintf( + '%s::functionCallback', + FunctionCallbackWrapper::class + )); $this->assertEquals('pass', $mock->doSomething('foo', 'bar')); } @@ -725,9 +732,15 @@ public function testVerificationOfMethodNameFailsWithWrongParameters(): void $mock->right(['second']); } catch (ExpectationFailedException $e) { $this->assertSame( - "Expectation failed for method name is \"right\" when invoked 1 time(s)\n" . - 'Parameter 0 for invocation PHPUnit\TestFixture\SomeClass::right(Array (...)) does not match expected value.' . "\n" . - 'Failed asserting that two arrays are equal.', + sprintf( + <<<'EOF' +Expectation failed for method name is "right" when invoked 1 time(s) +Parameter 0 for invocation %s::right(Array (...)) does not match expected value. +Failed asserting that two arrays are equal. +EOF + , + SomeClass::class + ), $e->getMessage() ); } @@ -739,17 +752,24 @@ public function testVerificationOfMethodNameFailsWithWrongParameters(): void // $this->fail('Expected exception'); } catch (ExpectationFailedException $e) { $this->assertSame( - "Expectation failed for method name is \"right\" when invoked 1 time(s).\n" . - 'Parameter 0 for invocation PHPUnit\TestFixture\SomeClass::right(Array (...)) does not match expected value.' . "\n" . - 'Failed asserting that two arrays are equal.' . "\n" . - '--- Expected' . "\n" . - '+++ Actual' . "\n" . - '@@ @@' . "\n" . - ' Array (' . "\n" . - '- 0 => \'first\'' . "\n" . - '- 1 => \'second\'' . "\n" . - '+ 0 => \'second\'' . "\n" . - ' )' . "\n", + sprintf( + <<<'EOF' +Expectation failed for method name is "right" when invoked 1 time(s). +Parameter 0 for invocation %s::right(Array (...)) does not match expected value. +Failed asserting that two arrays are equal. +--- Expected ++++ Actual +@@ @@ + Array ( +- 0 => 'first' +- 1 => 'second' ++ 0 => 'second' + ) + +EOF + , + SomeClass::class + ), $e->getMessage() ); } @@ -772,7 +792,10 @@ public function testVerificationOfNeverFailsWithEmptyParameters(): void $this->fail('Expected exception'); } catch (ExpectationFailedException $e) { $this->assertSame( - 'PHPUnit\TestFixture\SomeClass::right() was not expected to be called.', + sprintf( + '%s::right() was not expected to be called.', + SomeClass::class + ), $e->getMessage() ); } @@ -795,7 +818,10 @@ public function testVerificationOfNeverFailsWithAnyParameters(): void $this->fail('Expected exception'); } catch (ExpectationFailedException $e) { $this->assertSame( - 'PHPUnit\TestFixture\SomeClass::right() was not expected to be called.', + sprintf( + '%s::right() was not expected to be called.', + SomeClass::class + ), $e->getMessage() ); } @@ -818,9 +844,15 @@ public function testWithAnythingInsteadOfWithAnyParameters(): void $this->fail('Expected exception'); } catch (ExpectationFailedException $e) { $this->assertSame( - "Expectation failed for method name is \"right\" when invoked 1 time(s)\n" . - 'Parameter count for invocation PHPUnit\TestFixture\SomeClass::right() is too low.' . "\n" . - 'To allow 0 or more parameters with any value, omit ->with() or use ->withAnyParameters() instead.', + sprintf( + <<<'EOF' +Expectation failed for method name is "right" when invoked 1 time(s) +Parameter count for invocation %s::right() is too low. +To allow 0 or more parameters with any value, omit ->with() or use ->withAnyParameters() instead. +EOF + , + SomeClass::class + ), $e->getMessage() ); } @@ -1032,7 +1064,6 @@ public function traversableProvider(): array { return [ Traversable::class => [Traversable::class], - '\Traversable' => [Traversable::class], TraversableMockTestInterface::class => [TraversableMockTestInterface::class], ]; } @@ -1075,7 +1106,10 @@ public function testDisableAutomaticReturnValueGeneration(): void ->getMock(); $this->expectException(ReturnValueNotConfiguredException::class); - $this->expectExceptionMessage('Return value inference disabled and no expectation set up for PHPUnit\TestFixture\SomeClass::doSomethingElse()'); + $this->expectExceptionMessage(sprintf( + 'Return value inference disabled and no expectation set up for %s::doSomethingElse()', + SomeClass::class + )); $mock->doSomethingElse(1); } @@ -1094,7 +1128,10 @@ public function testDisableAutomaticReturnValueGenerationWithToString(): void $this->fail('Exception expected'); } catch (RuntimeException $e) { $this->assertSame( - 'Return value inference disabled and no expectation set up for PHPUnit\TestFixture\StringableClass::__toString()', + sprintf( + 'Return value inference disabled and no expectation set up for %s::__toString()', + StringableClass::class + ), $e->getMessage() ); } diff --git a/tests/unit/Framework/TestCaseTest.php b/tests/unit/Framework/TestCaseTest.php index ad094f09b0a..a5bb05b0d11 100644 --- a/tests/unit/Framework/TestCaseTest.php +++ b/tests/unit/Framework/TestCaseTest.php @@ -100,7 +100,10 @@ public static function tearDownAfterClass(): void public function testCaseToString(): void { $this->assertEquals( - 'PHPUnit\Framework\TestCaseTest::testCaseToString', + sprintf( + '%s::testCaseToString', + self::class + ), $this->toString() ); } @@ -1130,7 +1133,10 @@ public function testRunBareThrowsExceptionWhenTestHasInvalidName($name): void $testCase = new TestWithDifferentNames($name); $this->expectException(Exception::class); - $this->expectExceptionMessage('PHPUnit\Framework\TestCase::$name must be a non-blank string.'); + $this->expectExceptionMessage(sprintf( + '%s::$name must be a non-blank string.', + TestCase::class + )); $testCase->runBare(); } diff --git a/tests/unit/Framework/TestSuiteTest.php b/tests/unit/Framework/TestSuiteTest.php index 8b57ab6018f..fd182e67e5b 100644 --- a/tests/unit/Framework/TestSuiteTest.php +++ b/tests/unit/Framework/TestSuiteTest.php @@ -61,7 +61,7 @@ protected function tearDown(): void */ public function testSuiteNameCanBeSameAsExistingNonTestClassName(): void { - $suite = new TestSuite('stdClass'); + $suite = new TestSuite(stdClass::class); $suite->addTestSuite(OneTestCase::class); $suite->run($this->result); diff --git a/tests/unit/Runner/TestSuiteSorterTest.php b/tests/unit/Runner/TestSuiteSorterTest.php index ea3d3253d5d..75465a5386f 100644 --- a/tests/unit/Runner/TestSuiteSorterTest.php +++ b/tests/unit/Runner/TestSuiteSorterTest.php @@ -598,7 +598,13 @@ public function testCanHandleSuiteWithEmptyTestCase(): void $sorter->reorderTestsInSuite($suite, TestSuiteSorter::ORDER_DEFAULT, false, TestSuiteSorter::ORDER_DEFAULT); $this->assertSame(EmptyTestCaseTest::class, $suite->tests()[0]->getName()); - $this->assertSame('No tests found in class "PHPUnit\TestFixture\EmptyTestCaseTest".', $suite->tests()[0]->tests()[0]->getMessage()); + $this->assertSame( + sprintf( + 'No tests found in class "%s".', + EmptyTestCaseTest::class + ), + $suite->tests()[0]->tests()[0]->getMessage() + ); } public function suiteSorterOptionPermutationsProvider(): array diff --git a/tests/unit/Util/TestClassTest.php b/tests/unit/Util/TestClassTest.php index f8d5d7faa1e..4d0d140a2ee 100644 --- a/tests/unit/Util/TestClassTest.php +++ b/tests/unit/Util/TestClassTest.php @@ -1376,35 +1376,30 @@ public function getLinesToBeCoveredProvider(): array [ TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35), ], - ], [ CoverageNotPrivateTest::class, [ TEST_FILES_PATH . 'CoveredClass.php' => array_merge(range(31, 35), range(37, 41)), ], - ], [ CoverageNotProtectedTest::class, [ TEST_FILES_PATH . 'CoveredClass.php' => array_merge(range(31, 35), range(43, 45)), ], - ], [ CoverageNotPublicTest::class, [ TEST_FILES_PATH . 'CoveredClass.php' => array_merge(range(37, 41), range(43, 45)), ], - ], [ CoveragePrivateTest::class, [ TEST_FILES_PATH . 'CoveredClass.php' => range(43, 45), ], - ], [ CoverageProtectedTest::class, @@ -1418,7 +1413,6 @@ public function getLinesToBeCoveredProvider(): array [ TEST_FILES_PATH . 'CoveredClass.php' => range(31, 35), ], - ], [ CoverageFunctionTest::class, diff --git a/tests/unit/Util/XmlTest.php b/tests/unit/Util/XmlTest.php index 57040cb0e14..ed1684f9a51 100644 --- a/tests/unit/Util/XmlTest.php +++ b/tests/unit/Util/XmlTest.php @@ -42,8 +42,10 @@ public function testPrepareString(string $char): void $this->assertNull( $e, sprintf( - '\PHPUnit\Util\Xml::prepareString("\x%02x") should not crash DomDocument', - ord($char) + '%s::prepareString("\x%02x") should not crash %s', + Xml::class, + ord($char), + DOMDocument::class ) ); } From d48009b6a37f4a74cdbb3efbfc1273d0890d2a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 6 Mar 2022 18:13:56 +0100 Subject: [PATCH 03/93] Fix: Use PHPUnit\TestFixture as namespace for test fixtures --- tests/_files/3194.php | 4 +- tests/_files/AbstractMockTestClass.php | 2 + tests/_files/AbstractTest.php | 2 + tests/_files/AbstractTrait.php | 2 + ...bstractVariousIterableDataProviderTest.php | 2 + tests/_files/AnInterface.php | 2 + tests/_files/AnInterfaceWithReturnType.php | 2 + tests/_files/ArrayAccessible.php | 10 +- tests/_files/AssertionExample.php | 6 +- tests/_files/AssertionExampleTest.php | 2 + tests/_files/Author.php | 2 + tests/_files/BankAccount.php | 4 + tests/_files/BankAccountTest.php | 2 + tests/_files/BankAccountTest.test.php | 2 + tests/_files/Bar.php | 2 + tests/_files/BeforeAndAfterTest.php | 2 + tests/_files/BeforeClassAndAfterClassTest.php | 2 + .../BeforeClassWithOnlyDataProviderTest.php | 2 + tests/_files/Book.php | 2 + .../ChangeCurrentWorkingDirectoryTest.php | 5 +- .../ClassThatImplementsSerializable.php | 10 +- .../ClassWithAllPossibleReturnTypes.php | 14 +- tests/_files/ClassWithNonPublicAttributes.php | 2 + .../ClassWithScalarTypeDeclarations.php | 2 + tests/_files/ClassWithSelfTypeHint.php | 2 + tests/_files/ClassWithStaticMethod.php | 2 + tests/_files/ClassWithToString.php | 2 + .../ClassWithVariadicArgumentMethod.php | 2 + tests/_files/ConcreteTest.my.php | 2 + tests/_files/ConcreteTest.php | 2 + tests/_files/CountConstraint.php | 5 +- .../_files/CoverageNamespacedFunctionTest.php | 6 +- .../CoverageTwoDefaultClassAnnotations.php | 4 +- tests/_files/CustomPrinter.php | 2 + tests/_files/DataProviderDependencyTest.php | 6 +- tests/_files/DataProviderFilterTest.php | 2 + tests/_files/DataProviderIncompleteTest.php | 2 + .../DataProviderIssue2833/FirstTest.php | 2 +- .../DataProviderIssue2833/SecondTest.php | 2 +- .../another/TestWithDataProviderTest.php | 2 +- .../DataProviderIssue2922/FirstTest.php | 2 +- .../DataProviderIssue2922/SecondTest.php | 2 +- tests/_files/DataProviderSkippedTest.php | 2 + tests/_files/DataProviderTest.php | 2 + tests/_files/DependencyFailureTest.php | 2 + tests/_files/DependencySuccessTest.php | 4 +- tests/_files/DoNoAssertionTestCase.php | 2 + ...mAssertionsButPerformingAssertionsTest.php | 2 + tests/_files/DoubleTestCase.php | 2 + tests/_files/DummyBarTest.php | 2 + tests/_files/DummyException.php | 4 + tests/_files/DuplicateKeyDataProviderTest.php | 2 + tests/_files/EmptyDataProviderTest.php | 2 + tests/_files/EmptyTestCaseTest.php | 2 + tests/_files/ExampleTrait.php | 2 + .../ExceptionInAssertPostConditionsTest.php | 3 + .../ExceptionInAssertPreConditionsTest.php | 3 + tests/_files/ExceptionInSetUpTest.php | 3 + .../ExceptionInTearDownAfterClassTest.php | 3 + tests/_files/ExceptionInTearDownTest.php | 3 + tests/_files/ExceptionInTest.php | 3 + .../ExceptionInTestDetectedInTeardown.php | 4 +- tests/_files/ExceptionStackTest.php | 6 +- tests/_files/ExceptionWithThrowable.php | 6 +- tests/_files/Failure.php | 2 + tests/_files/FailureTest.php | 3 + tests/_files/FalsyConstraint.php | 5 +- tests/_files/FatalTest.php | 12 +- tests/_files/FinalClass.php | 2 + tests/_files/Foo.php | 2 + tests/_files/FunctionCallback.php | 6 +- tests/_files/IncompleteTest.php | 2 + tests/_files/Inheritance/InheritanceA.php | 2 +- tests/_files/Inheritance/InheritanceB.php | 2 + tests/_files/InheritedTestCase.php | 2 + tests/_files/IniTest.php | 5 +- .../InterfaceWithSemiReservedMethodName.php | 2 + tests/_files/InterfaceWithStaticMethod.php | 2 + tests/_files/IsolationTest.php | 2 + tests/_files/MethodCallback.php | 8 +- tests/_files/MethodCallbackByReference.php | 2 + tests/_files/MockTestInterface.php | 2 + tests/_files/Mockable.php | 2 + tests/_files/ModifiedConstructorTestCase.php | 2 + tests/_files/MultipleDataProviderTest.php | 3 + tests/_files/MyTestListener.php | 3 + tests/_files/NamedConstraint.php | 2 + .../NamespaceCoverageClassExtendedTest.php | 6 +- tests/_files/NamespaceCoverageClassTest.php | 6 +- ...NamespaceCoverageCoversClassPublicTest.php | 6 +- .../NamespaceCoverageCoversClassTest.php | 12 +- tests/_files/NamespaceCoverageMethodTest.php | 6 +- .../NamespaceCoverageNotPrivateTest.php | 6 +- .../NamespaceCoverageNotProtectedTest.php | 6 +- .../_files/NamespaceCoverageNotPublicTest.php | 6 +- tests/_files/NamespaceCoveragePrivateTest.php | 6 +- .../_files/NamespaceCoverageProtectedTest.php | 6 +- tests/_files/NamespaceCoveragePublicTest.php | 6 +- tests/_files/NamespaceCoveredClass.php | 2 +- tests/_files/NamespaceCoveredFunction.php | 2 +- tests/_files/NoArgTestCaseTest.php | 2 + tests/_files/NoTestCases.php | 2 + .../_files/NotExistingCoveredElementTest.php | 2 + tests/_files/NotPublicTestCase.php | 2 + tests/_files/NotSelfDescribingTest.php | 2 + tests/_files/NotVoidTestCase.php | 2 + tests/_files/NothingTest.php | 2 + tests/_files/NumericGroupAnnotationTest.php | 6 +- tests/_files/OneTestCase.php | 2 + tests/_files/OutputTestCase.php | 2 + tests/_files/OverrideTestCase.php | 2 + .../_files/ParseTestMethodAnnotationsMock.php | 2 + tests/_files/PartialMockTestClass.php | 2 + .../RequirementsClassBeforeClassHookTest.php | 3 + .../_files/RequirementsClassDocBlockTest.php | 2 + tests/_files/RequirementsTest.php | 2 + tests/_files/SampleArrayAccess.php | 5 + tests/_files/SampleClass.php | 2 + tests/_files/SeparateProcessesTest.php | 2 + tests/_files/Singleton.php | 2 + tests/_files/SingletonClass.php | 2 + tests/_files/SomeClass.php | 2 + tests/_files/StopOnErrorTestSuite.php | 7 +- tests/_files/StopOnWarningTestSuite.php | 1 + tests/_files/StringableClass.php | 2 + tests/_files/Struct.php | 2 + tests/_files/Success.php | 2 + tests/_files/TestAutoreferenced.php | 2 + tests/_files/TestCaseWithExceptionInHook.php | 2 + tests/_files/TestGeneratorMaker.php | 2 + tests/_files/TestIncomplete.php | 2 + tests/_files/TestIterator.php | 8 +- tests/_files/TestIterator2.php | 19 +- tests/_files/TestIteratorAggregate.php | 6 + tests/_files/TestIteratorAggregate2.php | 6 + tests/_files/TestProxyFixture.php | 4 + tests/_files/TestRisky.php | 2 + tests/_files/TestSkipped.php | 2 + tests/_files/TestTestError.php | 2 + tests/_files/TestWarning.php | 2 + tests/_files/TestWithAnnotations.php | 2 + tests/_files/TestWithDifferentNames.php | 2 + tests/_files/TestWithDifferentOutput.php | 2 + tests/_files/TestWithDifferentSizes.php | 2 + tests/_files/TestWithDifferentStatuses.php | 9 +- tests/_files/TestWithTest.php | 2 + tests/_files/TestableCliTestDoxPrinter.php | 4 +- tests/_files/ThrowExceptionTestCase.php | 3 + tests/_files/ThrowNoExceptionTestCase.php | 2 + tests/_files/TraitWithConstructor.php | 2 + tests/_files/TraversableMockTestInterface.php | 6 +- tests/_files/TruthyConstraint.php | 5 +- .../VariousDocblockDefinedDataProvider.php | 2 + .../VariousIterableDataProviderTest.php | 2 + tests/_files/WasRun.php | 2 + tests/_files/WrapperIteratorAggregate.php | 12 +- .../someNamespaceA/NamespacedClass.php | 2 +- .../someNamespaceB/NamespacedClass.php | 2 +- .../tests/OneTest.php | 2 + tests/basic/unit/StatusTest.php | 4 +- tests/end-to-end/abstract-test-class.phpt | 2 +- tests/end-to-end/assertion.phpt | 2 +- .../dataprovider-log-xml-isolation.phpt | 16 +- tests/end-to-end/dataprovider-log-xml.phpt | 16 +- tests/end-to-end/defaulttestsuite.phpt | 2 +- tests/end-to-end/empty-testcase.phpt | 2 +- tests/end-to-end/exception-stack.phpt | 4 +- .../_files/DependencyTestSuite.php | 2 + .../dependencies-isolation.phpt | 20 +- .../stop-on-defect-via-cli.phpt | 2 +- .../stop-on-defect-via-config.phpt | 2 +- .../stop-on-error-via-cli.phpt | 2 +- .../stop-on-error-via-config.phpt | 2 +- .../stop-on-warning-via-cli.phpt | 2 +- .../stop-on-warning-via-config.phpt | 2 +- ...order-size-with-dependency-resolution.phpt | 32 +-- tests/end-to-end/failure-isolation.phpt | 26 +-- tests/end-to-end/failure.phpt | 26 +-- tests/end-to-end/fatal-isolation.phpt | 2 +- tests/end-to-end/group.phpt | 2 +- tests/end-to-end/list-tests-dataprovider.phpt | 8 +- .../list-tests-xml-dataprovider.phpt | 2 +- .../_files/configuration.custom-printer.xml | 2 +- .../loggers/custom-printer-debug.phpt | 12 +- .../loggers/custom-printer-verbose.phpt | 2 +- .../loggers/failure-reverse-list.phpt | 26 +-- tests/end-to-end/loggers/log-teamcity.phpt | 10 +- .../loggers/teamcity-inner-exceptions.phpt | 8 +- tests/end-to-end/loggers/teamcity.phpt | 10 +- tests/end-to-end/loggers/testdox-html.phpt | 2 +- tests/end-to-end/loggers/testdox-text.phpt | 2 +- tests/end-to-end/loggers/testdox-xml.phpt | 30 +-- ...ated-with-does-not-perform-assertions.phpt | 2 +- .../report-useless-tests-isolation.phpt | 4 +- tests/end-to-end/report-useless-tests.phpt | 4 +- .../requires-skip-code-location-hints.phpt | 72 +++--- tests/end-to-end/separate-processes-test.phpt | 4 +- tests/unit/Framework/AssertTest.php | 14 +- .../Framework/Constraint/ArraySubsetTest.php | 2 +- .../Constraint/ClassHasAttributeTest.php | 2 +- .../ClassHasStaticAttributeTest.php | 2 +- tests/unit/Framework/Constraint/CountTest.php | 10 +- .../Framework/Constraint/LogicalAndTest.php | 8 +- .../Framework/Constraint/LogicalOrTest.php | 8 +- .../Constraint/ObjectHasAttributeTest.php | 2 +- .../Framework/Constraint/SameSizeTest.php | 2 +- tests/unit/Framework/ConstraintTest.php | 6 +- .../Builder/InvocationMockerTest.php | 10 +- .../Framework/MockObject/GeneratorTest.php | 18 +- .../MockObject/InvocationHandlerTest.php | 2 +- .../Framework/MockObject/MockBuilderTest.php | 2 +- .../Framework/MockObject/MockObjectTest.php | 34 +-- .../Framework/MockObject/ProxyObjectTest.php | 2 +- tests/unit/Framework/TestBuilderTest.php | 6 +- tests/unit/Framework/TestCaseTest.php | 56 ++--- tests/unit/Framework/TestFailureTest.php | 4 +- tests/unit/Framework/TestImplementorTest.php | 4 +- tests/unit/Framework/TestListenerTest.php | 8 +- .../unit/Framework/TestSuiteIteratorTest.php | 2 +- tests/unit/Framework/TestSuiteTest.php | 37 ++- .../Runner/Filter/NameFilterIteratorTest.php | 2 +- .../unit/Runner/ResultCacheExtensionTest.php | 16 +- tests/unit/Runner/TestSuiteSorterTest.php | 4 +- tests/unit/Util/Annotation/RegistryTest.php | 4 +- tests/unit/Util/TestClassTest.php | 216 +++++++++--------- .../TestDox/CliTestDoxPrinterColorTest.php | 1 + .../Util/TestDox/CliTestDoxPrinterTest.php | 1 + tests/unit/Util/XmlTest.php | 2 +- 228 files changed, 892 insertions(+), 506 deletions(-) diff --git a/tests/_files/3194.php b/tests/_files/3194.php index deef7e44723..7c012b48589 100644 --- a/tests/_files/3194.php +++ b/tests/_files/3194.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; trait T3194 @@ -28,7 +30,7 @@ public function doSomething(): bool } /** - * @covers C3194 + * @covers \PHPUnit\TestFixture\C3194 */ final class Test3194 extends TestCase { diff --git a/tests/_files/AbstractMockTestClass.php b/tests/_files/AbstractMockTestClass.php index fc1a189c012..580fb133d8c 100644 --- a/tests/_files/AbstractMockTestClass.php +++ b/tests/_files/AbstractMockTestClass.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + abstract class AbstractMockTestClass implements MockTestInterface { abstract public function doSomething(); diff --git a/tests/_files/AbstractTest.php b/tests/_files/AbstractTest.php index 8ad818f9ada..d45ed8014c6 100644 --- a/tests/_files/AbstractTest.php +++ b/tests/_files/AbstractTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; abstract class AbstractTest extends TestCase diff --git a/tests/_files/AbstractTrait.php b/tests/_files/AbstractTrait.php index d539da3983a..b064c0ed95d 100644 --- a/tests/_files/AbstractTrait.php +++ b/tests/_files/AbstractTrait.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + trait AbstractTrait { abstract public function doSomething(); diff --git a/tests/_files/AbstractVariousIterableDataProviderTest.php b/tests/_files/AbstractVariousIterableDataProviderTest.php index ac2f1d4fc5a..486ee02f01e 100644 --- a/tests/_files/AbstractVariousIterableDataProviderTest.php +++ b/tests/_files/AbstractVariousIterableDataProviderTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + abstract class AbstractVariousIterableDataProviderTest { abstract public function asArrayProvider(); diff --git a/tests/_files/AnInterface.php b/tests/_files/AnInterface.php index 42c55d6b082..cef55b94ee2 100644 --- a/tests/_files/AnInterface.php +++ b/tests/_files/AnInterface.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + interface AnInterface { public function doSomething(); diff --git a/tests/_files/AnInterfaceWithReturnType.php b/tests/_files/AnInterfaceWithReturnType.php index 3fefd96394a..d605f442cce 100644 --- a/tests/_files/AnInterfaceWithReturnType.php +++ b/tests/_files/AnInterfaceWithReturnType.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + interface AnInterfaceWithReturnType { public function returnAnArray(): array; diff --git a/tests/_files/ArrayAccessible.php b/tests/_files/ArrayAccessible.php index 4568589b151..029ffaea878 100644 --- a/tests/_files/ArrayAccessible.php +++ b/tests/_files/ArrayAccessible.php @@ -7,6 +7,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function array_key_exists; +use ArrayAccess; +use ArrayIterator; +use IteratorAggregate; +use ReturnTypeWillChange; + class ArrayAccessible implements ArrayAccess, IteratorAggregate { private $array; @@ -19,7 +27,7 @@ public function __construct(array $array = []) #[ReturnTypeWillChange] public function offsetExists($offset) { - return \array_key_exists($offset, $this->array); + return array_key_exists($offset, $this->array); } #[ReturnTypeWillChange] diff --git a/tests/_files/AssertionExample.php b/tests/_files/AssertionExample.php index 752904f13df..56ae6d47cc0 100644 --- a/tests/_files/AssertionExample.php +++ b/tests/_files/AssertionExample.php @@ -7,10 +7,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function assert; + class AssertionExample { public function doSomething(): void { - \assert(false); + assert(false); } } diff --git a/tests/_files/AssertionExampleTest.php b/tests/_files/AssertionExampleTest.php index cf0f77d621b..3e0fd35ac35 100644 --- a/tests/_files/AssertionExampleTest.php +++ b/tests/_files/AssertionExampleTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class AssertionExampleTest extends TestCase diff --git a/tests/_files/Author.php b/tests/_files/Author.php index 2ff8945050b..faa782e5f38 100644 --- a/tests/_files/Author.php +++ b/tests/_files/Author.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + /** * An author. */ diff --git a/tests/_files/BankAccount.php b/tests/_files/BankAccount.php index ddc68dbe552..9620387905c 100644 --- a/tests/_files/BankAccount.php +++ b/tests/_files/BankAccount.php @@ -7,6 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use RuntimeException; + class BankAccountException extends RuntimeException { } diff --git a/tests/_files/BankAccountTest.php b/tests/_files/BankAccountTest.php index bb1f140e0e3..cdaea4e8e10 100644 --- a/tests/_files/BankAccountTest.php +++ b/tests/_files/BankAccountTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; /** diff --git a/tests/_files/BankAccountTest.test.php b/tests/_files/BankAccountTest.test.php index 40b252b183d..8e19d320403 100644 --- a/tests/_files/BankAccountTest.test.php +++ b/tests/_files/BankAccountTest.test.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; /** diff --git a/tests/_files/Bar.php b/tests/_files/Bar.php index 3f2e16bc6f4..764b3bec66b 100644 --- a/tests/_files/Bar.php +++ b/tests/_files/Bar.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class Bar { public function doSomethingElse() diff --git a/tests/_files/BeforeAndAfterTest.php b/tests/_files/BeforeAndAfterTest.php index c1bda6c34c4..4fa69554706 100644 --- a/tests/_files/BeforeAndAfterTest.php +++ b/tests/_files/BeforeAndAfterTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class BeforeAndAfterTest extends TestCase diff --git a/tests/_files/BeforeClassAndAfterClassTest.php b/tests/_files/BeforeClassAndAfterClassTest.php index 9344103476b..7cc0ee30784 100644 --- a/tests/_files/BeforeClassAndAfterClassTest.php +++ b/tests/_files/BeforeClassAndAfterClassTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class BeforeClassAndAfterClassTest extends TestCase diff --git a/tests/_files/BeforeClassWithOnlyDataProviderTest.php b/tests/_files/BeforeClassWithOnlyDataProviderTest.php index 86984984701..6e59af78e70 100644 --- a/tests/_files/BeforeClassWithOnlyDataProviderTest.php +++ b/tests/_files/BeforeClassWithOnlyDataProviderTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class BeforeClassWithOnlyDataProviderTest extends \PHPUnit\Framework\TestCase { public static $setUpBeforeClassWasCalled; diff --git a/tests/_files/Book.php b/tests/_files/Book.php index c20655ec777..b434d74b5a3 100644 --- a/tests/_files/Book.php +++ b/tests/_files/Book.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + /** * A book. */ diff --git a/tests/_files/ChangeCurrentWorkingDirectoryTest.php b/tests/_files/ChangeCurrentWorkingDirectoryTest.php index 6d5a288f8a0..4d3e6666d3c 100644 --- a/tests/_files/ChangeCurrentWorkingDirectoryTest.php +++ b/tests/_files/ChangeCurrentWorkingDirectoryTest.php @@ -7,13 +7,16 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function chdir; use PHPUnit\Framework\TestCase; class ChangeCurrentWorkingDirectoryTest extends TestCase { public function testSomethingThatChangesTheCwd(): void { - \chdir('../'); + chdir('../'); $this->assertTrue(true); } } diff --git a/tests/_files/ClassThatImplementsSerializable.php b/tests/_files/ClassThatImplementsSerializable.php index 7bbd40c7785..6f92e44b4bc 100644 --- a/tests/_files/ClassThatImplementsSerializable.php +++ b/tests/_files/ClassThatImplementsSerializable.php @@ -7,16 +7,22 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function get_object_vars; +use function unserialize; +use Serializable; + class ClassThatImplementsSerializable implements Serializable { public function serialize() { - return \get_object_vars($this); + return get_object_vars($this); } public function unserialize($serialized): void { - foreach (\unserialize($serialized) as $key => $value) { + foreach (unserialize($serialized) as $key => $value) { $this->{$key} = $value; } } diff --git a/tests/_files/ClassWithAllPossibleReturnTypes.php b/tests/_files/ClassWithAllPossibleReturnTypes.php index 77c6b85b741..19e2707eb3c 100644 --- a/tests/_files/ClassWithAllPossibleReturnTypes.php +++ b/tests/_files/ClassWithAllPossibleReturnTypes.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class ClassWithAllPossibleReturnTypes { public function methodWithNoReturnTypeDeclaration() @@ -42,23 +44,23 @@ public function methodWithArrayReturnTypeDeclaration(): array return ['string']; } - public function methodWithTraversableReturnTypeDeclaration(): Traversable + public function methodWithTraversableReturnTypeDeclaration(): \Traversable { - return new ArrayIterator(['string']); + return new \ArrayIterator(['string']); } - public function methodWithGeneratorReturnTypeDeclaration(): Generator + public function methodWithGeneratorReturnTypeDeclaration(): \Generator { yield 1; } public function methodWithObjectReturnTypeDeclaration(): object { - return new Exception; + return new \Exception; } - public function methodWithClassReturnTypeDeclaration(): stdClass + public function methodWithClassReturnTypeDeclaration(): \stdClass { - return new stdClass; + return new \stdClass; } } diff --git a/tests/_files/ClassWithNonPublicAttributes.php b/tests/_files/ClassWithNonPublicAttributes.php index 128d57c8bfe..c917edc08e1 100644 --- a/tests/_files/ClassWithNonPublicAttributes.php +++ b/tests/_files/ClassWithNonPublicAttributes.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class ParentClassWithPrivateAttributes { private static $privateStaticParentAttribute = 'foo'; diff --git a/tests/_files/ClassWithScalarTypeDeclarations.php b/tests/_files/ClassWithScalarTypeDeclarations.php index 1da2a33606f..d18c85606ad 100644 --- a/tests/_files/ClassWithScalarTypeDeclarations.php +++ b/tests/_files/ClassWithScalarTypeDeclarations.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class ClassWithScalarTypeDeclarations { public function foo(string $string, int $int): void diff --git a/tests/_files/ClassWithSelfTypeHint.php b/tests/_files/ClassWithSelfTypeHint.php index 299b68f46c4..8a69e07519a 100644 --- a/tests/_files/ClassWithSelfTypeHint.php +++ b/tests/_files/ClassWithSelfTypeHint.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class ClassWithSelfTypeHint { public function foo(self $foo): void diff --git a/tests/_files/ClassWithStaticMethod.php b/tests/_files/ClassWithStaticMethod.php index 7eb953f6b31..d636e773b27 100644 --- a/tests/_files/ClassWithStaticMethod.php +++ b/tests/_files/ClassWithStaticMethod.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class ClassWithStaticMethod { public static function staticMethod(): void diff --git a/tests/_files/ClassWithToString.php b/tests/_files/ClassWithToString.php index 1a1f46808fe..f19f9fa6968 100644 --- a/tests/_files/ClassWithToString.php +++ b/tests/_files/ClassWithToString.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + /** * A class with a __toString() method. */ diff --git a/tests/_files/ClassWithVariadicArgumentMethod.php b/tests/_files/ClassWithVariadicArgumentMethod.php index 33bafa12ebd..283953ca064 100644 --- a/tests/_files/ClassWithVariadicArgumentMethod.php +++ b/tests/_files/ClassWithVariadicArgumentMethod.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + /** * A class with a method that takes a variadic argument. */ diff --git a/tests/_files/ConcreteTest.my.php b/tests/_files/ConcreteTest.my.php index 91d86b25927..3baed6ada88 100644 --- a/tests/_files/ConcreteTest.my.php +++ b/tests/_files/ConcreteTest.my.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class ConcreteWithMyCustomExtensionTest extends AbstractTest { public function testTwo(): void diff --git a/tests/_files/ConcreteTest.php b/tests/_files/ConcreteTest.php index 2355c4454bd..df33f32c53c 100644 --- a/tests/_files/ConcreteTest.php +++ b/tests/_files/ConcreteTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class ConcreteTest extends AbstractTest { public function testTwo(): void diff --git a/tests/_files/CountConstraint.php b/tests/_files/CountConstraint.php index 4a9e63716f9..4b12c7f0c16 100644 --- a/tests/_files/CountConstraint.php +++ b/tests/_files/CountConstraint.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function sprintf; use PHPUnit\Framework\Constraint\Constraint; final class CountConstraint extends Constraint @@ -32,7 +35,7 @@ public function matches($other): bool public function toString(): string { - return \sprintf( + return sprintf( 'is accepted by %s', self::class ); diff --git a/tests/_files/CoverageNamespacedFunctionTest.php b/tests/_files/CoverageNamespacedFunctionTest.php index 5dd1ded7327..56108ae00f1 100644 --- a/tests/_files/CoverageNamespacedFunctionTest.php +++ b/tests/_files/CoverageNamespacedFunctionTest.php @@ -7,15 +7,17 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class CoverageNamespacedFunctionTest extends TestCase { /** - * @covers foo\func() + * @covers PHPUnit\TestFixture\func() */ public function testFunc(): void { - foo\func(); + func(); } } diff --git a/tests/_files/CoverageTwoDefaultClassAnnotations.php b/tests/_files/CoverageTwoDefaultClassAnnotations.php index 01c111e42af..bc31987fc3f 100644 --- a/tests/_files/CoverageTwoDefaultClassAnnotations.php +++ b/tests/_files/CoverageTwoDefaultClassAnnotations.php @@ -14,11 +14,11 @@ class CoverageTwoDefaultClassAnnotations { /** - * @covers Foo\CoveredClass:: + * @covers PHPUnit\TestFixture\CoveredClass:: */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new PHPUnit\TestFixture\CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/CustomPrinter.php b/tests/_files/CustomPrinter.php index 3b89cb40a8e..4bcae961c6d 100644 --- a/tests/_files/CustomPrinter.php +++ b/tests/_files/CustomPrinter.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\TextUI\ResultPrinter; class CustomPrinter extends ResultPrinter diff --git a/tests/_files/DataProviderDependencyTest.php b/tests/_files/DataProviderDependencyTest.php index 13828310b65..c05073f0b83 100644 --- a/tests/_files/DataProviderDependencyTest.php +++ b/tests/_files/DataProviderDependencyTest.php @@ -7,7 +7,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -class DataProviderDependencyTest extends PHPUnit\Framework\TestCase +namespace PHPUnit\TestFixture; + +use PHPUnit\Framework\TestCase; + +class DataProviderDependencyTest extends TestCase { public function testReference(): void { diff --git a/tests/_files/DataProviderFilterTest.php b/tests/_files/DataProviderFilterTest.php index bd98373823d..bc3e6840905 100644 --- a/tests/_files/DataProviderFilterTest.php +++ b/tests/_files/DataProviderFilterTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DataProviderFilterTest extends TestCase diff --git a/tests/_files/DataProviderIncompleteTest.php b/tests/_files/DataProviderIncompleteTest.php index 3643173348a..992c006baf0 100644 --- a/tests/_files/DataProviderIncompleteTest.php +++ b/tests/_files/DataProviderIncompleteTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DataProviderIncompleteTest extends TestCase diff --git a/tests/_files/DataProviderIssue2833/FirstTest.php b/tests/_files/DataProviderIssue2833/FirstTest.php index 82db2e4e389..1e57c2126c0 100644 --- a/tests/_files/DataProviderIssue2833/FirstTest.php +++ b/tests/_files/DataProviderIssue2833/FirstTest.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Foo\DataProviderIssue2833; +namespace PHPUnit\TestFixture\DataProviderIssue2833; use PHPUnit\Framework\TestCase; diff --git a/tests/_files/DataProviderIssue2833/SecondTest.php b/tests/_files/DataProviderIssue2833/SecondTest.php index 57e3cce1823..f0635e5d704 100644 --- a/tests/_files/DataProviderIssue2833/SecondTest.php +++ b/tests/_files/DataProviderIssue2833/SecondTest.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Foo\DataProviderIssue2833; +namespace PHPUnit\TestFixture\DataProviderIssue2833; use PHPUnit\Framework\TestCase; diff --git a/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php b/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php index ebbe0c33f79..80767b204db 100644 --- a/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php +++ b/tests/_files/DataProviderIssue2859/tests/another/TestWithDataProviderTest.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Foo\DataProviderIssue2859; +namespace PHPUnit\TestFixture\DataProviderIssue2859; use PHPUnit\Framework\TestCase; diff --git a/tests/_files/DataProviderIssue2922/FirstTest.php b/tests/_files/DataProviderIssue2922/FirstTest.php index e5bd84e5e42..56e5c144c3f 100644 --- a/tests/_files/DataProviderIssue2922/FirstTest.php +++ b/tests/_files/DataProviderIssue2922/FirstTest.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Foo\DataProviderIssue2922; +namespace PHPUnit\TestFixture\DataProviderIssue2922; use Exception; use PHPUnit\Framework\TestCase; diff --git a/tests/_files/DataProviderIssue2922/SecondTest.php b/tests/_files/DataProviderIssue2922/SecondTest.php index ccf67c37190..597b00f53e5 100644 --- a/tests/_files/DataProviderIssue2922/SecondTest.php +++ b/tests/_files/DataProviderIssue2922/SecondTest.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Foo\DataProviderIssue2922; +namespace PHPUnit\TestFixture\DataProviderIssue2922; use PHPUnit\Framework\TestCase; diff --git a/tests/_files/DataProviderSkippedTest.php b/tests/_files/DataProviderSkippedTest.php index 1f3e119c5e2..9eabf9ceb5b 100644 --- a/tests/_files/DataProviderSkippedTest.php +++ b/tests/_files/DataProviderSkippedTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DataProviderSkippedTest extends TestCase diff --git a/tests/_files/DataProviderTest.php b/tests/_files/DataProviderTest.php index ef3d26c92e5..71c71974613 100644 --- a/tests/_files/DataProviderTest.php +++ b/tests/_files/DataProviderTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DataProviderTest extends TestCase diff --git a/tests/_files/DependencyFailureTest.php b/tests/_files/DependencyFailureTest.php index 37736474b2f..dcd90c5374a 100644 --- a/tests/_files/DependencyFailureTest.php +++ b/tests/_files/DependencyFailureTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DependencyFailureTest extends TestCase diff --git a/tests/_files/DependencySuccessTest.php b/tests/_files/DependencySuccessTest.php index 1f34583a27e..9f89606c1a7 100644 --- a/tests/_files/DependencySuccessTest.php +++ b/tests/_files/DependencySuccessTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DependencySuccessTest extends TestCase @@ -25,7 +27,7 @@ public function testTwo(): void } /** - * @depends DependencySuccessTest::testTwo + * @depends PHPUnit\TestFixture\DependencySuccessTest::testTwo */ public function testThree(): void { diff --git a/tests/_files/DoNoAssertionTestCase.php b/tests/_files/DoNoAssertionTestCase.php index 7de7e33eda0..282793f8bc9 100644 --- a/tests/_files/DoNoAssertionTestCase.php +++ b/tests/_files/DoNoAssertionTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DoNoAssertionTestCase extends TestCase diff --git a/tests/_files/DoesNotPerformAssertionsButPerformingAssertionsTest.php b/tests/_files/DoesNotPerformAssertionsButPerformingAssertionsTest.php index 5113d961308..59d332fe972 100644 --- a/tests/_files/DoesNotPerformAssertionsButPerformingAssertionsTest.php +++ b/tests/_files/DoesNotPerformAssertionsButPerformingAssertionsTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DoesNotPerformAssertionsButPerformingAssertionsTest extends TestCase diff --git a/tests/_files/DoubleTestCase.php b/tests/_files/DoubleTestCase.php index e76d6390d39..ef269e874d9 100644 --- a/tests/_files/DoubleTestCase.php +++ b/tests/_files/DoubleTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\Test; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestResult; diff --git a/tests/_files/DummyBarTest.php b/tests/_files/DummyBarTest.php index d928ed9d829..d6aa560e3c9 100644 --- a/tests/_files/DummyBarTest.php +++ b/tests/_files/DummyBarTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class DummyBarTest extends TestCase diff --git a/tests/_files/DummyException.php b/tests/_files/DummyException.php index 76d7c6412b3..b8fd8191bbe 100644 --- a/tests/_files/DummyException.php +++ b/tests/_files/DummyException.php @@ -7,6 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; + class DummyException extends Exception { } diff --git a/tests/_files/DuplicateKeyDataProviderTest.php b/tests/_files/DuplicateKeyDataProviderTest.php index 4c21d1fbbd5..a599ea00bce 100644 --- a/tests/_files/DuplicateKeyDataProviderTest.php +++ b/tests/_files/DuplicateKeyDataProviderTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; final class DuplicateKeyDataProviderTest extends TestCase diff --git a/tests/_files/EmptyDataProviderTest.php b/tests/_files/EmptyDataProviderTest.php index ee1403feab0..bb4af0a6249 100644 --- a/tests/_files/EmptyDataProviderTest.php +++ b/tests/_files/EmptyDataProviderTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class EmptyDataProviderTest extends TestCase diff --git a/tests/_files/EmptyTestCaseTest.php b/tests/_files/EmptyTestCaseTest.php index bbdce74d5d8..56b0b144d33 100644 --- a/tests/_files/EmptyTestCaseTest.php +++ b/tests/_files/EmptyTestCaseTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class EmptyTestCaseTest extends TestCase diff --git a/tests/_files/ExampleTrait.php b/tests/_files/ExampleTrait.php index f8ee04d3d01..adf4e98dfb3 100644 --- a/tests/_files/ExampleTrait.php +++ b/tests/_files/ExampleTrait.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + trait ExampleTrait { public function ohHai() diff --git a/tests/_files/ExceptionInAssertPostConditionsTest.php b/tests/_files/ExceptionInAssertPostConditionsTest.php index 2a0c36d431d..11f39a7310f 100644 --- a/tests/_files/ExceptionInAssertPostConditionsTest.php +++ b/tests/_files/ExceptionInAssertPostConditionsTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; class ExceptionInAssertPostConditionsTest extends TestCase diff --git a/tests/_files/ExceptionInAssertPreConditionsTest.php b/tests/_files/ExceptionInAssertPreConditionsTest.php index bda519bc81e..47c5c02d444 100644 --- a/tests/_files/ExceptionInAssertPreConditionsTest.php +++ b/tests/_files/ExceptionInAssertPreConditionsTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; class ExceptionInAssertPreConditionsTest extends TestCase diff --git a/tests/_files/ExceptionInSetUpTest.php b/tests/_files/ExceptionInSetUpTest.php index af1254f025a..4e7da1e80b9 100644 --- a/tests/_files/ExceptionInSetUpTest.php +++ b/tests/_files/ExceptionInSetUpTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; class ExceptionInSetUpTest extends TestCase diff --git a/tests/_files/ExceptionInTearDownAfterClassTest.php b/tests/_files/ExceptionInTearDownAfterClassTest.php index a865523ae3e..9d74c686b35 100644 --- a/tests/_files/ExceptionInTearDownAfterClassTest.php +++ b/tests/_files/ExceptionInTearDownAfterClassTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; class ExceptionInTearDownAfterClassTest extends TestCase diff --git a/tests/_files/ExceptionInTearDownTest.php b/tests/_files/ExceptionInTearDownTest.php index 65a620d24a4..c9d9183b432 100644 --- a/tests/_files/ExceptionInTearDownTest.php +++ b/tests/_files/ExceptionInTearDownTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; class ExceptionInTearDownTest extends TestCase diff --git a/tests/_files/ExceptionInTest.php b/tests/_files/ExceptionInTest.php index bf7524488f8..3888c936da4 100644 --- a/tests/_files/ExceptionInTest.php +++ b/tests/_files/ExceptionInTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; class ExceptionInTest extends TestCase diff --git a/tests/_files/ExceptionInTestDetectedInTeardown.php b/tests/_files/ExceptionInTestDetectedInTeardown.php index c98d94ec549..38167810703 100644 --- a/tests/_files/ExceptionInTestDetectedInTeardown.php +++ b/tests/_files/ExceptionInTestDetectedInTeardown.php @@ -7,8 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -use PHPUnit\Framework\TestCase; +namespace PHPUnit\TestFixture; +use Exception; +use PHPUnit\Framework\TestCase; use PHPUnit\Runner\BaseTestRunner; class ExceptionInTestDetectedInTeardown extends TestCase diff --git a/tests/_files/ExceptionStackTest.php b/tests/_files/ExceptionStackTest.php index 864bffd7389..d4724658eb6 100644 --- a/tests/_files/ExceptionStackTest.php +++ b/tests/_files/ExceptionStackTest.php @@ -7,6 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; +use InvalidArgumentException; use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\TestCase; @@ -19,7 +23,7 @@ public function testPrintingChildException(): void } catch (ExpectationFailedException $e) { $message = $e->getMessage() . $e->getComparisonFailure()->getDiff(); - throw new PHPUnit\Framework\Exception("Child exception\n{$message}", 101, $e); + throw new \PHPUnit\Framework\Exception("Child exception\n{$message}", 101, $e); } } diff --git a/tests/_files/ExceptionWithThrowable.php b/tests/_files/ExceptionWithThrowable.php index 295f9100135..cded0d2df13 100644 --- a/tests/_files/ExceptionWithThrowable.php +++ b/tests/_files/ExceptionWithThrowable.php @@ -7,7 +7,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -interface ExceptionWithThrowable extends \Throwable +namespace PHPUnit\TestFixture; + +use Throwable; + +interface ExceptionWithThrowable extends Throwable { public function getAdditionalInformation(); } diff --git a/tests/_files/Failure.php b/tests/_files/Failure.php index 130942f7d1e..deea8910b03 100644 --- a/tests/_files/Failure.php +++ b/tests/_files/Failure.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class Failure extends TestCase diff --git a/tests/_files/FailureTest.php b/tests/_files/FailureTest.php index 3ccb94beaae..828da0a953f 100644 --- a/tests/_files/FailureTest.php +++ b/tests/_files/FailureTest.php @@ -7,7 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; +use stdClass; class FailureTest extends TestCase { diff --git a/tests/_files/FalsyConstraint.php b/tests/_files/FalsyConstraint.php index ebba9590313..2372f3a562e 100644 --- a/tests/_files/FalsyConstraint.php +++ b/tests/_files/FalsyConstraint.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function sprintf; use PHPUnit\Framework\Constraint\Constraint; final class FalsyConstraint extends Constraint @@ -18,7 +21,7 @@ public function matches($other): bool public function toString(): string { - return \sprintf( + return sprintf( 'is accepted by %s', self::class ); diff --git a/tests/_files/FatalTest.php b/tests/_files/FatalTest.php index 2f85e50c2b6..59cb57237e6 100644 --- a/tests/_files/FatalTest.php +++ b/tests/_files/FatalTest.php @@ -7,16 +7,22 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function extension_loaded; +use function phpversion; +use function version_compare; +use function xdebug_disable; use PHPUnit\Framework\TestCase; class FatalTest extends TestCase { public function testFatalError(): void { - if (\extension_loaded('xdebug') && \version_compare(\phpversion('xdebug'), '3', '<')) { - \xdebug_disable(); + if (extension_loaded('xdebug') && version_compare(phpversion('xdebug'), '3', '<')) { + xdebug_disable(); } - eval('class FatalTest {}'); + eval('class PHPUnit\TestFixture\FatalTest {}'); } } diff --git a/tests/_files/FinalClass.php b/tests/_files/FinalClass.php index 614b09fdcd4..abd2eb27142 100644 --- a/tests/_files/FinalClass.php +++ b/tests/_files/FinalClass.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + final class FinalClass { private $value; diff --git a/tests/_files/Foo.php b/tests/_files/Foo.php index 82fcf88ed99..61fc861dce6 100644 --- a/tests/_files/Foo.php +++ b/tests/_files/Foo.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class Foo { public function doSomething(Bar $bar) diff --git a/tests/_files/FunctionCallback.php b/tests/_files/FunctionCallback.php index 2402d5b8b46..02f78316c53 100644 --- a/tests/_files/FunctionCallback.php +++ b/tests/_files/FunctionCallback.php @@ -7,11 +7,15 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function func_get_args; + class FunctionCallbackWrapper { public static function functionCallback() { - $args = \func_get_args(); + $args = func_get_args(); if ($args == ['foo', 'bar']) { return 'pass'; diff --git a/tests/_files/IncompleteTest.php b/tests/_files/IncompleteTest.php index 8eb50730ddf..72d1eb8bf45 100644 --- a/tests/_files/IncompleteTest.php +++ b/tests/_files/IncompleteTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class IncompleteTest extends TestCase diff --git a/tests/_files/Inheritance/InheritanceA.php b/tests/_files/Inheritance/InheritanceA.php index 87f63747482..4de6c644a3e 100644 --- a/tests/_files/Inheritance/InheritanceA.php +++ b/tests/_files/Inheritance/InheritanceA.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -require_once __DIR__ . '/InheritanceB.php'; +namespace PHPUnit\TestFixture; class InheritanceA extends InheritanceB { diff --git a/tests/_files/Inheritance/InheritanceB.php b/tests/_files/Inheritance/InheritanceB.php index edfc55a141f..93a27b86d8c 100644 --- a/tests/_files/Inheritance/InheritanceB.php +++ b/tests/_files/Inheritance/InheritanceB.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class InheritanceB extends TestCase diff --git a/tests/_files/InheritedTestCase.php b/tests/_files/InheritedTestCase.php index 7acfcfc730d..3afc714074a 100644 --- a/tests/_files/InheritedTestCase.php +++ b/tests/_files/InheritedTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class InheritedTestCase extends OneTestCase { public function test2(): void diff --git a/tests/_files/IniTest.php b/tests/_files/IniTest.php index 1c833e45abb..b19854e8128 100644 --- a/tests/_files/IniTest.php +++ b/tests/_files/IniTest.php @@ -7,12 +7,15 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function ini_get; use PHPUnit\Framework\TestCase; class IniTest extends TestCase { public function testIni(): void { - $this->assertEquals('application/x-test', \ini_get('default_mimetype')); + $this->assertEquals('application/x-test', ini_get('default_mimetype')); } } diff --git a/tests/_files/InterfaceWithSemiReservedMethodName.php b/tests/_files/InterfaceWithSemiReservedMethodName.php index 3ea1a5241c0..d90fd9a3741 100644 --- a/tests/_files/InterfaceWithSemiReservedMethodName.php +++ b/tests/_files/InterfaceWithSemiReservedMethodName.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + interface InterfaceWithSemiReservedMethodName { public function unset(); diff --git a/tests/_files/InterfaceWithStaticMethod.php b/tests/_files/InterfaceWithStaticMethod.php index 6e572107c5e..36eb1b56336 100644 --- a/tests/_files/InterfaceWithStaticMethod.php +++ b/tests/_files/InterfaceWithStaticMethod.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + interface InterfaceWithStaticMethod { public static function staticMethod(); diff --git a/tests/_files/IsolationTest.php b/tests/_files/IsolationTest.php index 07551e42989..113f5443729 100644 --- a/tests/_files/IsolationTest.php +++ b/tests/_files/IsolationTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class IsolationTest extends TestCase diff --git a/tests/_files/MethodCallback.php b/tests/_files/MethodCallback.php index cad3ec64c12..c9d0ab93f86 100644 --- a/tests/_files/MethodCallback.php +++ b/tests/_files/MethodCallback.php @@ -7,11 +7,15 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function func_get_args; + class MethodCallback { public static function staticCallback() { - $args = \func_get_args(); + $args = func_get_args(); if ($args == ['foo', 'bar']) { return 'pass'; @@ -20,7 +24,7 @@ public static function staticCallback() public function nonStaticCallback() { - $args = \func_get_args(); + $args = func_get_args(); if ($args == ['foo', 'bar']) { return 'pass'; diff --git a/tests/_files/MethodCallbackByReference.php b/tests/_files/MethodCallbackByReference.php index e02e33d1899..25815254de6 100644 --- a/tests/_files/MethodCallbackByReference.php +++ b/tests/_files/MethodCallbackByReference.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class MethodCallbackByReference { public function bar(&$a, &$b, $c): void diff --git a/tests/_files/MockTestInterface.php b/tests/_files/MockTestInterface.php index dc81c27db79..95fee63faa7 100644 --- a/tests/_files/MockTestInterface.php +++ b/tests/_files/MockTestInterface.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + interface MockTestInterface { public function returnAnything(); diff --git a/tests/_files/Mockable.php b/tests/_files/Mockable.php index 541b35216f3..43fdb2dd2ef 100644 --- a/tests/_files/Mockable.php +++ b/tests/_files/Mockable.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class Mockable { public $constructorArgs; diff --git a/tests/_files/ModifiedConstructorTestCase.php b/tests/_files/ModifiedConstructorTestCase.php index 0b678a83d63..659bf6bc85e 100644 --- a/tests/_files/ModifiedConstructorTestCase.php +++ b/tests/_files/ModifiedConstructorTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class ModifiedConstructorTestCase extends TestCase diff --git a/tests/_files/MultipleDataProviderTest.php b/tests/_files/MultipleDataProviderTest.php index ca934713946..2e66464b608 100644 --- a/tests/_files/MultipleDataProviderTest.php +++ b/tests/_files/MultipleDataProviderTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use ArrayObject; use PHPUnit\Framework\TestCase; class MultipleDataProviderTest extends TestCase diff --git a/tests/_files/MyTestListener.php b/tests/_files/MyTestListener.php index 29f4472dd82..a95b495c2f6 100644 --- a/tests/_files/MyTestListener.php +++ b/tests/_files/MyTestListener.php @@ -7,11 +7,14 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\Test; use PHPUnit\Framework\TestListener; use PHPUnit\Framework\TestSuite; use PHPUnit\Framework\Warning; +use Throwable; final class MyTestListener implements TestListener { diff --git a/tests/_files/NamedConstraint.php b/tests/_files/NamedConstraint.php index bbff2d56f50..839fe857179 100644 --- a/tests/_files/NamedConstraint.php +++ b/tests/_files/NamedConstraint.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\Constraint\Constraint; final class NamedConstraint extends Constraint diff --git a/tests/_files/NamespaceCoverageClassExtendedTest.php b/tests/_files/NamespaceCoverageClassExtendedTest.php index 0bcf75e93c9..d00424b44a6 100644 --- a/tests/_files/NamespaceCoverageClassExtendedTest.php +++ b/tests/_files/NamespaceCoverageClassExtendedTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoverageClassExtendedTest extends TestCase { /** - * @covers Foo\CoveredClass + * @covers PHPUnit\TestFixture\CoveredClass */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageClassTest.php b/tests/_files/NamespaceCoverageClassTest.php index 5dd2d7f2ead..0243afea688 100644 --- a/tests/_files/NamespaceCoverageClassTest.php +++ b/tests/_files/NamespaceCoverageClassTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoverageClassTest extends TestCase { /** - * @covers Foo\CoveredClass + * @covers PHPUnit\TestFixture\CoveredClass */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageCoversClassPublicTest.php b/tests/_files/NamespaceCoverageCoversClassPublicTest.php index fe803296164..c56de6e457f 100644 --- a/tests/_files/NamespaceCoverageCoversClassPublicTest.php +++ b/tests/_files/NamespaceCoverageCoversClassPublicTest.php @@ -7,10 +7,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; /** - * @coversDefaultClass \Foo\CoveredClass + * @coversDefaultClass \PHPUnit\TestFixture\CoveredClass */ class NamespaceCoverageCoversClassPublicTest extends TestCase { @@ -19,7 +21,7 @@ class NamespaceCoverageCoversClassPublicTest extends TestCase */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageCoversClassTest.php b/tests/_files/NamespaceCoverageCoversClassTest.php index 8a758c9af42..3c09d43c0ca 100644 --- a/tests/_files/NamespaceCoverageCoversClassTest.php +++ b/tests/_files/NamespaceCoverageCoversClassTest.php @@ -7,10 +7,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; /** - * @coversDefaultClass \Foo\CoveredClass + * @coversDefaultClass \PHPUnit\TestFixture\CoveredClass */ class NamespaceCoverageCoversClassTest extends TestCase { @@ -18,13 +20,13 @@ class NamespaceCoverageCoversClassTest extends TestCase * @covers ::privateMethod * @covers ::protectedMethod * @covers ::publicMethod - * @covers \Foo\CoveredParentClass::privateMethod - * @covers \Foo\CoveredParentClass::protectedMethod - * @covers \Foo\CoveredParentClass::publicMethod + * @covers \PHPUnit\TestFixture\CoveredParentClass::privateMethod + * @covers \PHPUnit\TestFixture\CoveredParentClass::protectedMethod + * @covers \PHPUnit\TestFixture\CoveredParentClass::publicMethod */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageMethodTest.php b/tests/_files/NamespaceCoverageMethodTest.php index 61685b2393f..f7a6d50d456 100644 --- a/tests/_files/NamespaceCoverageMethodTest.php +++ b/tests/_files/NamespaceCoverageMethodTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoverageMethodTest extends TestCase { /** - * @covers Foo\CoveredClass::publicMethod + * @covers PHPUnit\TestFixture\CoveredClass::publicMethod */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageNotPrivateTest.php b/tests/_files/NamespaceCoverageNotPrivateTest.php index 5dd1a0c7bb0..02044c70d91 100644 --- a/tests/_files/NamespaceCoverageNotPrivateTest.php +++ b/tests/_files/NamespaceCoverageNotPrivateTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoverageNotPrivateTest extends TestCase { /** - * @covers Foo\CoveredClass:: + * @covers PHPUnit\TestFixture\CoveredClass:: */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageNotProtectedTest.php b/tests/_files/NamespaceCoverageNotProtectedTest.php index 78b743517fd..3da7ed0b159 100644 --- a/tests/_files/NamespaceCoverageNotProtectedTest.php +++ b/tests/_files/NamespaceCoverageNotProtectedTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoverageNotProtectedTest extends TestCase { /** - * @covers Foo\CoveredClass:: + * @covers PHPUnit\TestFixture\CoveredClass:: */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageNotPublicTest.php b/tests/_files/NamespaceCoverageNotPublicTest.php index a7ab13fd7cb..099fa45abc4 100644 --- a/tests/_files/NamespaceCoverageNotPublicTest.php +++ b/tests/_files/NamespaceCoverageNotPublicTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoverageNotPublicTest extends TestCase { /** - * @covers Foo\CoveredClass:: + * @covers PHPUnit\TestFixture\CoveredClass:: */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoveragePrivateTest.php b/tests/_files/NamespaceCoveragePrivateTest.php index 6170742285b..cfd9a8575d0 100644 --- a/tests/_files/NamespaceCoveragePrivateTest.php +++ b/tests/_files/NamespaceCoveragePrivateTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoveragePrivateTest extends TestCase { /** - * @covers Foo\CoveredClass:: + * @covers PHPUnit\TestFixture\CoveredClass:: */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoverageProtectedTest.php b/tests/_files/NamespaceCoverageProtectedTest.php index d2ff0cb0b5b..d6120d8a5b3 100644 --- a/tests/_files/NamespaceCoverageProtectedTest.php +++ b/tests/_files/NamespaceCoverageProtectedTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoverageProtectedTest extends TestCase { /** - * @covers Foo\CoveredClass:: + * @covers PHPUnit\TestFixture\CoveredClass:: */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoveragePublicTest.php b/tests/_files/NamespaceCoveragePublicTest.php index 481abd13e69..021b78d2fb3 100644 --- a/tests/_files/NamespaceCoveragePublicTest.php +++ b/tests/_files/NamespaceCoveragePublicTest.php @@ -7,16 +7,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NamespaceCoveragePublicTest extends TestCase { /** - * @covers Foo\CoveredClass:: + * @covers PHPUnit\TestFixture\CoveredClass:: */ public function testSomething(): void { - $o = new Foo\CoveredClass; + $o = new CoveredClass; $o->publicMethod(); } } diff --git a/tests/_files/NamespaceCoveredClass.php b/tests/_files/NamespaceCoveredClass.php index ddc98b81bb5..ccd30c00f6a 100644 --- a/tests/_files/NamespaceCoveredClass.php +++ b/tests/_files/NamespaceCoveredClass.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Foo; +namespace PHPUnit\TestFixture; class CoveredParentClass { diff --git a/tests/_files/NamespaceCoveredFunction.php b/tests/_files/NamespaceCoveredFunction.php index b5daa309e54..554bb9cccca 100644 --- a/tests/_files/NamespaceCoveredFunction.php +++ b/tests/_files/NamespaceCoveredFunction.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace foo; +namespace PHPUnit\TestFixture; function func() { diff --git a/tests/_files/NoArgTestCaseTest.php b/tests/_files/NoArgTestCaseTest.php index b20eb5e85ad..277376b582c 100644 --- a/tests/_files/NoArgTestCaseTest.php +++ b/tests/_files/NoArgTestCaseTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NoArgTestCaseTest extends TestCase diff --git a/tests/_files/NoTestCases.php b/tests/_files/NoTestCases.php index f88884274ad..c434e83ff55 100644 --- a/tests/_files/NoTestCases.php +++ b/tests/_files/NoTestCases.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NoTestCases extends TestCase diff --git a/tests/_files/NotExistingCoveredElementTest.php b/tests/_files/NotExistingCoveredElementTest.php index 19a35c0bb9c..22ede079269 100644 --- a/tests/_files/NotExistingCoveredElementTest.php +++ b/tests/_files/NotExistingCoveredElementTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NotExistingCoveredElementTest extends TestCase diff --git a/tests/_files/NotPublicTestCase.php b/tests/_files/NotPublicTestCase.php index bcb6af6233c..d24ba8f93f8 100644 --- a/tests/_files/NotPublicTestCase.php +++ b/tests/_files/NotPublicTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NotPublicTestCase extends TestCase diff --git a/tests/_files/NotSelfDescribingTest.php b/tests/_files/NotSelfDescribingTest.php index 460f1760452..435957dd040 100644 --- a/tests/_files/NotSelfDescribingTest.php +++ b/tests/_files/NotSelfDescribingTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\Test; use PHPUnit\Framework\TestResult; diff --git a/tests/_files/NotVoidTestCase.php b/tests/_files/NotVoidTestCase.php index 04af1f50177..e246f11085d 100644 --- a/tests/_files/NotVoidTestCase.php +++ b/tests/_files/NotVoidTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NotVoidTestCase extends TestCase diff --git a/tests/_files/NothingTest.php b/tests/_files/NothingTest.php index 4910c160f19..0e0619de279 100644 --- a/tests/_files/NothingTest.php +++ b/tests/_files/NothingTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class NothingTest extends TestCase diff --git a/tests/_files/NumericGroupAnnotationTest.php b/tests/_files/NumericGroupAnnotationTest.php index 54cf7dec213..44e847d0dc2 100644 --- a/tests/_files/NumericGroupAnnotationTest.php +++ b/tests/_files/NumericGroupAnnotationTest.php @@ -7,7 +7,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -class NumericGroupAnnotationTest extends \PHPUnit\Framework\TestCase +namespace PHPUnit\TestFixture; + +use PHPUnit\Framework\TestCase; + +class NumericGroupAnnotationTest extends TestCase { /** * @testdox Empty test for @ticket numeric annotation values diff --git a/tests/_files/OneTestCase.php b/tests/_files/OneTestCase.php index 18f9b51d424..e0e3a603ae4 100644 --- a/tests/_files/OneTestCase.php +++ b/tests/_files/OneTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class OneTestCase extends TestCase diff --git a/tests/_files/OutputTestCase.php b/tests/_files/OutputTestCase.php index 33bcbdf7914..e7e0b07e4ed 100644 --- a/tests/_files/OutputTestCase.php +++ b/tests/_files/OutputTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class OutputTestCase extends TestCase diff --git a/tests/_files/OverrideTestCase.php b/tests/_files/OverrideTestCase.php index 292dd082a88..b4286c5cc85 100644 --- a/tests/_files/OverrideTestCase.php +++ b/tests/_files/OverrideTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class OverrideTestCase extends OneTestCase { public function testCase($arg = ''): void diff --git a/tests/_files/ParseTestMethodAnnotationsMock.php b/tests/_files/ParseTestMethodAnnotationsMock.php index 2ad8a46c728..84fb0c20950 100644 --- a/tests/_files/ParseTestMethodAnnotationsMock.php +++ b/tests/_files/ParseTestMethodAnnotationsMock.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + /** * @theClassAnnotation */ diff --git a/tests/_files/PartialMockTestClass.php b/tests/_files/PartialMockTestClass.php index 7117eecc295..879b76644ab 100644 --- a/tests/_files/PartialMockTestClass.php +++ b/tests/_files/PartialMockTestClass.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class PartialMockTestClass { public $constructorCalled = false; diff --git a/tests/_files/RequirementsClassBeforeClassHookTest.php b/tests/_files/RequirementsClassBeforeClassHookTest.php index 0278913c4a6..6dfd411bb62 100644 --- a/tests/_files/RequirementsClassBeforeClassHookTest.php +++ b/tests/_files/RequirementsClassBeforeClassHookTest.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; /** diff --git a/tests/_files/RequirementsClassDocBlockTest.php b/tests/_files/RequirementsClassDocBlockTest.php index bef755bf76a..78f082025c2 100644 --- a/tests/_files/RequirementsClassDocBlockTest.php +++ b/tests/_files/RequirementsClassDocBlockTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + /** * @requires PHP 5.3 * @requires PHPUnit 4.0 diff --git a/tests/_files/RequirementsTest.php b/tests/_files/RequirementsTest.php index a0d73fac73c..030e67cb11f 100644 --- a/tests/_files/RequirementsTest.php +++ b/tests/_files/RequirementsTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class RequirementsTest extends TestCase diff --git a/tests/_files/SampleArrayAccess.php b/tests/_files/SampleArrayAccess.php index f85c009721b..ee11714aba4 100644 --- a/tests/_files/SampleArrayAccess.php +++ b/tests/_files/SampleArrayAccess.php @@ -7,6 +7,11 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use ArrayAccess; +use ReturnTypeWillChange; + class SampleArrayAccess implements ArrayAccess { private $container; diff --git a/tests/_files/SampleClass.php b/tests/_files/SampleClass.php index 79e637ddcda..404e4633c61 100644 --- a/tests/_files/SampleClass.php +++ b/tests/_files/SampleClass.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class SampleClass { public $a; diff --git a/tests/_files/SeparateProcessesTest.php b/tests/_files/SeparateProcessesTest.php index 5fa4c7be334..db62995ddb8 100644 --- a/tests/_files/SeparateProcessesTest.php +++ b/tests/_files/SeparateProcessesTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; /** diff --git a/tests/_files/Singleton.php b/tests/_files/Singleton.php index 135c1dbb8bb..35b6601e79b 100644 --- a/tests/_files/Singleton.php +++ b/tests/_files/Singleton.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class Singleton { private static $uniqueInstance; diff --git a/tests/_files/SingletonClass.php b/tests/_files/SingletonClass.php index 5526d512685..2e78ed691e8 100644 --- a/tests/_files/SingletonClass.php +++ b/tests/_files/SingletonClass.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class SingletonClass { public static function getInstance(): void diff --git a/tests/_files/SomeClass.php b/tests/_files/SomeClass.php index cd926986352..43509ce0006 100644 --- a/tests/_files/SomeClass.php +++ b/tests/_files/SomeClass.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class SomeClass { public function doSomething($a, $b) diff --git a/tests/_files/StopOnErrorTestSuite.php b/tests/_files/StopOnErrorTestSuite.php index b731cacaf66..1cfb8473e92 100644 --- a/tests/_files/StopOnErrorTestSuite.php +++ b/tests/_files/StopOnErrorTestSuite.php @@ -7,7 +7,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -class StopOnErrorTestSuite extends \PHPUnit\Framework\TestCase +namespace PHPUnit\TestFixture; + +use Error; +use PHPUnit\Framework\TestCase; + +class StopOnErrorTestSuite extends TestCase { public function testIncomplete(): void { diff --git a/tests/_files/StopOnWarningTestSuite.php b/tests/_files/StopOnWarningTestSuite.php index b837ffc87e3..e167dd8dbf0 100644 --- a/tests/_files/StopOnWarningTestSuite.php +++ b/tests/_files/StopOnWarningTestSuite.php @@ -8,6 +8,7 @@ * file that was distributed with this source code. */ use PHPUnit\Framework\TestSuite; +use PHPUnit\TestFixture\NoTestCases; class StopOnWarningTestSuite { diff --git a/tests/_files/StringableClass.php b/tests/_files/StringableClass.php index cf9847d1bd0..e164a7b91f9 100644 --- a/tests/_files/StringableClass.php +++ b/tests/_files/StringableClass.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class StringableClass { public function __toString() diff --git a/tests/_files/Struct.php b/tests/_files/Struct.php index 152248c1160..b0f45158b48 100644 --- a/tests/_files/Struct.php +++ b/tests/_files/Struct.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class Struct { public $var; diff --git a/tests/_files/Success.php b/tests/_files/Success.php index 73a443b7e6b..e7ebb46e4e1 100644 --- a/tests/_files/Success.php +++ b/tests/_files/Success.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class Success extends TestCase diff --git a/tests/_files/TestAutoreferenced.php b/tests/_files/TestAutoreferenced.php index f105e20faeb..2ef5d9a803f 100644 --- a/tests/_files/TestAutoreferenced.php +++ b/tests/_files/TestAutoreferenced.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class TestAutoreferenced extends TestCase diff --git a/tests/_files/TestCaseWithExceptionInHook.php b/tests/_files/TestCaseWithExceptionInHook.php index 1ac06318f92..86fdc34f8d0 100644 --- a/tests/_files/TestCaseWithExceptionInHook.php +++ b/tests/_files/TestCaseWithExceptionInHook.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; final class TestCaseWithExceptionInHook extends TestCase diff --git a/tests/_files/TestGeneratorMaker.php b/tests/_files/TestGeneratorMaker.php index 8ac282cda5a..f6b89818a37 100644 --- a/tests/_files/TestGeneratorMaker.php +++ b/tests/_files/TestGeneratorMaker.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class TestGeneratorMaker { public function create($array = []) diff --git a/tests/_files/TestIncomplete.php b/tests/_files/TestIncomplete.php index 6abe0985663..5219f9bc0f5 100644 --- a/tests/_files/TestIncomplete.php +++ b/tests/_files/TestIncomplete.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class TestIncomplete extends TestCase diff --git a/tests/_files/TestIterator.php b/tests/_files/TestIterator.php index 584aa77ccdb..d2680a0b550 100644 --- a/tests/_files/TestIterator.php +++ b/tests/_files/TestIterator.php @@ -7,6 +7,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function count; +use Iterator; +use ReturnTypeWillChange; + class TestIterator implements Iterator { protected $array; @@ -26,7 +32,7 @@ public function rewind(): void #[ReturnTypeWillChange] public function valid() { - return $this->position < \count($this->array); + return $this->position < count($this->array); } #[ReturnTypeWillChange] diff --git a/tests/_files/TestIterator2.php b/tests/_files/TestIterator2.php index 0ba1f1eeb42..7b9d391885a 100644 --- a/tests/_files/TestIterator2.php +++ b/tests/_files/TestIterator2.php @@ -7,6 +7,15 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function current; +use function key; +use function next; +use function reset; +use Iterator; +use ReturnTypeWillChange; + class TestIterator2 implements Iterator { protected $data; @@ -19,28 +28,28 @@ public function __construct(array $array) #[ReturnTypeWillChange] public function current() { - return \current($this->data); + return current($this->data); } public function next(): void { - \next($this->data); + next($this->data); } #[ReturnTypeWillChange] public function key() { - return \key($this->data); + return key($this->data); } #[ReturnTypeWillChange] public function valid() { - return \key($this->data) !== null; + return key($this->data) !== null; } public function rewind(): void { - \reset($this->data); + reset($this->data); } } diff --git a/tests/_files/TestIteratorAggregate.php b/tests/_files/TestIteratorAggregate.php index a4d94352226..bbd3ac01a23 100644 --- a/tests/_files/TestIteratorAggregate.php +++ b/tests/_files/TestIteratorAggregate.php @@ -7,6 +7,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use IteratorAggregate; +use ReturnTypeWillChange; +use Traversable; + class TestIteratorAggregate implements IteratorAggregate { private $traversable; diff --git a/tests/_files/TestIteratorAggregate2.php b/tests/_files/TestIteratorAggregate2.php index a00ddf0f132..fb4046285dc 100644 --- a/tests/_files/TestIteratorAggregate2.php +++ b/tests/_files/TestIteratorAggregate2.php @@ -7,6 +7,12 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use IteratorAggregate; +use ReturnTypeWillChange; +use Traversable; + class TestIteratorAggregate2 implements IteratorAggregate { private $traversable; diff --git a/tests/_files/TestProxyFixture.php b/tests/_files/TestProxyFixture.php index 655f6041ee8..9c3f4387cc0 100644 --- a/tests/_files/TestProxyFixture.php +++ b/tests/_files/TestProxyFixture.php @@ -7,6 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use stdClass; + class TestProxyFixture { public function returnString() diff --git a/tests/_files/TestRisky.php b/tests/_files/TestRisky.php index 3abb389aedc..e5ecf79775a 100644 --- a/tests/_files/TestRisky.php +++ b/tests/_files/TestRisky.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class TestRisky extends TestCase diff --git a/tests/_files/TestSkipped.php b/tests/_files/TestSkipped.php index ff08ee6e8ab..5481b99c51f 100644 --- a/tests/_files/TestSkipped.php +++ b/tests/_files/TestSkipped.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class TestSkipped extends TestCase diff --git a/tests/_files/TestTestError.php b/tests/_files/TestTestError.php index b2543eb6225..a17e357a167 100644 --- a/tests/_files/TestTestError.php +++ b/tests/_files/TestTestError.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class TestError extends TestCase diff --git a/tests/_files/TestWarning.php b/tests/_files/TestWarning.php index 2e9f1446250..40553efd233 100644 --- a/tests/_files/TestWarning.php +++ b/tests/_files/TestWarning.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Warning; diff --git a/tests/_files/TestWithAnnotations.php b/tests/_files/TestWithAnnotations.php index 16ba16777e6..700c2b62bc6 100644 --- a/tests/_files/TestWithAnnotations.php +++ b/tests/_files/TestWithAnnotations.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; /** diff --git a/tests/_files/TestWithDifferentNames.php b/tests/_files/TestWithDifferentNames.php index 524e6c99974..2f03fadf5f1 100644 --- a/tests/_files/TestWithDifferentNames.php +++ b/tests/_files/TestWithDifferentNames.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; final class TestWithDifferentNames extends TestCase diff --git a/tests/_files/TestWithDifferentOutput.php b/tests/_files/TestWithDifferentOutput.php index 0fbcb56a15e..8606cb19fd7 100644 --- a/tests/_files/TestWithDifferentOutput.php +++ b/tests/_files/TestWithDifferentOutput.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; final class TestWithDifferentOutput extends TestCase diff --git a/tests/_files/TestWithDifferentSizes.php b/tests/_files/TestWithDifferentSizes.php index c03a0c1f768..3a1f674d7a2 100644 --- a/tests/_files/TestWithDifferentSizes.php +++ b/tests/_files/TestWithDifferentSizes.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; final class TestWithDifferentSizes extends TestCase diff --git a/tests/_files/TestWithDifferentStatuses.php b/tests/_files/TestWithDifferentStatuses.php index 04fdba6b62b..0f211cd3995 100644 --- a/tests/_files/TestWithDifferentStatuses.php +++ b/tests/_files/TestWithDifferentStatuses.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use Exception; use PHPUnit\Framework\TestCase; final class TestWithDifferentStatuses extends TestCase @@ -18,7 +21,7 @@ public function testThatFails(): void public function testThatErrors(): void { - throw new \Exception; + throw new Exception; } public function testThatPasses(): void @@ -48,12 +51,12 @@ public function testThatAddsAWarning(): void public function testWithCreatePartialMockWarning(): void { - $this->createPartialMock(\Mockable::class, ['mockableMethod', 'fakeMethod1', 'fakeMethod2']); + $this->createPartialMock(Mockable::class, ['mockableMethod', 'fakeMethod1', 'fakeMethod2']); } public function testWithCreatePartialMockPassesNoWarning(): void { - $mock = $this->createPartialMock(\Mockable::class, ['mockableMethod']); + $mock = $this->createPartialMock(Mockable::class, ['mockableMethod']); $this->assertNull($mock->mockableMethod()); } } diff --git a/tests/_files/TestWithTest.php b/tests/_files/TestWithTest.php index d515027bf05..ba7bd92aaa0 100644 --- a/tests/_files/TestWithTest.php +++ b/tests/_files/TestWithTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class TestWithTest extends TestCase diff --git a/tests/_files/TestableCliTestDoxPrinter.php b/tests/_files/TestableCliTestDoxPrinter.php index 7c830be75eb..9386ba587b9 100644 --- a/tests/_files/TestableCliTestDoxPrinter.php +++ b/tests/_files/TestableCliTestDoxPrinter.php @@ -7,7 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace PHPUnit\Util\TestDox; +namespace PHPUnit\TestFixture; + +use PHPUnit\Util\TestDox\CliTestDoxPrinter; class TestableCliTestDoxPrinter extends CliTestDoxPrinter { diff --git a/tests/_files/ThrowExceptionTestCase.php b/tests/_files/ThrowExceptionTestCase.php index 71525866657..6bc1c85953a 100644 --- a/tests/_files/ThrowExceptionTestCase.php +++ b/tests/_files/ThrowExceptionTestCase.php @@ -7,7 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; +use RuntimeException; class ThrowExceptionTestCase extends TestCase { diff --git a/tests/_files/ThrowNoExceptionTestCase.php b/tests/_files/ThrowNoExceptionTestCase.php index 9b489a1b8b8..953702d59a4 100644 --- a/tests/_files/ThrowNoExceptionTestCase.php +++ b/tests/_files/ThrowNoExceptionTestCase.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class ThrowNoExceptionTestCase extends TestCase diff --git a/tests/_files/TraitWithConstructor.php b/tests/_files/TraitWithConstructor.php index ac9c55993ba..5505745ea47 100644 --- a/tests/_files/TraitWithConstructor.php +++ b/tests/_files/TraitWithConstructor.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + trait TraitWithConstructor { private $value; diff --git a/tests/_files/TraversableMockTestInterface.php b/tests/_files/TraversableMockTestInterface.php index 339fc0707fe..685831ff7be 100644 --- a/tests/_files/TraversableMockTestInterface.php +++ b/tests/_files/TraversableMockTestInterface.php @@ -7,6 +7,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -interface TraversableMockTestInterface extends \Traversable +namespace PHPUnit\TestFixture; + +use Traversable; + +interface TraversableMockTestInterface extends Traversable { } diff --git a/tests/_files/TruthyConstraint.php b/tests/_files/TruthyConstraint.php index f665ead166c..d22818cc574 100644 --- a/tests/_files/TruthyConstraint.php +++ b/tests/_files/TruthyConstraint.php @@ -7,6 +7,9 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function sprintf; use PHPUnit\Framework\Constraint\Constraint; final class TruthyConstraint extends Constraint @@ -18,7 +21,7 @@ public function matches($other): bool public function toString(): string { - return \sprintf( + return sprintf( 'is accepted by %s', self::class ); diff --git a/tests/_files/VariousDocblockDefinedDataProvider.php b/tests/_files/VariousDocblockDefinedDataProvider.php index 8b991907648..f58db385aef 100644 --- a/tests/_files/VariousDocblockDefinedDataProvider.php +++ b/tests/_files/VariousDocblockDefinedDataProvider.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + final class VariousDocblockDefinedDataProvider { /** diff --git a/tests/_files/VariousIterableDataProviderTest.php b/tests/_files/VariousIterableDataProviderTest.php index 8aa27ccdc07..cb34e27d22d 100644 --- a/tests/_files/VariousIterableDataProviderTest.php +++ b/tests/_files/VariousIterableDataProviderTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + class VariousIterableDataProviderTest extends AbstractVariousIterableDataProviderTest { public static function asArrayStaticProvider() diff --git a/tests/_files/WasRun.php b/tests/_files/WasRun.php index f656c0726cb..ff7f87ae5cd 100644 --- a/tests/_files/WasRun.php +++ b/tests/_files/WasRun.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + use PHPUnit\Framework\TestCase; class WasRun extends TestCase diff --git a/tests/_files/WrapperIteratorAggregate.php b/tests/_files/WrapperIteratorAggregate.php index 7bc71d6ab2c..28657cca2d0 100644 --- a/tests/_files/WrapperIteratorAggregate.php +++ b/tests/_files/WrapperIteratorAggregate.php @@ -7,16 +7,24 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture; + +use function assert; +use function is_array; +use IteratorAggregate; +use ReturnTypeWillChange; +use Traversable; + class WrapperIteratorAggregate implements IteratorAggregate { /** - * @var array|\Traversable + * @var array|Traversable */ private $baseCollection; public function __construct($baseCollection) { - \assert(\is_array($baseCollection) || $baseCollection instanceof Traversable); + assert(is_array($baseCollection) || $baseCollection instanceof Traversable); $this->baseCollection = $baseCollection; } diff --git a/tests/_files/namespace/someNamespaceA/NamespacedClass.php b/tests/_files/namespace/someNamespaceA/NamespacedClass.php index b035c17b905..6beac955481 100644 --- a/tests/_files/namespace/someNamespaceA/NamespacedClass.php +++ b/tests/_files/namespace/someNamespaceA/NamespacedClass.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace someNamespaceA; +namespace PHPUnit\TestFixture\someNamespaceA; class NamespacedClass { diff --git a/tests/_files/namespace/someNamespaceB/NamespacedClass.php b/tests/_files/namespace/someNamespaceB/NamespacedClass.php index e2eb0f22d0b..420b371510b 100644 --- a/tests/_files/namespace/someNamespaceB/NamespacedClass.php +++ b/tests/_files/namespace/someNamespaceB/NamespacedClass.php @@ -7,7 +7,7 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace someNamespaceB; +namespace PHPUnit\TestFixture\someNamespaceB; class NamespacedClass { diff --git a/tests/_files/phpunit-example-extension/tests/OneTest.php b/tests/_files/phpunit-example-extension/tests/OneTest.php index 0cb87dcacf8..3182729f39b 100644 --- a/tests/_files/phpunit-example-extension/tests/OneTest.php +++ b/tests/_files/phpunit-example-extension/tests/OneTest.php @@ -7,6 +7,8 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ +namespace PHPUnit\TestFixture\ExampleExtension; + use PHPUnit\ExampleExtension\TestCaseTrait; use PHPUnit\Framework\TestCase; diff --git a/tests/basic/unit/StatusTest.php b/tests/basic/unit/StatusTest.php index cadfd4e68b0..3481999c013 100644 --- a/tests/basic/unit/StatusTest.php +++ b/tests/basic/unit/StatusTest.php @@ -9,15 +9,15 @@ */ namespace PHPUnit\SelfTest\Basic; -use AnInterface; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Warning; +use PHPUnit\TestFixture\AnInterface; use RuntimeException; /** * @covers Foo * - * @uses Bar + * @uses \PHPUnit\TestFixture\Bar * * @testdox Test result status with and without message */ diff --git a/tests/end-to-end/abstract-test-class.phpt b/tests/end-to-end/abstract-test-class.phpt index bacbae42542..150aaaf7f7d 100644 --- a/tests/end-to-end/abstract-test-class.phpt +++ b/tests/end-to-end/abstract-test-class.phpt @@ -21,7 +21,7 @@ Time: %s, Memory: %s There was 1 warning: 1) Warning -Cannot instantiate class "AbstractTest". +Cannot instantiate class "PHPUnit\TestFixture\AbstractTest". WARNINGS! Tests: 1, Assertions: 0, Warnings: 1. diff --git a/tests/end-to-end/assertion.phpt b/tests/end-to-end/assertion.phpt index a1104861091..07b1260119a 100644 --- a/tests/end-to-end/assertion.phpt +++ b/tests/end-to-end/assertion.phpt @@ -26,7 +26,7 @@ Time: %s, Memory: %s There was 1 failure: -1) AssertionExampleTest::testOne +1) PHPUnit\TestFixture\AssertionExampleTest::testOne assert(false) in %sAssertionExample.php:%d FAILURES! diff --git a/tests/end-to-end/dataprovider-log-xml-isolation.phpt b/tests/end-to-end/dataprovider-log-xml-isolation.phpt index 5aee0f89390..fd57199b4aa 100644 --- a/tests/end-to-end/dataprovider-log-xml-isolation.phpt +++ b/tests/end-to-end/dataprovider-log-xml-isolation.phpt @@ -16,18 +16,18 @@ PHPUnit %s #StandWithUkraine ..F. 4 / 4 (100%) - - - - - - DataProviderTest::testAdd with data set #2 (1, 1, 3) + + + + + + PHPUnit\TestFixture\DataProviderTest::testAdd with data set #2 (1, 1, 3) Failed asserting that 2 matches expected 3. %s:%i - + @@ -37,7 +37,7 @@ Time: %s, Memory: %s There was 1 failure: -1) DataProviderTest::testAdd with data set #2 (1, 1, 3) +1) PHPUnit\TestFixture\DataProviderTest::testAdd with data set #2 (1, 1, 3) Failed asserting that 2 matches expected 3. %s:%i diff --git a/tests/end-to-end/dataprovider-log-xml.phpt b/tests/end-to-end/dataprovider-log-xml.phpt index 6151a9f3af9..71a83f8fd70 100644 --- a/tests/end-to-end/dataprovider-log-xml.phpt +++ b/tests/end-to-end/dataprovider-log-xml.phpt @@ -15,18 +15,18 @@ PHPUnit %s #StandWithUkraine ..F. 4 / 4 (100%) - - - - - - DataProviderTest::testAdd with data set #2 (1, 1, 3) + + + + + + PHPUnit\TestFixture\DataProviderTest::testAdd with data set #2 (1, 1, 3) Failed asserting that 2 matches expected 3. %s:%i - + @@ -36,7 +36,7 @@ Time: %s, Memory: %s There was 1 failure: -1) DataProviderTest::testAdd with data set #2 (1, 1, 3) +1) PHPUnit\TestFixture\DataProviderTest::testAdd with data set #2 (1, 1, 3) Failed asserting that 2 matches expected 3. %s:%i diff --git a/tests/end-to-end/defaulttestsuite.phpt b/tests/end-to-end/defaulttestsuite.phpt index b033e5721a7..cef59700aac 100644 --- a/tests/end-to-end/defaulttestsuite.phpt +++ b/tests/end-to-end/defaulttestsuite.phpt @@ -12,7 +12,7 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s #StandWithUkraine -Dummy Bar +Dummy Bar (PHPUnit\TestFixture\DummyBar) ✔ Bar equals bar Time: %s, Memory: %s diff --git a/tests/end-to-end/empty-testcase.phpt b/tests/end-to-end/empty-testcase.phpt index e40947e05ea..d6206c09941 100644 --- a/tests/end-to-end/empty-testcase.phpt +++ b/tests/end-to-end/empty-testcase.phpt @@ -18,7 +18,7 @@ Time: %s, Memory: %s There was 1 warning: 1) Warning -No tests found in class "EmptyTestCaseTest". +No tests found in class "PHPUnit\TestFixture\EmptyTestCaseTest". WARNINGS! Tests: 1, Assertions: 0, Warnings: 1. diff --git a/tests/end-to-end/exception-stack.phpt b/tests/end-to-end/exception-stack.phpt index ba084a5c38e..d9474aaff9a 100644 --- a/tests/end-to-end/exception-stack.phpt +++ b/tests/end-to-end/exception-stack.phpt @@ -17,7 +17,7 @@ Time: %s, Memory: %s There were 2 errors: -1) ExceptionStackTest::testPrintingChildException +1) PHPUnit\TestFixture\ExceptionStackTest::testPrintingChildException PHPUnit\Framework\Exception: Child exception message Failed asserting that two arrays are equal. @@ -45,7 +45,7 @@ Failed asserting that two arrays are equal. %s:%i -2) ExceptionStackTest::testNestedExceptions +2) PHPUnit\TestFixture\ExceptionStackTest::testNestedExceptions Exception: One %s:%i diff --git a/tests/end-to-end/execution-order/_files/DependencyTestSuite.php b/tests/end-to-end/execution-order/_files/DependencyTestSuite.php index 4025fccf349..c974b4e3514 100644 --- a/tests/end-to-end/execution-order/_files/DependencyTestSuite.php +++ b/tests/end-to-end/execution-order/_files/DependencyTestSuite.php @@ -8,6 +8,8 @@ * file that was distributed with this source code. */ use PHPUnit\Framework\TestSuite; +use PHPUnit\TestFixture\DependencyFailureTest; +use PHPUnit\TestFixture\DependencySuccessTest; class DependencyTestSuite { diff --git a/tests/end-to-end/execution-order/dependencies-isolation.phpt b/tests/end-to-end/execution-order/dependencies-isolation.phpt index 28d2c10cdf0..9b8d4e7f3f1 100644 --- a/tests/end-to-end/execution-order/dependencies-isolation.phpt +++ b/tests/end-to-end/execution-order/dependencies-isolation.phpt @@ -22,14 +22,14 @@ Time: %s, Memory: %s There was 1 warning: -1) DependencyFailureTest::testHandlesDependsAnnotationForNonexistentTests -This test depends on "DependencyFailureTest::doesNotExist" which does not exist. +1) PHPUnit\TestFixture\DependencyFailureTest::testHandlesDependsAnnotationForNonexistentTests +This test depends on "PHPUnit\TestFixture\DependencyFailureTest::doesNotExist" which does not exist. -- There was 1 failure: -1) DependencyFailureTest::testOne +1) PHPUnit\TestFixture\DependencyFailureTest::testOne %s:%i @@ -37,16 +37,16 @@ There was 1 failure: There were 4 skipped tests: -1) DependencyFailureTest::testTwo -This test depends on "DependencyFailureTest::testOne" to pass. +1) PHPUnit\TestFixture\DependencyFailureTest::testTwo +This test depends on "PHPUnit\TestFixture\DependencyFailureTest::testOne" to pass. -2) DependencyFailureTest::testThree -This test depends on "DependencyFailureTest::testTwo" to pass. +2) PHPUnit\TestFixture\DependencyFailureTest::testThree +This test depends on "PHPUnit\TestFixture\DependencyFailureTest::testTwo" to pass. -3) DependencyFailureTest::testFour -This test depends on "DependencyFailureTest::testOne" to pass. +3) PHPUnit\TestFixture\DependencyFailureTest::testFour +This test depends on "PHPUnit\TestFixture\DependencyFailureTest::testOne" to pass. -4) DependencyFailureTest::testHandlesDependsAnnotationWithNoMethodSpecified +4) PHPUnit\TestFixture\DependencyFailureTest::testHandlesDependsAnnotationWithNoMethodSpecified This method has an invalid @depends annotation. FAILURES! diff --git a/tests/end-to-end/execution-order/stop-on-defect-via-cli.phpt b/tests/end-to-end/execution-order/stop-on-defect-via-cli.phpt index 528b86113f5..969174327ea 100644 --- a/tests/end-to-end/execution-order/stop-on-defect-via-cli.phpt +++ b/tests/end-to-end/execution-order/stop-on-defect-via-cli.phpt @@ -20,7 +20,7 @@ Time: %s, Memory: %s There was 1 warning: 1) Warning -No tests found in class "NoTestCases". +No tests found in class "PHPUnit\TestFixture\NoTestCases". WARNINGS! Tests: 1, Assertions: 0, Warnings: 1. diff --git a/tests/end-to-end/execution-order/stop-on-defect-via-config.phpt b/tests/end-to-end/execution-order/stop-on-defect-via-config.phpt index 4f2c873ba4a..33c022a72cb 100644 --- a/tests/end-to-end/execution-order/stop-on-defect-via-config.phpt +++ b/tests/end-to-end/execution-order/stop-on-defect-via-config.phpt @@ -20,7 +20,7 @@ Time: %s, Memory: %s There was 1 warning: 1) Warning -No tests found in class "NoTestCases". +No tests found in class "PHPUnit\TestFixture\NoTestCases". WARNINGS! Tests: 1, Assertions: 0, Warnings: 1. diff --git a/tests/end-to-end/execution-order/stop-on-error-via-cli.phpt b/tests/end-to-end/execution-order/stop-on-error-via-cli.phpt index d72fd67a527..ec426f9847e 100644 --- a/tests/end-to-end/execution-order/stop-on-error-via-cli.phpt +++ b/tests/end-to-end/execution-order/stop-on-error-via-cli.phpt @@ -19,7 +19,7 @@ Time: %s, Memory: %s There was 1 error: -1) StopOnErrorTestSuite::testWithError +1) PHPUnit\TestFixture\StopOnErrorTestSuite::testWithError Error: StopOnErrorTestSuite_error %s%etests%e_files%eStopOnErrorTestSuite.php:%d diff --git a/tests/end-to-end/execution-order/stop-on-error-via-config.phpt b/tests/end-to-end/execution-order/stop-on-error-via-config.phpt index 6723fe271fe..59603998a9e 100644 --- a/tests/end-to-end/execution-order/stop-on-error-via-config.phpt +++ b/tests/end-to-end/execution-order/stop-on-error-via-config.phpt @@ -19,7 +19,7 @@ Time: %s, Memory: %s There was 1 error: -1) StopOnErrorTestSuite::testWithError +1) PHPUnit\TestFixture\StopOnErrorTestSuite::testWithError Error: StopOnErrorTestSuite_error %s%etests%e_files%eStopOnErrorTestSuite.php:%d diff --git a/tests/end-to-end/execution-order/stop-on-warning-via-cli.phpt b/tests/end-to-end/execution-order/stop-on-warning-via-cli.phpt index 0ea8aa21085..1866d3f997e 100644 --- a/tests/end-to-end/execution-order/stop-on-warning-via-cli.phpt +++ b/tests/end-to-end/execution-order/stop-on-warning-via-cli.phpt @@ -20,7 +20,7 @@ Time: %s, Memory: %s There was 1 warning: 1) Warning -No tests found in class "NoTestCases". +No tests found in class "PHPUnit\TestFixture\NoTestCases". WARNINGS! Tests: 1, Assertions: 0, Warnings: 1. diff --git a/tests/end-to-end/execution-order/stop-on-warning-via-config.phpt b/tests/end-to-end/execution-order/stop-on-warning-via-config.phpt index 665f8d7b852..59c5f5083ad 100644 --- a/tests/end-to-end/execution-order/stop-on-warning-via-config.phpt +++ b/tests/end-to-end/execution-order/stop-on-warning-via-config.phpt @@ -21,7 +21,7 @@ Time: %s, Memory: %s There was 1 warning: 1) Warning -No tests found in class "NoTestCases". +No tests found in class "PHPUnit\TestFixture\NoTestCases". WARNINGS! Tests: 1, Assertions: 0, Warnings: 1. diff --git a/tests/end-to-end/execution-order/test-order-size-with-dependency-resolution.phpt b/tests/end-to-end/execution-order/test-order-size-with-dependency-resolution.phpt index 15590269e38..3a7358ce397 100644 --- a/tests/end-to-end/execution-order/test-order-size-with-dependency-resolution.phpt +++ b/tests/end-to-end/execution-order/test-order-size-with-dependency-resolution.phpt @@ -17,22 +17,22 @@ PHPUnit %s #StandWithUkraine Runtime: %s -Test 'TestWithDifferentSizes::testWithSizeSmall' started -Test 'TestWithDifferentSizes::testWithSizeSmall' ended -Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #0 (false)' started -Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #0 (false)' ended -Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #1 (true)' started -Test 'TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #1 (true)' ended -Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #0 (false)' started -Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #0 (false)' ended -Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #1 (true)' started -Test 'TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #1 (true)' ended -Test 'TestWithDifferentSizes::testWithSizeMedium' started -Test 'TestWithDifferentSizes::testWithSizeMedium' ended -Test 'TestWithDifferentSizes::testWithSizeLarge' started -Test 'TestWithDifferentSizes::testWithSizeLarge' ended -Test 'TestWithDifferentSizes::testWithSizeUnknown' started -Test 'TestWithDifferentSizes::testWithSizeUnknown' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeSmall' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeSmall' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #0 (false)' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #0 (false)' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #1 (true)' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeSmall with data set #1 (true)' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #0 (false)' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #0 (false)' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #1 (true)' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testDataProviderWithSizeMedium with data set #1 (true)' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeMedium' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeMedium' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeLarge' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeLarge' ended +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeUnknown' started +Test 'PHPUnit\TestFixture\TestWithDifferentSizes::testWithSizeUnknown' ended Time: %s, Memory: %s diff --git a/tests/end-to-end/failure-isolation.phpt b/tests/end-to-end/failure-isolation.phpt index 81445a7ae69..3245759f723 100644 --- a/tests/end-to-end/failure-isolation.phpt +++ b/tests/end-to-end/failure-isolation.phpt @@ -18,7 +18,7 @@ Time: %s, Memory: %s There were 13 failures: -1) FailureTest::testAssertArrayEqualsArray +1) PHPUnit\TestFixture\FailureTest::testAssertArrayEqualsArray message Failed asserting that two arrays are equal. --- Expected @@ -31,13 +31,13 @@ Failed asserting that two arrays are equal. %s:%i -2) FailureTest::testAssertIntegerEqualsInteger +2) PHPUnit\TestFixture\FailureTest::testAssertIntegerEqualsInteger message Failed asserting that 2 matches expected 1. %s:%i -3) FailureTest::testAssertObjectEqualsObject +3) PHPUnit\TestFixture\FailureTest::testAssertObjectEqualsObject message Failed asserting that two objects are equal. --- Expected @@ -50,13 +50,13 @@ Failed asserting that two objects are equal. %s:%i -4) FailureTest::testAssertNullEqualsString +4) PHPUnit\TestFixture\FailureTest::testAssertNullEqualsString message Failed asserting that 'bar' matches expected null. %s:%i -5) FailureTest::testAssertStringEqualsString +5) PHPUnit\TestFixture\FailureTest::testAssertStringEqualsString message Failed asserting that two strings are equal. --- Expected @@ -67,7 +67,7 @@ Failed asserting that two strings are equal. %s:%i -6) FailureTest::testAssertTextEqualsText +6) PHPUnit\TestFixture\FailureTest::testAssertTextEqualsText message Failed asserting that two strings are equal. --- Expected @@ -80,7 +80,7 @@ Failed asserting that two strings are equal. %s:%i -7) FailureTest::testAssertStringMatchesFormat +7) PHPUnit\TestFixture\FailureTest::testAssertStringMatchesFormat message Failed asserting that string matches format description. --- Expected @@ -91,13 +91,13 @@ Failed asserting that string matches format description. %s:%i -8) FailureTest::testAssertNumericEqualsNumeric +8) PHPUnit\TestFixture\FailureTest::testAssertNumericEqualsNumeric message Failed asserting that 2 matches expected 1. %s:%i -9) FailureTest::testAssertTextSameText +9) PHPUnit\TestFixture\FailureTest::testAssertTextSameText message Failed asserting that two strings are identical. --- Expected @@ -108,25 +108,25 @@ Failed asserting that two strings are identical. %s:%i -10) FailureTest::testAssertObjectSameObject +10) PHPUnit\TestFixture\FailureTest::testAssertObjectSameObject message Failed asserting that two variables reference the same object. %s:%i -11) FailureTest::testAssertObjectSameNull +11) PHPUnit\TestFixture\FailureTest::testAssertObjectSameNull message Failed asserting that null is identical to an object of class "stdClass". %s:%i -12) FailureTest::testAssertFloatSameFloat +12) PHPUnit\TestFixture\FailureTest::testAssertFloatSameFloat message Failed asserting that 1.5 is identical to 1.0. %s:%i -13) FailureTest::testAssertStringMatchesFormatFile +13) PHPUnit\TestFixture\FailureTest::testAssertStringMatchesFormatFile Failed asserting that string matches format description. --- Expected +++ Actual diff --git a/tests/end-to-end/failure.phpt b/tests/end-to-end/failure.phpt index a160b2f3f7b..ce2ca49ef3f 100644 --- a/tests/end-to-end/failure.phpt +++ b/tests/end-to-end/failure.phpt @@ -17,7 +17,7 @@ Time: %s, Memory: %s There were 13 failures: -1) FailureTest::testAssertArrayEqualsArray +1) PHPUnit\TestFixture\FailureTest::testAssertArrayEqualsArray message Failed asserting that two arrays are equal. --- Expected @@ -30,13 +30,13 @@ Failed asserting that two arrays are equal. %s:%i -2) FailureTest::testAssertIntegerEqualsInteger +2) PHPUnit\TestFixture\FailureTest::testAssertIntegerEqualsInteger message Failed asserting that 2 matches expected 1. %s:%i -3) FailureTest::testAssertObjectEqualsObject +3) PHPUnit\TestFixture\FailureTest::testAssertObjectEqualsObject message Failed asserting that two objects are equal. --- Expected @@ -49,13 +49,13 @@ Failed asserting that two objects are equal. %s:%i -4) FailureTest::testAssertNullEqualsString +4) PHPUnit\TestFixture\FailureTest::testAssertNullEqualsString message Failed asserting that 'bar' matches expected null. %s:%i -5) FailureTest::testAssertStringEqualsString +5) PHPUnit\TestFixture\FailureTest::testAssertStringEqualsString message Failed asserting that two strings are equal. --- Expected @@ -66,7 +66,7 @@ Failed asserting that two strings are equal. %s:%i -6) FailureTest::testAssertTextEqualsText +6) PHPUnit\TestFixture\FailureTest::testAssertTextEqualsText message Failed asserting that two strings are equal. --- Expected @@ -79,7 +79,7 @@ Failed asserting that two strings are equal. %s:%i -7) FailureTest::testAssertStringMatchesFormat +7) PHPUnit\TestFixture\FailureTest::testAssertStringMatchesFormat message Failed asserting that string matches format description. --- Expected @@ -90,13 +90,13 @@ Failed asserting that string matches format description. %s:%i -8) FailureTest::testAssertNumericEqualsNumeric +8) PHPUnit\TestFixture\FailureTest::testAssertNumericEqualsNumeric message Failed asserting that 2 matches expected 1. %s:%i -9) FailureTest::testAssertTextSameText +9) PHPUnit\TestFixture\FailureTest::testAssertTextSameText message Failed asserting that two strings are identical. --- Expected @@ -107,25 +107,25 @@ Failed asserting that two strings are identical. %s:%i -10) FailureTest::testAssertObjectSameObject +10) PHPUnit\TestFixture\FailureTest::testAssertObjectSameObject message Failed asserting that two variables reference the same object. %s:%i -11) FailureTest::testAssertObjectSameNull +11) PHPUnit\TestFixture\FailureTest::testAssertObjectSameNull message Failed asserting that null is identical to an object of class "stdClass". %s:%i -12) FailureTest::testAssertFloatSameFloat +12) PHPUnit\TestFixture\FailureTest::testAssertFloatSameFloat message Failed asserting that 1.5 is identical to 1.0. %s:%i -13) FailureTest::testAssertStringMatchesFormatFile +13) PHPUnit\TestFixture\FailureTest::testAssertStringMatchesFormatFile Failed asserting that string matches format description. --- Expected +++ Actual diff --git a/tests/end-to-end/fatal-isolation.phpt b/tests/end-to-end/fatal-isolation.phpt index f90039a56a9..fe0746e077e 100644 --- a/tests/end-to-end/fatal-isolation.phpt +++ b/tests/end-to-end/fatal-isolation.phpt @@ -18,7 +18,7 @@ Time: %s, Memory: %s There was 1 error: -1) FatalTest::testFatalError +1) PHPUnit\TestFixture\FatalTest::testFatalError %a ERRORS! Tests: 1, Assertions: 0, Errors: 1. diff --git a/tests/end-to-end/group.phpt b/tests/end-to-end/group.phpt index 3a803c476e3..b8fe87b46c2 100644 --- a/tests/end-to-end/group.phpt +++ b/tests/end-to-end/group.phpt @@ -14,7 +14,7 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s #StandWithUkraine -Numeric Group Annotation +Numeric Group Annotation (PHPUnit\TestFixture\NumericGroupAnnotation) ✔ Empty test for @ticket numeric annotation values ✔ Empty test for @group numeric annotation values diff --git a/tests/end-to-end/list-tests-dataprovider.phpt b/tests/end-to-end/list-tests-dataprovider.phpt index ceb74e6325f..750f69ebeb0 100644 --- a/tests/end-to-end/list-tests-dataprovider.phpt +++ b/tests/end-to-end/list-tests-dataprovider.phpt @@ -13,7 +13,7 @@ PHPUnit\TextUI\Command::main(); PHPUnit %s #StandWithUkraine Available test(s): - - DataProviderTest::testAdd#0 - - DataProviderTest::testAdd#1 - - DataProviderTest::testAdd#2 - - DataProviderTest::testAdd#3 + - PHPUnit\TestFixture\DataProviderTest::testAdd#0 + - PHPUnit\TestFixture\DataProviderTest::testAdd#1 + - PHPUnit\TestFixture\DataProviderTest::testAdd#2 + - PHPUnit\TestFixture\DataProviderTest::testAdd#3 diff --git a/tests/end-to-end/list-tests-xml-dataprovider.phpt b/tests/end-to-end/list-tests-xml-dataprovider.phpt index 259234c0d46..0fefb74d10d 100644 --- a/tests/end-to-end/list-tests-xml-dataprovider.phpt +++ b/tests/end-to-end/list-tests-xml-dataprovider.phpt @@ -22,7 +22,7 @@ PHPUnit %s #StandWithUkraine Wrote list of tests that would have been run to %s - + diff --git a/tests/end-to-end/loggers/_files/configuration.custom-printer.xml b/tests/end-to-end/loggers/_files/configuration.custom-printer.xml index 7a5a1f1d99a..49a26e7643c 100644 --- a/tests/end-to-end/loggers/_files/configuration.custom-printer.xml +++ b/tests/end-to-end/loggers/_files/configuration.custom-printer.xml @@ -1,2 +1,2 @@ - \ No newline at end of file + diff --git a/tests/end-to-end/loggers/custom-printer-debug.phpt b/tests/end-to-end/loggers/custom-printer-debug.phpt index f8551386142..58ca2a55d4a 100644 --- a/tests/end-to-end/loggers/custom-printer-debug.phpt +++ b/tests/end-to-end/loggers/custom-printer-debug.phpt @@ -14,12 +14,12 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s #StandWithUkraine -Test 'BankAccountTest::testBalanceIsInitiallyZero' started -Test 'BankAccountTest::testBalanceIsInitiallyZero' ended -Test 'BankAccountTest::testBalanceCannotBecomeNegative' started -Test 'BankAccountTest::testBalanceCannotBecomeNegative' ended -Test 'BankAccountTest::testBalanceCannotBecomeNegative2' started -Test 'BankAccountTest::testBalanceCannotBecomeNegative2' ended +Test 'PHPUnit\TestFixture\BankAccountTest::testBalanceIsInitiallyZero' started +Test 'PHPUnit\TestFixture\BankAccountTest::testBalanceIsInitiallyZero' ended +Test 'PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative' started +Test 'PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative' ended +Test 'PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative2' started +Test 'PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative2' ended Time: %s, Memory: %s diff --git a/tests/end-to-end/loggers/custom-printer-verbose.phpt b/tests/end-to-end/loggers/custom-printer-verbose.phpt index 1dd7968f1f8..fd1ca38b9d9 100644 --- a/tests/end-to-end/loggers/custom-printer-verbose.phpt +++ b/tests/end-to-end/loggers/custom-printer-verbose.phpt @@ -23,7 +23,7 @@ Time: %s, Memory: %s There was 1 incomplete test: -1) IncompleteTest::testIncomplete +1) PHPUnit\TestFixture\IncompleteTest::testIncomplete Test incomplete %s diff --git a/tests/end-to-end/loggers/failure-reverse-list.phpt b/tests/end-to-end/loggers/failure-reverse-list.phpt index 208f635db50..aebce095927 100644 --- a/tests/end-to-end/loggers/failure-reverse-list.phpt +++ b/tests/end-to-end/loggers/failure-reverse-list.phpt @@ -19,7 +19,7 @@ Time: %s, Memory: %s There were 13 failures: -1) FailureTest::testAssertStringMatchesFormatFile +1) PHPUnit\TestFixture\FailureTest::testAssertStringMatchesFormatFile Failed asserting that string matches format description. --- Expected +++ Actual @@ -29,25 +29,25 @@ Failed asserting that string matches format description. %s:%d -2) FailureTest::testAssertFloatSameFloat +2) PHPUnit\TestFixture\FailureTest::testAssertFloatSameFloat message Failed asserting that 1.5 is identical to 1.0. %s:%d -3) FailureTest::testAssertObjectSameNull +3) PHPUnit\TestFixture\FailureTest::testAssertObjectSameNull message Failed asserting that null is identical to an object of class "stdClass". %s:%d -4) FailureTest::testAssertObjectSameObject +4) PHPUnit\TestFixture\FailureTest::testAssertObjectSameObject message Failed asserting that two variables reference the same object. %s:%d -5) FailureTest::testAssertTextSameText +5) PHPUnit\TestFixture\FailureTest::testAssertTextSameText message Failed asserting that two strings are identical. --- Expected @@ -58,13 +58,13 @@ Failed asserting that two strings are identical. %s:%d -6) FailureTest::testAssertNumericEqualsNumeric +6) PHPUnit\TestFixture\FailureTest::testAssertNumericEqualsNumeric message Failed asserting that 2 matches expected 1. %s:%d -7) FailureTest::testAssertStringMatchesFormat +7) PHPUnit\TestFixture\FailureTest::testAssertStringMatchesFormat message Failed asserting that string matches format description. --- Expected @@ -75,7 +75,7 @@ Failed asserting that string matches format description. %s:%d -8) FailureTest::testAssertTextEqualsText +8) PHPUnit\TestFixture\FailureTest::testAssertTextEqualsText message Failed asserting that two strings are equal. --- Expected @@ -88,7 +88,7 @@ Failed asserting that two strings are equal. %s:%d -9) FailureTest::testAssertStringEqualsString +9) PHPUnit\TestFixture\FailureTest::testAssertStringEqualsString message Failed asserting that two strings are equal. --- Expected @@ -99,13 +99,13 @@ Failed asserting that two strings are equal. %s:%d -10) FailureTest::testAssertNullEqualsString +10) PHPUnit\TestFixture\FailureTest::testAssertNullEqualsString message Failed asserting that 'bar' matches expected null. %s:%d -11) FailureTest::testAssertObjectEqualsObject +11) PHPUnit\TestFixture\FailureTest::testAssertObjectEqualsObject message Failed asserting that two objects are equal. --- Expected @@ -118,13 +118,13 @@ Failed asserting that two objects are equal. %s:%d -12) FailureTest::testAssertIntegerEqualsInteger +12) PHPUnit\TestFixture\FailureTest::testAssertIntegerEqualsInteger message Failed asserting that 2 matches expected 1. %s:%d -13) FailureTest::testAssertArrayEqualsArray +13) PHPUnit\TestFixture\FailureTest::testAssertArrayEqualsArray message Failed asserting that two arrays are equal. --- Expected diff --git a/tests/end-to-end/loggers/log-teamcity.phpt b/tests/end-to-end/loggers/log-teamcity.phpt index 70011d2a9b0..49696a44709 100644 --- a/tests/end-to-end/loggers/log-teamcity.phpt +++ b/tests/end-to-end/loggers/log-teamcity.phpt @@ -17,21 +17,21 @@ PHPUnit %s #StandWithUkraine ##teamcity[testCount count='3' flowId='%d'] -##teamcity[testSuiteStarted name='BankAccountTest' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest' flowId='%d'] +##teamcity[testSuiteStarted name='PHPUnit\TestFixture\BankAccountTest' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest' flowId='%d'] -##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest::testBalanceIsInitiallyZero' flowId='%d'] +##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest::testBalanceIsInitiallyZero' flowId='%d'] . ##teamcity[testFinished name='testBalanceIsInitiallyZero' duration='%s' flowId='%d'] -##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative' flowId='%d'] +##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative' flowId='%d'] . ##teamcity[testFinished name='testBalanceCannotBecomeNegative' duration='%s' flowId='%d'] -##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative2' flowId='%d'] +##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative2' flowId='%d'] . 3 / 3 (100%) ##teamcity[testFinished name='testBalanceCannotBecomeNegative2' duration='%s' flowId='%d'] -##teamcity[testSuiteFinished name='BankAccountTest' flowId='%d'] +##teamcity[testSuiteFinished name='PHPUnit\TestFixture\BankAccountTest' flowId='%d'] Time: %s, Memory: %s diff --git a/tests/end-to-end/loggers/teamcity-inner-exceptions.phpt b/tests/end-to-end/loggers/teamcity-inner-exceptions.phpt index ec262ffa4fc..3436fbbdc67 100644 --- a/tests/end-to-end/loggers/teamcity-inner-exceptions.phpt +++ b/tests/end-to-end/loggers/teamcity-inner-exceptions.phpt @@ -16,21 +16,21 @@ PHPUnit %s #StandWithUkraine ##teamcity[testCount count='2' flowId='%d'] -##teamcity[testSuiteStarted name='ExceptionStackTest' locationHint='php_qn://%s%etests%e_files%eExceptionStackTest.php::\ExceptionStackTest' flowId='%d'] +##teamcity[testSuiteStarted name='PHPUnit\TestFixture\ExceptionStackTest' locationHint='php_qn://%s%etests%e_files%eExceptionStackTest.php::\PHPUnit\TestFixture\ExceptionStackTest' flowId='%d'] -##teamcity[testStarted name='testPrintingChildException' locationHint='php_qn://%s%etests%e_files%eExceptionStackTest.php::\ExceptionStackTest::testPrintingChildException' flowId='%d'] +##teamcity[testStarted name='testPrintingChildException' locationHint='php_qn://%s%etests%e_files%eExceptionStackTest.php::\PHPUnit\TestFixture\ExceptionStackTest::testPrintingChildException' flowId='%d'] ##teamcity[testFailed name='testPrintingChildException' message='Child exception|nmessage|nFailed asserting that two arrays are equal.|n--- Expected|n+++ Actual|n@@ @@|n Array (|n- 0 => 1|n+ 0 => 2|n )|n' details=' %s_files%eExceptionStackTest.php:%d|n |n Caused by|n message|n Failed asserting that two arrays are equal.|n --- Expected|n +++ Actual|n @@ @@|n Array (|n - 0 => 1|n + 0 => 2|n )|n |n %s_files%eExceptionStackTest.php:%d|n ' duration='%d' flowId='%d'] ##teamcity[testFinished name='testPrintingChildException' duration='%d' flowId='%d'] -##teamcity[testStarted name='testNestedExceptions' locationHint='php_qn://%s%etests%e_files%eExceptionStackTest.php::\ExceptionStackTest::testNestedExceptions' flowId='%d'] +##teamcity[testStarted name='testNestedExceptions' locationHint='php_qn://%s%etests%e_files%eExceptionStackTest.php::\PHPUnit\TestFixture\ExceptionStackTest::testNestedExceptions' flowId='%d'] ##teamcity[testFailed name='testNestedExceptions' message='Exception : One' details=' %s%etests%e_files%eExceptionStackTest.php:%d|n |n Caused by|n InvalidArgumentException: Two|n |n %s%etests%e_files%eExceptionStackTest.php:%d|n |n Caused by|n Exception: Three|n |n %s%etests%e_files%eExceptionStackTest.php:%d|n ' duration='%d' flowId='%d'] ##teamcity[testFinished name='testNestedExceptions' duration='%d' flowId='%d'] -##teamcity[testSuiteFinished name='ExceptionStackTest' flowId='%d'] +##teamcity[testSuiteFinished name='PHPUnit\TestFixture\ExceptionStackTest' flowId='%d'] Time: %s, Memory: %s diff --git a/tests/end-to-end/loggers/teamcity.phpt b/tests/end-to-end/loggers/teamcity.phpt index 4851a55e8ad..03579a94e2b 100644 --- a/tests/end-to-end/loggers/teamcity.phpt +++ b/tests/end-to-end/loggers/teamcity.phpt @@ -16,21 +16,21 @@ PHPUnit %s #StandWithUkraine ##teamcity[testCount count='3' flowId='%d'] -##teamcity[testSuiteStarted name='BankAccountTest' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest' flowId='%d'] +##teamcity[testSuiteStarted name='PHPUnit\TestFixture\BankAccountTest' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest' flowId='%d'] -##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest::testBalanceIsInitiallyZero' flowId='%d'] +##teamcity[testStarted name='testBalanceIsInitiallyZero' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest::testBalanceIsInitiallyZero' flowId='%d'] ##teamcity[testFinished name='testBalanceIsInitiallyZero' duration='%s' flowId='%d'] -##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative' flowId='%d'] +##teamcity[testStarted name='testBalanceCannotBecomeNegative' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative' flowId='%d'] ##teamcity[testFinished name='testBalanceCannotBecomeNegative' duration='%s' flowId='%d'] -##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\BankAccountTest::testBalanceCannotBecomeNegative2' flowId='%d'] +##teamcity[testStarted name='testBalanceCannotBecomeNegative2' locationHint='php_qn://%s%etests%e_files%eBankAccountTest.php::\PHPUnit\TestFixture\BankAccountTest::testBalanceCannotBecomeNegative2' flowId='%d'] ##teamcity[testFinished name='testBalanceCannotBecomeNegative2' duration='%s' flowId='%d'] -##teamcity[testSuiteFinished name='BankAccountTest' flowId='%d'] +##teamcity[testSuiteFinished name='PHPUnit\TestFixture\BankAccountTest' flowId='%d'] Time: %s, Memory: %s diff --git a/tests/end-to-end/loggers/testdox-html.phpt b/tests/end-to-end/loggers/testdox-html.phpt index 2b076e5e394..59cb5c4d48a 100644 --- a/tests/end-to-end/loggers/testdox-html.phpt +++ b/tests/end-to-end/loggers/testdox-html.phpt @@ -46,7 +46,7 @@ PHPUnit %s #StandWithUkraine -

Bank Account

+

Bank Account (PHPUnit\TestFixture\BankAccount)