From dba27becbdee24e1764efc2a502cb07fcc08f6c0 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Thu, 14 Sep 2023 07:31:22 +0300 Subject: [PATCH 1/2] Fix bridges tests --- phpunit.xml | 3 ++ src/Bridge/Dotenv/tests/LoadTest.php | 42 ++++++++++--------- .../tests/{BaseTest.php => BaseTestCase.php} | 2 +- src/Bridge/Monolog/tests/FactoryTest.php | 18 ++++++-- src/Bridge/Monolog/tests/HandlersTest.php | 8 +++- src/Bridge/Monolog/tests/LoggerTest.php | 8 +++- src/Bridge/Monolog/tests/ProcessorsTest.php | 8 +++- .../Monolog/tests/RotateHandlerTest.php | 8 +++- src/Bridge/Monolog/tests/TraitTest.php | 8 +++- .../tests/{BaseTest.php => BaseTestCase.php} | 2 +- src/Bridge/Stempler/tests/CacheTest.php | 3 +- src/Bridge/Stempler/tests/ConfigTest.php | 2 +- src/Bridge/Stempler/tests/DirectiveTest.php | 2 +- src/Bridge/Stempler/tests/EngineTest.php | 2 +- src/Bridge/Stempler/tests/FormatTest.php | 2 +- .../Processor/NullLocaleProcessorTest.php | 4 +- 16 files changed, 85 insertions(+), 37 deletions(-) rename src/Bridge/Monolog/tests/{BaseTest.php => BaseTestCase.php} (90%) rename src/Bridge/Stempler/tests/{BaseTest.php => BaseTestCase.php} (98%) diff --git a/phpunit.xml b/phpunit.xml index 7cac51242..dc968835d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -25,6 +25,9 @@ src/*/tests + + src/Bridge/*/tests + tests diff --git a/src/Bridge/Dotenv/tests/LoadTest.php b/src/Bridge/Dotenv/tests/LoadTest.php index 8cfc0ebca..2df83802c 100644 --- a/src/Bridge/Dotenv/tests/LoadTest.php +++ b/src/Bridge/Dotenv/tests/LoadTest.php @@ -7,7 +7,6 @@ use Mockery as m; use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; use PHPUnit\Framework\TestCase; -use Spiral\Boot\AbstractKernel; use Spiral\Boot\Directories; use Spiral\Boot\EnvironmentInterface; use Spiral\DotEnv\Bootloader\DotenvBootloader; @@ -16,33 +15,38 @@ final class LoadTest extends TestCase { use MockeryPHPUnitIntegration; - public function testUseKernelCallback(): void + public function testSetValue(): void { - $d = new Directories(['root' => __DIR__.'/']); + $dirs = new Directories(['root' => __DIR__.'/']); - $e = m::mock(EnvironmentInterface::class); - $e->shouldReceive('get')->once()->withSomeOfArgs('DOTENV_PATH')->andReturn($d->get('root').'.env.custom'); - $e->shouldReceive('set')->once()->with('KEY', 'custom_value'); - - $k = m::mock(AbstractKernel::class); - $k->shouldReceive('running')->once()->andReturnUsing(fn(\Closure $callback) => $callback($e)); + $env = m::mock(EnvironmentInterface::class); + $env + ->shouldReceive('get') + ->once() + ->withSomeOfArgs('DOTENV_PATH') + ->andReturn($dirs->get('root') . '.env.custom'); + $env->shouldReceive('set') + ->once()->with('KEY', 'custom_value'); $b = new DotenvBootloader(); - $b->init($k, $d); + $b->init($dirs, $env); } public function testNotFound(): void { - $d = new Directories(['root' => __DIR__.'/']); - - $e = m::mock(EnvironmentInterface::class); - $e->shouldReceive('get')->once()->withSomeOfArgs('DOTENV_PATH')->andReturn($d->get('root').'.env'); - $e->shouldNotReceive('set')->with('KEY', 'custom_value'); - - $k = m::mock(AbstractKernel::class); - $k->shouldReceive('running')->once()->andReturnUsing(fn(\Closure $callback) => $callback($e)); + $dirs = new Directories(['root' => __DIR__.'/']); + + $env = m::mock(EnvironmentInterface::class); + $env + ->shouldReceive('get') + ->once() + ->withSomeOfArgs('DOTENV_PATH') + ->andReturn($dirs->get('root').'.env'); + $env + ->shouldNotReceive('set') + ->with('KEY', 'custom_value'); $b = new DotenvBootloader(); - $b->init($k, $d); + $b->init($dirs, $env); } } diff --git a/src/Bridge/Monolog/tests/BaseTest.php b/src/Bridge/Monolog/tests/BaseTestCase.php similarity index 90% rename from src/Bridge/Monolog/tests/BaseTest.php rename to src/Bridge/Monolog/tests/BaseTestCase.php index 129a98576..21690cfdb 100644 --- a/src/Bridge/Monolog/tests/BaseTest.php +++ b/src/Bridge/Monolog/tests/BaseTestCase.php @@ -9,7 +9,7 @@ use Spiral\Boot\EnvironmentInterface; use Spiral\Core\Container; -abstract class BaseTest extends TestCase +abstract class BaseTestCase extends TestCase { protected Container $container; diff --git a/src/Bridge/Monolog/tests/FactoryTest.php b/src/Bridge/Monolog/tests/FactoryTest.php index 141b8778d..aadd21fa6 100644 --- a/src/Bridge/Monolog/tests/FactoryTest.php +++ b/src/Bridge/Monolog/tests/FactoryTest.php @@ -10,6 +10,10 @@ use Monolog\Processor\ProcessorInterface; use Monolog\ResettableInterface; use Psr\Log\LoggerInterface; +use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; +use Spiral\Boot\BootloadManager\Initializer; +use Spiral\Boot\BootloadManager\InitializerInterface; +use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\Finalizer; use Spiral\Boot\FinalizerInterface; @@ -23,10 +27,18 @@ use Spiral\Monolog\Config\MonologConfig; use Spiral\Monolog\LogFactory; -class FactoryTest extends BaseTest +class FactoryTest extends BaseTestCase { use MockeryPHPUnitIntegration; + protected function setUp(): void + { + parent::setUp(); + + $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); + $this->container->bind(InitializerInterface::class, Initializer::class); + } + public function testDefaultLogger(): void { $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(),$this->container); @@ -108,8 +120,8 @@ public function load(string $section): array ] ]), new ListenerRegistry(), $this->container); - $handler->shouldReceive('reset')->once(); - $processor->shouldReceive('reset')->once(); + $handler->shouldReceive('reset')->twice(); + $processor->shouldReceive('reset')->twice(); $this->container->bind(LogFactory::class, $factory); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); diff --git a/src/Bridge/Monolog/tests/HandlersTest.php b/src/Bridge/Monolog/tests/HandlersTest.php index d7fd61bad..f234ae5c0 100644 --- a/src/Bridge/Monolog/tests/HandlersTest.php +++ b/src/Bridge/Monolog/tests/HandlersTest.php @@ -6,6 +6,10 @@ use Monolog\Handler\NullHandler; use Monolog\Logger; +use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; +use Spiral\Boot\BootloadManager\Initializer; +use Spiral\Boot\BootloadManager\InitializerInterface; +use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -19,7 +23,7 @@ use Spiral\Monolog\Config\MonologConfig; use Spiral\Monolog\Exception\ConfigException; -class HandlersTest extends BaseTest +class HandlersTest extends BaseTestCase { public function setUp(): void { @@ -42,6 +46,8 @@ public function load(string $section): array } )); $this->container->bindSingleton(ListenerRegistryInterface::class, new ListenerRegistry()); + $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); + $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); } diff --git a/src/Bridge/Monolog/tests/LoggerTest.php b/src/Bridge/Monolog/tests/LoggerTest.php index bee001296..e90a912f7 100644 --- a/src/Bridge/Monolog/tests/LoggerTest.php +++ b/src/Bridge/Monolog/tests/LoggerTest.php @@ -8,6 +8,10 @@ use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; use Monolog\Logger; use Psr\Log\LoggerInterface; +use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; +use Spiral\Boot\BootloadManager\Initializer; +use Spiral\Boot\BootloadManager\InitializerInterface; +use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\Finalizer; use Spiral\Boot\FinalizerInterface; @@ -18,7 +22,7 @@ use Spiral\Monolog\Bootloader\MonologBootloader; use Spiral\Monolog\LogFactory; -class LoggerTest extends BaseTest +class LoggerTest extends BaseTestCase { use MockeryPHPUnitIntegration; @@ -46,6 +50,8 @@ public function load(string $section): array $injector->shouldReceive('createInjection')->once()->andReturn($logger); + $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); + $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); $this->container->get(LoggerInterface::class); diff --git a/src/Bridge/Monolog/tests/ProcessorsTest.php b/src/Bridge/Monolog/tests/ProcessorsTest.php index 251c5ae76..accd2d125 100644 --- a/src/Bridge/Monolog/tests/ProcessorsTest.php +++ b/src/Bridge/Monolog/tests/ProcessorsTest.php @@ -5,6 +5,10 @@ namespace Spiral\Tests\Monolog; use Monolog\Processor\PsrLogMessageProcessor; +use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; +use Spiral\Boot\BootloadManager\Initializer; +use Spiral\Boot\BootloadManager\InitializerInterface; +use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -17,7 +21,7 @@ use Spiral\Monolog\Config\MonologConfig; use Spiral\Monolog\Exception\ConfigException; -class ProcessorsTest extends BaseTest +class ProcessorsTest extends BaseTestCase { public function setUp(): void { @@ -40,6 +44,8 @@ public function load(string $section): array } )); $this->container->bindSingleton(ListenerRegistryInterface::class, new ListenerRegistry()); + $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); + $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); } diff --git a/src/Bridge/Monolog/tests/RotateHandlerTest.php b/src/Bridge/Monolog/tests/RotateHandlerTest.php index 93414111c..f5eddba48 100644 --- a/src/Bridge/Monolog/tests/RotateHandlerTest.php +++ b/src/Bridge/Monolog/tests/RotateHandlerTest.php @@ -6,6 +6,10 @@ use Monolog\Handler\RotatingFileHandler; use Monolog\Logger; +use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; +use Spiral\Boot\BootloadManager\Initializer; +use Spiral\Boot\BootloadManager\InitializerInterface; +use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -14,7 +18,7 @@ use Spiral\Core\Container; use Spiral\Monolog\Bootloader\MonologBootloader; -class RotateHandlerTest extends BaseTest +class RotateHandlerTest extends BaseTestCase { public function testRotateHandler(): void { @@ -34,6 +38,8 @@ public function load(string $section): array } } )); + $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); + $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); $autowire = new Container\Autowire('log.rotate', [ diff --git a/src/Bridge/Monolog/tests/TraitTest.php b/src/Bridge/Monolog/tests/TraitTest.php index 02ac018e0..383fd4407 100644 --- a/src/Bridge/Monolog/tests/TraitTest.php +++ b/src/Bridge/Monolog/tests/TraitTest.php @@ -6,6 +6,10 @@ use Monolog\Logger; use Psr\Log\NullLogger; +use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; +use Spiral\Boot\BootloadManager\Initializer; +use Spiral\Boot\BootloadManager\InitializerInterface; +use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -18,7 +22,7 @@ use Spiral\Monolog\Bootloader\MonologBootloader; use Spiral\Monolog\Config\MonologConfig; -class TraitTest extends BaseTest +class TraitTest extends BaseTestCase { use LoggerTrait; @@ -61,6 +65,8 @@ public function load(string $section): array } } )); + $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); + $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); $this->container->bind(MonologConfig::class, new MonologConfig()); $this->container->bind(ListenerRegistryInterface::class, new ListenerRegistry()); diff --git a/src/Bridge/Stempler/tests/BaseTest.php b/src/Bridge/Stempler/tests/BaseTestCase.php similarity index 98% rename from src/Bridge/Stempler/tests/BaseTest.php rename to src/Bridge/Stempler/tests/BaseTestCase.php index 0856e342d..aea9908c8 100644 --- a/src/Bridge/Stempler/tests/BaseTest.php +++ b/src/Bridge/Stempler/tests/BaseTestCase.php @@ -25,7 +25,7 @@ use Spiral\Views\ViewManager; use Spiral\Views\ViewsInterface; -abstract class BaseTest extends TestCase +abstract class BaseTestCase extends TestCase { public const BOOTLOADERS = [ StemplerBootloader::class, diff --git a/src/Bridge/Stempler/tests/CacheTest.php b/src/Bridge/Stempler/tests/CacheTest.php index 9c53df7bf..fbe7f535d 100644 --- a/src/Bridge/Stempler/tests/CacheTest.php +++ b/src/Bridge/Stempler/tests/CacheTest.php @@ -5,12 +5,11 @@ namespace Spiral\Tests\Stempler; use Spiral\Config\ConfiguratorInterface; -use Spiral\Config\PatchInterface; use Spiral\Files\Files; use Spiral\Files\FilesInterface; use Spiral\Views\ViewContext; -class CacheTest extends BaseTest +class CacheTest extends BaseTestCase { /** @var FilesInterface */ protected $files; diff --git a/src/Bridge/Stempler/tests/ConfigTest.php b/src/Bridge/Stempler/tests/ConfigTest.php index ac3ad5ac4..bdd5a14ee 100644 --- a/src/Bridge/Stempler/tests/ConfigTest.php +++ b/src/Bridge/Stempler/tests/ConfigTest.php @@ -16,7 +16,7 @@ use Spiral\Stempler\Directive\RouteDirective; use Spiral\Views\Processor\ContextProcessor; -class ConfigTest extends BaseTest +class ConfigTest extends BaseTestCase { public function testWireConfigString(): void { diff --git a/src/Bridge/Stempler/tests/DirectiveTest.php b/src/Bridge/Stempler/tests/DirectiveTest.php index a84dd8a50..aaaef7128 100644 --- a/src/Bridge/Stempler/tests/DirectiveTest.php +++ b/src/Bridge/Stempler/tests/DirectiveTest.php @@ -8,7 +8,7 @@ use Spiral\Views\Exception\RenderException; use Spiral\Views\ViewContext; -class DirectiveTest extends BaseTest +class DirectiveTest extends BaseTestCase { public function testRenderDirectiveEx(): void { diff --git a/src/Bridge/Stempler/tests/EngineTest.php b/src/Bridge/Stempler/tests/EngineTest.php index 61060f6b7..6db7352b2 100644 --- a/src/Bridge/Stempler/tests/EngineTest.php +++ b/src/Bridge/Stempler/tests/EngineTest.php @@ -9,7 +9,7 @@ use Spiral\Views\Exception\RenderException; use Spiral\Views\ViewContext; -class EngineTest extends BaseTest +class EngineTest extends BaseTestCase { public function testList(): void { diff --git a/src/Bridge/Stempler/tests/FormatTest.php b/src/Bridge/Stempler/tests/FormatTest.php index b88bac850..2e18720dd 100644 --- a/src/Bridge/Stempler/tests/FormatTest.php +++ b/src/Bridge/Stempler/tests/FormatTest.php @@ -6,7 +6,7 @@ use Spiral\Views\ViewContext; -class FormatTest extends BaseTest +class FormatTest extends BaseTestCase { public function testFormatDiv(): void { diff --git a/src/Bridge/Stempler/tests/Processor/NullLocaleProcessorTest.php b/src/Bridge/Stempler/tests/Processor/NullLocaleProcessorTest.php index c5333b38b..44e1a1e1f 100644 --- a/src/Bridge/Stempler/tests/Processor/NullLocaleProcessorTest.php +++ b/src/Bridge/Stempler/tests/Processor/NullLocaleProcessorTest.php @@ -4,10 +4,10 @@ namespace Spiral\Tests\Stempler\Processor; -use Spiral\Tests\Stempler\BaseTest; +use Spiral\Tests\Stempler\BaseTestCase; use Spiral\Views\ViewContext; -final class NullLocaleProcessorTest extends BaseTest +final class NullLocaleProcessorTest extends BaseTestCase { public function testProcess(): void { From a2334cf278ad2583cf5224b03508ab3c822980f3 Mon Sep 17 00:00:00 2001 From: Maxim Smakouz Date: Thu, 14 Sep 2023 08:39:57 +0300 Subject: [PATCH 2/2] Improve code --- src/Bridge/Monolog/tests/BaseTestCase.php | 6 ++++++ src/Bridge/Monolog/tests/FactoryTest.php | 12 ------------ src/Bridge/Monolog/tests/HandlersTest.php | 6 ------ src/Bridge/Monolog/tests/LoggerTest.php | 6 ------ src/Bridge/Monolog/tests/ProcessorsTest.php | 6 ------ src/Bridge/Monolog/tests/RotateHandlerTest.php | 6 ------ src/Bridge/Monolog/tests/TraitTest.php | 6 ------ 7 files changed, 6 insertions(+), 42 deletions(-) diff --git a/src/Bridge/Monolog/tests/BaseTestCase.php b/src/Bridge/Monolog/tests/BaseTestCase.php index 21690cfdb..a6441dc4a 100644 --- a/src/Bridge/Monolog/tests/BaseTestCase.php +++ b/src/Bridge/Monolog/tests/BaseTestCase.php @@ -7,6 +7,10 @@ use PHPUnit\Framework\TestCase; use Spiral\Boot\Environment; use Spiral\Boot\EnvironmentInterface; +use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; +use Spiral\Boot\BootloadManager\Initializer; +use Spiral\Boot\BootloadManager\InitializerInterface; +use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Core\Container; abstract class BaseTestCase extends TestCase @@ -17,5 +21,7 @@ protected function setUp(): void { $this->container = new Container(); $this->container->bind(EnvironmentInterface::class, new Environment()); + $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); + $this->container->bind(InitializerInterface::class, Initializer::class); } } diff --git a/src/Bridge/Monolog/tests/FactoryTest.php b/src/Bridge/Monolog/tests/FactoryTest.php index aadd21fa6..62a538e50 100644 --- a/src/Bridge/Monolog/tests/FactoryTest.php +++ b/src/Bridge/Monolog/tests/FactoryTest.php @@ -10,10 +10,6 @@ use Monolog\Processor\ProcessorInterface; use Monolog\ResettableInterface; use Psr\Log\LoggerInterface; -use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; -use Spiral\Boot\BootloadManager\Initializer; -use Spiral\Boot\BootloadManager\InitializerInterface; -use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\Finalizer; use Spiral\Boot\FinalizerInterface; @@ -31,14 +27,6 @@ class FactoryTest extends BaseTestCase { use MockeryPHPUnitIntegration; - protected function setUp(): void - { - parent::setUp(); - - $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); - $this->container->bind(InitializerInterface::class, Initializer::class); - } - public function testDefaultLogger(): void { $factory = new LogFactory(new MonologConfig([]), new ListenerRegistry(),$this->container); diff --git a/src/Bridge/Monolog/tests/HandlersTest.php b/src/Bridge/Monolog/tests/HandlersTest.php index f234ae5c0..2d00effa4 100644 --- a/src/Bridge/Monolog/tests/HandlersTest.php +++ b/src/Bridge/Monolog/tests/HandlersTest.php @@ -6,10 +6,6 @@ use Monolog\Handler\NullHandler; use Monolog\Logger; -use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; -use Spiral\Boot\BootloadManager\Initializer; -use Spiral\Boot\BootloadManager\InitializerInterface; -use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -46,8 +42,6 @@ public function load(string $section): array } )); $this->container->bindSingleton(ListenerRegistryInterface::class, new ListenerRegistry()); - $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); - $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); } diff --git a/src/Bridge/Monolog/tests/LoggerTest.php b/src/Bridge/Monolog/tests/LoggerTest.php index e90a912f7..338204af2 100644 --- a/src/Bridge/Monolog/tests/LoggerTest.php +++ b/src/Bridge/Monolog/tests/LoggerTest.php @@ -8,10 +8,6 @@ use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration; use Monolog\Logger; use Psr\Log\LoggerInterface; -use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; -use Spiral\Boot\BootloadManager\Initializer; -use Spiral\Boot\BootloadManager\InitializerInterface; -use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\Finalizer; use Spiral\Boot\FinalizerInterface; @@ -50,8 +46,6 @@ public function load(string $section): array $injector->shouldReceive('createInjection')->once()->andReturn($logger); - $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); - $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); $this->container->get(LoggerInterface::class); diff --git a/src/Bridge/Monolog/tests/ProcessorsTest.php b/src/Bridge/Monolog/tests/ProcessorsTest.php index accd2d125..8948edbf7 100644 --- a/src/Bridge/Monolog/tests/ProcessorsTest.php +++ b/src/Bridge/Monolog/tests/ProcessorsTest.php @@ -5,10 +5,6 @@ namespace Spiral\Tests\Monolog; use Monolog\Processor\PsrLogMessageProcessor; -use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; -use Spiral\Boot\BootloadManager\Initializer; -use Spiral\Boot\BootloadManager\InitializerInterface; -use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -44,8 +40,6 @@ public function load(string $section): array } )); $this->container->bindSingleton(ListenerRegistryInterface::class, new ListenerRegistry()); - $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); - $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); } diff --git a/src/Bridge/Monolog/tests/RotateHandlerTest.php b/src/Bridge/Monolog/tests/RotateHandlerTest.php index f5eddba48..9ad6bc145 100644 --- a/src/Bridge/Monolog/tests/RotateHandlerTest.php +++ b/src/Bridge/Monolog/tests/RotateHandlerTest.php @@ -6,10 +6,6 @@ use Monolog\Handler\RotatingFileHandler; use Monolog\Logger; -use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; -use Spiral\Boot\BootloadManager\Initializer; -use Spiral\Boot\BootloadManager\InitializerInterface; -use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -38,8 +34,6 @@ public function load(string $section): array } } )); - $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); - $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); $autowire = new Container\Autowire('log.rotate', [ diff --git a/src/Bridge/Monolog/tests/TraitTest.php b/src/Bridge/Monolog/tests/TraitTest.php index 383fd4407..57cb374ad 100644 --- a/src/Bridge/Monolog/tests/TraitTest.php +++ b/src/Bridge/Monolog/tests/TraitTest.php @@ -6,10 +6,6 @@ use Monolog\Logger; use Psr\Log\NullLogger; -use Spiral\Boot\BootloadManager\DefaultInvokerStrategy; -use Spiral\Boot\BootloadManager\Initializer; -use Spiral\Boot\BootloadManager\InitializerInterface; -use Spiral\Boot\BootloadManager\InvokerStrategyInterface; use Spiral\Boot\BootloadManager\StrategyBasedBootloadManager; use Spiral\Boot\FinalizerInterface; use Spiral\Config\ConfigManager; @@ -65,8 +61,6 @@ public function load(string $section): array } } )); - $this->container->bind(InvokerStrategyInterface::class, DefaultInvokerStrategy::class); - $this->container->bind(InitializerInterface::class, Initializer::class); $this->container->get(StrategyBasedBootloadManager::class)->bootload([MonologBootloader::class]); $this->container->bind(MonologConfig::class, new MonologConfig()); $this->container->bind(ListenerRegistryInterface::class, new ListenerRegistry());