Skip to content

Commit

Permalink
Revert overriding parent construct for Messages.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Dec 22, 2013
1 parent f5aac8e commit 97216c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
16 changes: 0 additions & 16 deletions src/Orchestra/Support/Messages.php
Expand Up @@ -20,22 +20,6 @@ class Messages extends M
*/
protected $instance;

/**
* Create a new message bag instance.
*
* @param array $messages
* @param \Illuminate\Session\Store $session
* @return void
*/
public function __construct(array $messages = array(), SessionStore $session = null)
{
parent::__construct($messages);

if (! is_null($session)) {
$this->setSession($session);
}
}

/**
* Set the session store.
*
Expand Down
10 changes: 5 additions & 5 deletions tests/MessagesTest.php
Expand Up @@ -22,7 +22,7 @@ public function testMakeMethod()
{
$session = m::mock('\Illuminate\Session\Store');

$message = new Messages(array(), $session);
$message = with(new Messages)->setSession($session);
$message->add('welcome', 'Hello world');
$message->setFormat();

Expand All @@ -45,7 +45,7 @@ public function testSaveMethod()
$session = m::mock('\Illuminate\Session\Store');
$session->shouldReceive('flash')->once()->andReturn(true);

with(new Messages(array(), $session))->save();
with(new Messages)->setSession($session)->save();
}

/**
Expand All @@ -60,7 +60,7 @@ public function testStoreMethod()

$session->shouldReceive('flash')->once()->andReturn(true);

$message = new Messages(array(), $session);
$message = with(new Messages)->setSession($session);
$message->add('hello', 'Hi World');
$message->add('bye', 'Goodbye');

Expand Down Expand Up @@ -89,7 +89,7 @@ public function testRetrieveMethod()
->andReturn('a:2:{s:5:"hello";a:1:{i:0;s:8:"Hi World";}s:3:"bye";a:1:{i:0;s:7:"Goodbye";}}')
->shouldReceive('forget')->once()->andReturn(true);

$retrieve = with(new Messages(array(), $session))->retrieve();
$retrieve = with(new Messages)->setSession($session)->retrieve();
$retrieve->setFormat();

$this->assertInstanceOf('\Orchestra\Support\Messages', $retrieve);
Expand All @@ -115,7 +115,7 @@ public function testExtendMethod()
$msg->add('hello', 'Hi Orchestra Platform');
};

$stub = new Messages(array(), $session);
$stub = with(new Messages)->setSession($session);
$stub->extend($callback);

$retrieve = $stub->retrieve();
Expand Down

0 comments on commit 97216c5

Please sign in to comment.