From e0b8f6f7f7f503e5bd6bc0c8bd400bdaced013b8 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Mon, 22 Jul 2013 13:18:27 +0200 Subject: [PATCH] Add logger to media-alchemyst --- lib/Alchemy/Phrasea/Application.php | 3 +++ tests/Alchemy/Tests/Phrasea/ApplicationTest.php | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index 9949d51475..9f7e32ca4f 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -238,6 +238,9 @@ class Application extends SilexApplication return $configuration; }); + $this['media-alchemyst.logger'] = $this->share(function(Application $app) { + return $app['monolog']; + }); $this->register(new MediaVorusServiceProvider()); $this->register(new MonologServiceProvider()); diff --git a/tests/Alchemy/Tests/Phrasea/ApplicationTest.php b/tests/Alchemy/Tests/Phrasea/ApplicationTest.php index 52372f1a08..458e63b62a 100644 --- a/tests/Alchemy/Tests/Phrasea/ApplicationTest.php +++ b/tests/Alchemy/Tests/Phrasea/ApplicationTest.php @@ -329,6 +329,14 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract } } + public function testThatMediaAlachemystIsRegistered() + { + $app = new Application('test'); + + $this->assertSame($app['monolog'], $app['media-alchemyst.logger']); + $this->assertInstanceOf('MediaAlchemyst\Alchemyst', $app['media-alchemyst']); + } + private function getAppThatReturnLocale() { $app = new Application('test');