Skip to content

Commit

Permalink
merged branch 2.7.x into master
Browse files Browse the repository at this point in the history
  • Loading branch information
craue committed Aug 22, 2023
2 parents 2887285 + 5e80694 commit ac08159
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ jobs:
if: github.repository == 'craue/CraueConfigBundle'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: PHP ${{ matrix.php }} - ${{ matrix.dependencies || format('Symfony {0}', matrix.symfony) }}
run: |
unset SYMFONY_REQUIRE
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
7 changes: 6 additions & 1 deletion Tests/Controller/SettingsControllerIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Craue\ConfigBundle\Tests\IntegrationTestBundle\Entity\CanBeDisabledSetting;
use Craue\ConfigBundle\Tests\IntegrationTestBundle\Entity\CustomSetting;
use Craue\ConfigBundle\Tests\IntegrationTestCase;
use Composer\InstalledVersions;
use Composer\Semver\VersionParser;

/**
* @group integration
Expand Down Expand Up @@ -42,7 +44,10 @@ public function testModifyAction_noChanges($platform, $config, $requiredExtensio
$this->assertSame(200, static::$client->getResponse()->getStatusCode(), $content);
$this->assertMatchesRegularExpression('/<form .*method="post" .*class="craue_config_settings_modify".*>/', $content);
$this->assertStringContainsString('<label for="craue_config_modifySettings_settings_name_value">name</label>', $content);
$this->assertStringContainsString('<input type="text" id="craue_config_modifySettings_settings_name_value" name="craue_config_modifySettings[settings][name][value]" value="value" />', $content);
// TODO clean up as soon as Symfony >= 6.4 is required, see https://github.com/symfony/symfony/pull/47715
// (and remove composer/semver dependency)
$this->assertStringContainsString(sprintf('<input type="text" id="craue_config_modifySettings_settings_name_value" name="craue_config_modifySettings[settings][name][value]" value="value"%s>',
InstalledVersions::satisfies(new VersionParser(), 'symfony/form', '<6.4') ? ' /' : ''), $content);
$this->assertStringContainsString('<button type="submit">apply</button>', $content);

$form = $crawler->selectButton('apply')->form();
Expand Down
21 changes: 19 additions & 2 deletions Tests/config/config_hacks.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]);
}

// TODO put back into config.yml as soon as Symfony >= 5.3 is required, see https://github.com/symfony/symfony/blob/5.x/UPGRADE-5.3.md#frameworkbundle
// TODO put back into config.yml as soon as Symfony >= 5.3 is required, see https://github.com/symfony/symfony/blob/5.3/UPGRADE-5.3.md#frameworkbundle
$container->loadFromExtension('framework', [
'session' => Kernel::VERSION_ID >= 50300 ? [
'storage_factory_id' => 'session.storage.factory.mock_file',
Expand All @@ -33,7 +33,24 @@
]);
}

// TODO remove as soon as Symfony >= 7 is required
// TODO remove as soon as Symfony >= 7 is required, see https://github.com/symfony/symfony/blob/6.4/UPGRADE-6.4.md#frameworkbundle
if (Kernel::VERSION_ID >= 60400 && Kernel::VERSION_ID < 70000) {
$container->loadFromExtension('framework', [
'handle_all_throwables' => true,
'php_errors' => [
'log' => true,
],
'session' => [
'cookie_secure' => 'auto',
'cookie_samesite' => 'lax',
],
'validation' => [
'email_validation_mode' => 'html5',
],
]);
}

// TODO remove as soon as Symfony >= 7 is required, see https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.1.md#frameworkbundle
if (Kernel::VERSION_ID < 70000) {
$container->loadFromExtension('framework', [
'http_method_override' => false,
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"symfony/validator": "^4.4 || ^5.4 || ^6.3"
},
"require-dev": {
"composer/semver": "^3.0",
"craue/translations-tests": "^1.0",
"doctrine/orm": "^2.5.14",
"phpstan/extension-installer": "^1.1",
Expand Down

0 comments on commit ac08159

Please sign in to comment.