2.0 RC 1 - new ConfigurationService (#3810)
* use html5 email validation * remove static cache seed, for compatibility with non default (file based) caches * added caching ConfigurationService, removed use of doctrine result cache * simplify configuration API
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Configuration\ConfigurationService;
|
||||
use App\DataFixtures\UserFixtures;
|
||||
use App\Entity\Configuration;
|
||||
use App\Entity\User;
|
||||
use App\Form\Type\DateRangeType;
|
||||
use App\Repository\ConfigurationRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use App\Tests\KernelTestTrait;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
@@ -89,9 +89,10 @@ abstract class ControllerBaseTest extends WebTestCase
|
||||
|
||||
protected function setSystemConfiguration(string $name, $value): void
|
||||
{
|
||||
$repository = self::getContainer()->get(ConfigurationRepository::class);
|
||||
/** @var ConfigurationService $repository */
|
||||
$repository = self::getContainer()->get(ConfigurationService::class);
|
||||
|
||||
$entity = $repository->findOneBy(['name' => $name]);
|
||||
$entity = $repository->getConfiguration($name);
|
||||
if ($entity === null) {
|
||||
$entity = new Configuration();
|
||||
$entity->setName($name);
|
||||
@@ -103,9 +104,9 @@ abstract class ControllerBaseTest extends WebTestCase
|
||||
|
||||
protected function clearConfigCache()
|
||||
{
|
||||
/** @var ConfigurationRepository $repository */
|
||||
$repository = self::getContainer()->get(ConfigurationRepository::class);
|
||||
$repository->clearCache();
|
||||
/** @var ConfigurationService $service */
|
||||
$service = self::getContainer()->get(ConfigurationService::class);
|
||||
$service->clearCache();
|
||||
}
|
||||
|
||||
protected function getClientForAuthenticatedUser(string $role = User::ROLE_USER): HttpKernelBrowser
|
||||
|
||||
Reference in New Issue
Block a user