Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-->
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions bootstrap/kernel_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@
$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)) {
$kernelClass = (string) $envClass[0]['value'];
} else {
$envDir = $xml->xpath("//php/server[@name='KERNEL_DIR']");
if (!count($envDir)) {
throw new \Exception(
throw new Exception(
'KERNEL_CLASS must be set via <env name"KERNEL_CLASS" value="..."/>'
);
}
$kernelClass = 'AppKernel';
$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
));
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
"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": "*",
"doctrine/doctrine-bundle": "^1.8 || ^2.0",
"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": {
Expand Down
2 changes: 1 addition & 1 deletion resources/config/dist/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Functional/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -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
));
Expand Down
2 changes: 1 addition & 1 deletion src/Functional/DbManager/ORM.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
));
Expand Down
2 changes: 1 addition & 1 deletion src/Functional/DbManager/PHPCR.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
));
Expand Down
2 changes: 1 addition & 1 deletion src/Functional/DbManager/PhpcrDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions src/HttpKernel/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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
));
Expand Down Expand Up @@ -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
));
Expand Down
4 changes: 2 additions & 2 deletions src/Unit/Constraint/SchemaAcceptsXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <config> element, %d given', $configElement->length));
throw new \InvalidArgumentException(\sprintf('Can only test a file if it contains 1 <config> element, %d given', $configElement->length));
}

$configDom = new \DOMDocument();
Expand Down Expand Up @@ -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
);
Expand Down
2 changes: 1 addition & 1 deletion src/Unit/XmlSchemaTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/BaseTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down