From 34a3a0fabdce619fc906d2b8144effcab97b9201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mor=C3=A1vek?= Date: Mon, 3 Dec 2018 21:01:37 +0100 Subject: [PATCH] Remove FakeSessionExtension::register() method, register the extenion in your config (BC break) --- src/DI/FakeSessionExtension.php | 9 --------- tests/KdybyTests/FakeSession/ExtensionTest.phpt | 2 -- tests/KdybyTests/FakeSession/config/disabled.neon | 3 +++ tests/KdybyTests/FakeSession/config/enabled.neon | 3 +++ tests/KdybyTests/nette-reset.neon | 7 ------- 5 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/DI/FakeSessionExtension.php b/src/DI/FakeSessionExtension.php index c6c913f..296b76a 100644 --- a/src/DI/FakeSessionExtension.php +++ b/src/DI/FakeSessionExtension.php @@ -14,8 +14,6 @@ use Kdyby; use Kdyby\FakeSession\Session; -use Nette\Configurator; -use Nette\DI\Compiler; use Nette\Http\Session as NetteSession; class FakeSessionExtension extends \Nette\DI\CompilerExtension @@ -53,11 +51,4 @@ public function beforeCompile(): void } } - public static function register(Configurator $configurator): void - { - $configurator->onCompile[] = function ($config, Compiler $compiler) { - $compiler->addExtension('fakeSession', new FakeSessionExtension()); - }; - } - } diff --git a/tests/KdybyTests/FakeSession/ExtensionTest.phpt b/tests/KdybyTests/FakeSession/ExtensionTest.phpt index 9249585..3152a1e 100644 --- a/tests/KdybyTests/FakeSession/ExtensionTest.phpt +++ b/tests/KdybyTests/FakeSession/ExtensionTest.phpt @@ -11,7 +11,6 @@ declare(strict_types = 1); namespace KdybyTests\FakeSession; use Kdyby; -use Kdyby\FakeSession\DI\FakeSessionExtension; use Kdyby\FakeSession\Session; use Nette\Configurator; use Nette\DI\Container; @@ -31,7 +30,6 @@ class ExtensionTest extends \Tester\TestCase $config->setTempDirectory(TEMP_DIR); $config->addConfig(__DIR__ . '/../nette-reset.neon'); $config->addConfig(__DIR__ . '/config/' . $configName . '.neon'); - FakeSessionExtension::register($config); return $config->createContainer(); } diff --git a/tests/KdybyTests/FakeSession/config/disabled.neon b/tests/KdybyTests/FakeSession/config/disabled.neon index d1848e9..e5743ad 100644 --- a/tests/KdybyTests/FakeSession/config/disabled.neon +++ b/tests/KdybyTests/FakeSession/config/disabled.neon @@ -1,2 +1,5 @@ +extensions: + fakeSession: Kdyby\FakeSession\DI\FakeSessionExtension + fakeSession: enabled: false diff --git a/tests/KdybyTests/FakeSession/config/enabled.neon b/tests/KdybyTests/FakeSession/config/enabled.neon index f5b57be..8b8db15 100644 --- a/tests/KdybyTests/FakeSession/config/enabled.neon +++ b/tests/KdybyTests/FakeSession/config/enabled.neon @@ -1,2 +1,5 @@ +extensions: + fakeSession: Kdyby\FakeSession\DI\FakeSessionExtension + fakeSession: enabled: true diff --git a/tests/KdybyTests/nette-reset.neon b/tests/KdybyTests/nette-reset.neon index 101da82..893f864 100644 --- a/tests/KdybyTests/nette-reset.neon +++ b/tests/KdybyTests/nette-reset.neon @@ -1,12 +1,5 @@ php: date.timezone: Europe/Prague -services: - cacheStorage: - class: Nette\Caching\Storages\MemoryStorage - -http: - frames: null - session: autoStart: false