symfony5

Symfony 4.4 deprecation warning for multiple clients in user test is deprecated, still present in documentation

匆匆过客 提交于 2020-08-27 17:04:07
问题 Symfony version(s) affected : 4.4.0 Description After upgrading to Symfony 4.4.0 I got the following deprecation warning: Calling "Symfony\Bundle\FrameworkBundle\Test\WebTestCase::createClient()" while a kernel has been booted is deprecated since Symfony 4.4 and will throw in 5.0, ensure the kernel is shut down before calling the method. However, I do the same as in the documentation (https://symfony.com/doc/current/testing/insulating_clients.html), this also gives the same deprecation

Symfony 5 Api Testing createClient() LogicalException

余生长醉 提交于 2020-08-02 05:25:42
问题 As the title says, I'm building an API with Symfony 5. I have some controllers that require different user permissions that I'd like to test, so I decided to create two users with different roles for testing purpose - ROLE_USER and ROLE_ADMIN . The current code is like this (note, it's not full code, just a dummy example/starting point) ApiTestCase.php <?php namespace App\Tests; use App\Entity\User; use App\Tests\Http\RequestBuilder; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class

Symfony 5 Api Testing createClient() LogicalException

可紊 提交于 2020-08-02 05:23:35
问题 As the title says, I'm building an API with Symfony 5. I have some controllers that require different user permissions that I'd like to test, so I decided to create two users with different roles for testing purpose - ROLE_USER and ROLE_ADMIN . The current code is like this (note, it's not full code, just a dummy example/starting point) ApiTestCase.php <?php namespace App\Tests; use App\Entity\User; use App\Tests\Http\RequestBuilder; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class

How to configure apcu for doctrine in Symfony5

被刻印的时光 ゝ 提交于 2020-06-26 07:26:29
问题 In Symfony4 I was using the following configuration for doctrine apcu caching: doctrine: orm: auto_mapping: true auto_generate_proxy_classes: false metadata_cache_driver: apcu query_cache_driver: apcu result_cache_driver: apcu After upgrading to Symfony5 I am getting an error: Unknown cache of type "apc" configured for cache "metadata_cache" in entity manager "default". When changing the it to the following configuration it works: doctrine: orm: auto_mapping: true auto_generate_proxy_classes:

Symfony can't find secret environment variable

穿精又带淫゛_ 提交于 2020-04-13 10:06:10
问题 I am trying to set up a secret manager in Symfony 5. I followed this Secrets Management Setup course and How to Keep Sensitive Information Secret documentation. My app is now triggering : Fatal Error: Maximum execution time of 30 seconds exceeded Environment variable not found: "DATABASE_URL". As the documentation says, I dropped DATABASE_URL from my .env and used php bin/console secrets:set DATABASE_URL which output : [OK] Sodium keys have been generated at "config/secrets/dev/dev.*.public

Symfony can't find secret environment variable

不羁岁月 提交于 2020-04-13 10:05:36
问题 I am trying to set up a secret manager in Symfony 5. I followed this Secrets Management Setup course and How to Keep Sensitive Information Secret documentation. My app is now triggering : Fatal Error: Maximum execution time of 30 seconds exceeded Environment variable not found: "DATABASE_URL". As the documentation says, I dropped DATABASE_URL from my .env and used php bin/console secrets:set DATABASE_URL which output : [OK] Sodium keys have been generated at "config/secrets/dev/dev.*.public