From 5dca88001ed84bb65417de2ffa1cab99d96948a7 Mon Sep 17 00:00:00 2001 From: Mike Funk <mike@mikefunk.com> Date: Wed, 28 May 2014 18:49:32 -0700 Subject: [PATCH] changed dependency injection to SessionManager, updated tests. --- .../Notification/NotificationServiceProvider.php | 2 +- src/Krucas/Notification/Subscriber.php | 10 +++++----- tests/SubscriberTest.php | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Krucas/Notification/NotificationServiceProvider.php b/src/Krucas/Notification/NotificationServiceProvider.php index e30f786..58ccd90 100644 --- a/src/Krucas/Notification/NotificationServiceProvider.php +++ b/src/Krucas/Notification/NotificationServiceProvider.php @@ -47,7 +47,7 @@ public function register() }); $this->app->bind('Krucas\Notification\Subscriber', function ($app) { - return new Subscriber($app['session.store'], $app['config']); + return new Subscriber($app['session'], $app['config']); }); $this->app['events']->subscribe('Krucas\Notification\Subscriber'); diff --git a/src/Krucas/Notification/Subscriber.php b/src/Krucas/Notification/Subscriber.php index a4d7b85..63f40b8 100644 --- a/src/Krucas/Notification/Subscriber.php +++ b/src/Krucas/Notification/Subscriber.php @@ -1,7 +1,7 @@ <?php namespace Krucas\Notification; use Illuminate\Config\Repository; -use Illuminate\Session\Store; +use Illuminate\Session\SessionManager; class Subscriber { @@ -15,7 +15,7 @@ class Subscriber /** * Session instance for flashing messages. * - * @var \Illuminate\Session\Store + * @var \Illuminate\Session\SessionManager */ protected $session; @@ -29,10 +29,10 @@ class Subscriber /** * Create new subscriber. * - * @param \Illuminate\Session\Store $session + * @param \Illuminate\Session\SessionManager $session * @param \Illuminate\Config\Repository $config */ - public function __construct(Store $session, Repository $config) + public function __construct(SessionManager $session, Repository $config) { $this->session = $session; $this->config = $config; @@ -41,7 +41,7 @@ public function __construct(Store $session, Repository $config) /** * Get session instance. * - * @return \Illuminate\Session\Store + * @return \Illuminate\Session\SessionManager */ public function getSession() { diff --git a/tests/SubscriberTest.php b/tests/SubscriberTest.php index 6ea4318..62501ac 100644 --- a/tests/SubscriberTest.php +++ b/tests/SubscriberTest.php @@ -14,7 +14,7 @@ public function tearDown() public function testIsConstructed() { $subscriber = $this->getSubscriber(); - $this->assertInstanceOf('Illuminate\Session\Store', $subscriber->getSession()); + $this->assertInstanceOf('Illuminate\Session\SessionManager', $subscriber->getSession()); $this->assertInstanceOf('Illuminate\Config\Repository', $subscriber->getConfig()); } @@ -70,7 +70,7 @@ public function testGenerateDifferentKeysForSameMessages() public function testOnFlash() { - $session = $this->getSessionStore(); + $session = $this->getSessionManager(); $config = $this->getConfigRepository(); $subscriber = m::mock('SubscriberMock[flashContainerNames,generateMessageKey,getSession,getConfig]'); @@ -114,13 +114,13 @@ public function testOnBoot() protected function getSubscriber() { - $subscriber = new SubscriberMock($this->getSessionStore(), $this->getConfigRepository()); + $subscriber = new SubscriberMock($this->getSessionManager(), $this->getConfigRepository()); return $subscriber; } - protected function getSessionStore() + protected function getSessionManager() { - return m::mock('Illuminate\Session\Store'); + return m::mock('Illuminate\Session\SessionManager'); } protected function getConfigRepository()