Skip to content

Commit

Permalink
Merge 4.x into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI authored Dec 17, 2023
2 parents 3c2c756 + a2a6d6f commit dad8612
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ jobs:
- php-version: '8.2'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.2.*
variant: symfony/symfony:"6.2.*"
symfony-require: 6.3.*
variant: symfony/symfony:"6.3.*"
- php-version: '8.2'
dependencies: highest
allowed-to-fail: false
symfony-require: 6.3.*
variant: symfony/symfony:"6.3.*"
symfony-require: 6.4.*
variant: symfony/symfony:"6.4.*"

steps:
- name: Checkout
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"twig/twig": "^3.0"
},
"require-dev": {
"doctrine/data-fixtures": "^1.4",
"doctrine/data-fixtures": "^1.6",
"friendsofphp/php-cs-fixer": "^3.4",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
Expand All @@ -56,11 +56,12 @@
"psalm/plugin-phpunit": "^0.18",
"psalm/plugin-symfony": "^5.0",
"rector/rector": "^0.18",
"sonata-project/block-bundle": "^4.2",
"sonata-project/block-bundle": "^4.2 || ^5.0",
"symfony/browser-kit": "^5.4 || ^6.2",
"symfony/css-selector": "^5.4 || ^6.2",
"symfony/panther": "^2.0.1",
"symfony/phpunit-bridge": "^6.2",
"symfony/twig-bridge": "^5.4 || ^6.2",
"vimeo/psalm": "^5.7"
},
"conflict": {
Expand Down
2 changes: 0 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

use Rector\Config\RectorConfig;
use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector;
use Rector\Php71\Rector\FuncCall\CountOnNullRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
Expand All @@ -41,7 +40,6 @@
$rectorConfig->importNames();
$rectorConfig->importShortClasses(false);
$rectorConfig->skip([
CountOnNullRector::class,
ExceptionHandlerTypehintRector::class,
AddSeeTestAnnotationRector::class,
PreferPHPUnitThisCallRector::class,
Expand Down
5 changes: 2 additions & 3 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ protected function configureRoutes(RoutingConfigurator $routes): void
$routes->import(sprintf('%s/config/routes.yaml', $this->getProjectDir()));
}

/**
* @psalm-suppress DeprecatedClass
*/
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$loader->load(__DIR__.'/config/config.yaml');

if (!class_exists(IsGranted::class)) {
$loader->load(__DIR__.'/config/config_symfony_v5.yaml');
} else {
$loader->load(__DIR__.'/config/config_symfony_v6.yaml');
}

if (class_exists(HttpCacheHandler::class)) {
Expand Down
8 changes: 2 additions & 6 deletions tests/App/DataFixtures/MongoDB/BookFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,11 @@ final class BookFixtures extends Fixture implements DependentFixtureInterface
{
public function load(ObjectManager $manager): void
{
$author = $this->getReference(AuthorFixtures::AUTHOR);

\assert($author instanceof Author);
$author = $this->getReference(AuthorFixtures::AUTHOR, Author::class);

$book = new Book('book_id', 'Don Quixote', $author);

$category = $this->getReference(CategoryFixtures::CATEGORY);

\assert($category instanceof Category);
$category = $this->getReference(CategoryFixtures::CATEGORY, Category::class);

$book->addCategory($category);

Expand Down
5 changes: 5 additions & 0 deletions tests/App/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ doctrine_mongodb:
dir: "%kernel.project_dir%/Document"
is_bundle: false
prefix: Sonata\DoctrineMongoDBAdminBundle\Tests\App\Document

sonata_admin:
options:
html5_validate: false
use_stickyforms: false
11 changes: 11 additions & 0 deletions tests/App/config/config_symfony_v6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
framework:
annotations: false
handle_all_throwables: true
php_errors:
log: true
session:
cookie_secure: auto
cookie_samesite: lax
handler_id: null
validation:
email_validation_mode: html5
2 changes: 1 addition & 1 deletion tests/Functional/BasePantherTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ abstract class BasePantherTestCase extends PantherTestCase
protected function setUp(): void
{
$this->client = static::createPantherClient([
'browser' => PantherTestCase::CHROME,
'browser' => PantherTestCase::FIREFOX,
'connection_timeout_in_ms' => 5000,
'request_timeout_in_ms' => 60000,
]);
Expand Down

0 comments on commit dad8612

Please sign in to comment.