Skip to content

Commit

Permalink
Missing phpspec tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrzej Kupczyk committed Aug 1, 2015
1 parent 5a445e7 commit 7bdd717
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/spec/Bootstrapper/FormSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,24 +198,19 @@ function it_overrides_the_submit_method()
function it_can_get_validation_errors()
{
$messageBag = Mockery::mock('Illuminate\\Support\\MessageBag', function($mock) {
$mock->shouldReceive('has')->with('foo')->twice()->andReturn(true);
$mock->shouldReceive('has')->with('foo')->andReturn(true);
$mock->shouldReceive('first')->once()->andReturn('bar');
});
$session = Mockery::mock('Illuminate\\Session\\Store', function($mock) use ($messageBag) {
$mock->shouldReceive('has')->with('errors')->twice()->andReturn(true);
$mock->shouldReceive('get')->with('errors')->times(3)->andReturn($messageBag);
$mock->shouldReceive('has')->with('errors')->andReturn(true);
$mock->shouldReceive('get')->with('errors')->andReturn($messageBag);
});

$this->setSessionStore($session);

$this->hasErrors('foo')->shouldBe(true);
$this->getFormattedError('foo')->shouldBe('bar');
}

function letgo()
{
Mockery::close();
}
}

class Foo
Expand Down

0 comments on commit 7bdd717

Please sign in to comment.