Skip to content

Commit

Permalink
Remove some deprecations in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Dec 16, 2023
1 parent 244cc5c commit a2a6d6f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 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 Down
2 changes: 2 additions & 0 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa

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
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

0 comments on commit a2a6d6f

Please sign in to comment.