Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v1.0.4 released #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/HttpLoggerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function provideDependencies(Container $container): void
$this->loggerFacade = $loggerFacade;

return $this->createDecorator();
});
}, $this->configuration()->getWeight()
);
}

protected function createDecorator(): HttpFacadeInterface
Expand Down
8 changes: 7 additions & 1 deletion tests/Unit/HttpLoggerPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
namespace Micro\Plugin\Http\Test\Unit;

use Micro\Component\DependencyInjection\Container;
use Micro\Framework\Kernel\Configuration\DefaultApplicationConfiguration;
use Micro\Framework\Kernel\Plugin\DependencyProviderInterface;
use Micro\Plugin\Http\HttpCorePlugin;
use Micro\Plugin\Http\HttpLoggerPlugin;
use Micro\Plugin\Http\HttpLoggerPluginConfiguration;
use Micro\Plugin\Logger\LoggerPlugin;
use PHPUnit\Framework\TestCase;

Expand All @@ -25,6 +27,9 @@ class HttpLoggerPluginTest extends TestCase
protected function setUp(): void
{
$this->plugin = new HttpLoggerPlugin();
$this->plugin->setConfiguration(new HttpLoggerPluginConfiguration(
new DefaultApplicationConfiguration([])
));
}

public function testGetDependedPlugins()
Expand All @@ -46,7 +51,8 @@ public function testProvideDependencies()
$container = $this->createMock(Container::class);
$container
->expects($this->once())
->method('decorate');
->method('decorate')
;

$this->plugin->provideDependencies($container);
}
Expand Down
4 changes: 3 additions & 1 deletion tests/Unit/TestHtpLoggerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

use Micro\Component\DependencyInjection\Container;
use Micro\Framework\Kernel\Plugin\DependencyProviderInterface;
use Micro\Framework\Kernel\Plugin\PluginConfigurationTrait;
use Micro\Framework\Kernel\Plugin\PluginDependedInterface;
use Micro\Plugin\Http\HttpCorePlugin;
use Micro\Plugin\Logger\LoggerPlugin;
Expand All @@ -24,9 +25,10 @@
*/
class TestHtpLoggerPlugin implements DependencyProviderInterface, PluginDependedInterface
{
use PluginConfigurationTrait;

public function provideDependencies(Container $container): void
{
// TODO: Implement provideDependencies() method.
}

public function getDependedPlugins(): iterable
Expand Down