Skip to content

Commit

Permalink
Remove FakeSessionExtension::register() method, register the extenion…
Browse files Browse the repository at this point in the history
… in your config (BC break)
  • Loading branch information
xificurk committed Apr 4, 2019
1 parent 25bf516 commit 34a3a0f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/DI/FakeSessionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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());
};
}

}
2 changes: 0 additions & 2 deletions tests/KdybyTests/FakeSession/ExtensionTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down
3 changes: 3 additions & 0 deletions tests/KdybyTests/FakeSession/config/disabled.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
extensions:
fakeSession: Kdyby\FakeSession\DI\FakeSessionExtension

fakeSession:
enabled: false
3 changes: 3 additions & 0 deletions tests/KdybyTests/FakeSession/config/enabled.neon
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
extensions:
fakeSession: Kdyby\FakeSession\DI\FakeSessionExtension

fakeSession:
enabled: true
7 changes: 0 additions & 7 deletions tests/KdybyTests/nette-reset.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
php:
date.timezone: Europe/Prague

services:
cacheStorage:
class: Nette\Caching\Storages\MemoryStorage

http:
frames: null

session:
autoStart: false

0 comments on commit 34a3a0f

Please sign in to comment.