Skip to content

Commit

Permalink
Merge pull request #26 from mikedfunk/laravel-4_1-fix
Browse files Browse the repository at this point in the history
Fixed breaking issue with non-file-based Session drivers
  • Loading branch information
edvinaskrucas committed Jun 15, 2014
2 parents 490e12e + 5dca880 commit 60f6cc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Krucas/Notification/NotificationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
10 changes: 5 additions & 5 deletions src/Krucas/Notification/Subscriber.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php namespace Krucas\Notification;

use Illuminate\Config\Repository;
use Illuminate\Session\Store;
use Illuminate\Session\SessionManager;

class Subscriber
{
Expand All @@ -15,7 +15,7 @@ class Subscriber
/**
* Session instance for flashing messages.
*
* @var \Illuminate\Session\Store
* @var \Illuminate\Session\SessionManager
*/
protected $session;

Expand All @@ -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;
Expand All @@ -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()
{
Expand Down
10 changes: 5 additions & 5 deletions tests/SubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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]');

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 60f6cc1

Please sign in to comment.