diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index d04471f..3dd9238 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -39,5 +39,5 @@ $ composer show --latest 'symfony-cmf/*' If it's an error message or piece of code, use code block tags, and make sure you provide the whole stack trace(s), not just the first error message you can see. - More details here: https://github.com/symfony-cmf/Testing/blob/master/CONTRIBUTING.md#issues + More details here: https://github.com/symfony-cmf/Testing/blob/5.x/CONTRIBUTING.md#issues --> diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0d8f7f7..8505ce9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ | Q | A | ------------- | --- -| Branch? | "master" for new features / the branch of the current release for fixes +| Branch? | branch of the next release for new features / the branch of the current release for fixes | Bug fix? | yes/no | New feature? | yes/no | BC breaks? | yes/no diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 22ce986..680d890 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -11,7 +11,7 @@ on: jobs: test: name: 'PHP ${{ matrix.php-version }}, Symfony ${{ matrix.symfony-version }} ${{ matrix.dependencies}}' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: SYMFONY_DEPRECATIONS_HELPER: weak @@ -27,6 +27,8 @@ jobs: - php-version: '8.1' - php-version: '8.2' - php-version: '8.3' + - php-version: '8.4' + - php-version: '8.5' steps: - name: Checkout project diff --git a/bootstrap/kernel_bootstrap.php b/bootstrap/kernel_bootstrap.php index 5506341..950ac83 100644 --- a/bootstrap/kernel_bootstrap.php +++ b/bootstrap/kernel_bootstrap.php @@ -18,13 +18,13 @@ $phpUnitFile = $rootDir.'/phpunit.xml.dist'; if (!file_exists($phpUnitFile)) { - throw new \Exception(sprintf( + throw new Exception(sprintf( 'Cannot find phpunit.xml.dist file in "%s"', $phpUnitFile )); } -$xml = new \SimpleXMLElement(file_get_contents($phpUnitFile)); +$xml = new SimpleXMLElement(file_get_contents($phpUnitFile)); $envClass = $xml->xpath("//php/env[@name='KERNEL_CLASS']"); if (count($envClass)) { @@ -32,7 +32,7 @@ } else { $envDir = $xml->xpath("//php/server[@name='KERNEL_DIR']"); if (!count($envDir)) { - throw new \Exception( + throw new Exception( 'KERNEL_CLASS must be set via ' ); } @@ -40,7 +40,7 @@ $kernelFile = $rootDir.'/'.$envDir[0]['value'].'/'.$kernelClass.'.php'; if (!file_exists($kernelFile)) { - throw new \Exception(sprintf( + throw new Exception(sprintf( 'Cannot find kernel file "%s"', $kernelFile )); diff --git a/composer.json b/composer.json index 07dd10e..09b891e 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "require": { "php": "^8.1", "doctrine/data-fixtures": "^1.2", - "symfony/browser-kit": "^6.4 || ^7.0" + "symfony/browser-kit": "^6.4 || ^7.0 || ^8.0" }, "require-dev": { "ext-dom": "*", @@ -19,14 +19,14 @@ "doctrine/phpcr-odm": "^2.0", "doctrine/phpcr-bundle": "^3.0", "jackalope/jackalope-doctrine-dbal": "^2.0", - "symfony/console": "^6.4 || ^7.0", - "symfony/dependency-injection": "^6.4 || ^7.0", - "symfony/doctrine-bridge": "^6.4 || ^7.0", - "symfony/framework-bundle": "^6.4 || ^7.0", - "symfony/http-kernel": "^6.4 || ^7.0", + "symfony/console": "^6.4 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0", + "symfony/doctrine-bridge": "^6.4 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", + "symfony/http-kernel": "^6.4 || ^7.0 || ^8.0", "symfony/monolog-bundle": "^3.5", - "symfony/security-bundle": "^6.4 || ^7.0", - "symfony/twig-bundle": "^6.4 || ^7.0", + "symfony/security-bundle": "^6.4 || ^7.0 || ^8.0", + "symfony/twig-bundle": "^6.4 || ^7.0 || ^8.0", "symfony/phpunit-bridge": "^7.0.3" }, "conflict": { diff --git a/resources/config/dist/security.php b/resources/config/dist/security.php index 57d1dc1..4c8ddb3 100644 --- a/resources/config/dist/security.php +++ b/resources/config/dist/security.php @@ -40,7 +40,7 @@ ], ]; -if (class_exists(\Symfony\Component\Security\Core\Security::class)) { +if (class_exists(Symfony\Component\Security\Core\Security::class)) { // Symfony 6 but not 7 $config['enable_authenticator_manager'] = true; } diff --git a/src/Functional/BaseTestCase.php b/src/Functional/BaseTestCase.php index 3a77b68..aeb62ca 100644 --- a/src/Functional/BaseTestCase.php +++ b/src/Functional/BaseTestCase.php @@ -124,7 +124,7 @@ protected function getDbManager(string $type): PhpcrDecorator|PHPCR|ORM return $this->dbManagers[$type]; } - $className = sprintf( + $className = \sprintf( 'Symfony\Cmf\Component\Testing\Functional\DbManager\%s', $type ); @@ -134,7 +134,7 @@ protected function getDbManager(string $type): PhpcrDecorator|PHPCR|ORM } if (!class_exists($className)) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Test DBManager "%s" does not exist.', $className )); diff --git a/src/Functional/DbManager/ORM.php b/src/Functional/DbManager/ORM.php index c72fd14..c3a8b91 100644 --- a/src/Functional/DbManager/ORM.php +++ b/src/Functional/DbManager/ORM.php @@ -78,7 +78,7 @@ public function loadFixtures(array $classNames): void protected function loadFixtureClass(Loader $loader, string $className): void { if (!class_exists($className)) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Fixture class "%s" does not exist.', $className )); diff --git a/src/Functional/DbManager/PHPCR.php b/src/Functional/DbManager/PHPCR.php index 4a86fab..6ebb1b8 100644 --- a/src/Functional/DbManager/PHPCR.php +++ b/src/Functional/DbManager/PHPCR.php @@ -81,7 +81,7 @@ public function loadFixtureClass(Loader $loader, $class): void $fixture = $class; } else { if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Fixture class "%s" does not exist.', $class )); diff --git a/src/Functional/DbManager/PhpcrDecorator.php b/src/Functional/DbManager/PhpcrDecorator.php index c1ab08b..12fe07a 100644 --- a/src/Functional/DbManager/PhpcrDecorator.php +++ b/src/Functional/DbManager/PhpcrDecorator.php @@ -26,7 +26,7 @@ public function __construct(ContainerInterface $container) parent::__construct($container->get('doctrine_phpcr'), $container->get('doctrine_phpcr.initializer_manager')); } - public function getOm(string $managerName = null): DocumentManagerInterface + public function getOm(?string $managerName = null): DocumentManagerInterface { return $this->getDocumentManager($managerName); } diff --git a/src/HttpKernel/TestKernel.php b/src/HttpKernel/TestKernel.php index 27b7b06..8044b27 100644 --- a/src/HttpKernel/TestKernel.php +++ b/src/HttpKernel/TestKernel.php @@ -107,7 +107,7 @@ public function requireBundleSets(array $names): void public function requireBundleSet(string $name): void { if (!isset($this->bundleSets[$name])) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Bundle set %s has not been registered, available bundle sets: %s', $name, implode(',', array_keys($this->bundleSets)) @@ -116,7 +116,7 @@ public function requireBundleSet(string $name): void foreach ($this->bundleSets[$name] as $bundle) { if (!class_exists($bundle)) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Bundle class "%s" does not exist.', $bundle )); @@ -199,7 +199,7 @@ protected function registerConfiguredBundles(): void foreach ($bundles as $class => $environments) { if (isset($environments['all']) || isset($environments[$this->environment])) { if (!class_exists($class)) { - throw new \InvalidArgumentException(sprintf( + throw new \InvalidArgumentException(\sprintf( 'Bundle class "%s" does not exist.', $class )); diff --git a/src/Unit/Constraint/SchemaAcceptsXml.php b/src/Unit/Constraint/SchemaAcceptsXml.php index d3913ae..db58842 100644 --- a/src/Unit/Constraint/SchemaAcceptsXml.php +++ b/src/Unit/Constraint/SchemaAcceptsXml.php @@ -32,7 +32,7 @@ public function matches($schemaFile): bool $configElement = $dom->getElementsByTagName('config'); if (1 !== $configElement->length) { - throw new \InvalidArgumentException(sprintf('Can only test a file if it contains 1 element, %d given', $configElement->length)); + throw new \InvalidArgumentException(\sprintf('Can only test a file if it contains 1 element, %d given', $configElement->length)); } $configDom = new \DOMDocument(); @@ -61,7 +61,7 @@ public function toString(): string protected function failureDescription($schemaFile): string { - return sprintf( + return \sprintf( 'Xml is accepted by the XML schema "%s"', $schemaFile ); diff --git a/src/Unit/XmlSchemaTestCase.php b/src/Unit/XmlSchemaTestCase.php index 1c53e8a..4d723eb 100644 --- a/src/Unit/XmlSchemaTestCase.php +++ b/src/Unit/XmlSchemaTestCase.php @@ -46,7 +46,7 @@ private static function getSchemaAcceptsXmlConstraint($xmlDoms) } if (!$dom instanceof \DOMDocument) { - throw new \InvalidArgumentException(sprintf('The first argument of assertSchemaAcceptsXml should be instances of \DOMDocument, "%s" given', \get_class($dom))); + throw new \InvalidArgumentException(\sprintf('The first argument of assertSchemaAcceptsXml should be instances of \DOMDocument, "%s" given', \get_class($dom))); } return $dom; diff --git a/tests/Functional/BaseTestCaseTest.php b/tests/Functional/BaseTestCaseTest.php index dbfaa8c..04ee25c 100644 --- a/tests/Functional/BaseTestCaseTest.php +++ b/tests/Functional/BaseTestCaseTest.php @@ -113,7 +113,7 @@ public function testDb(string $dbName, string|null $expected): void return; } - $className = sprintf( + $className = \sprintf( 'Symfony\Cmf\Component\Testing\Functional\DbManager\%s', $expected );