Skip to content
This repository was archived by the owner on Jan 18, 2018. It is now read-only.

Commit 2d7a41f

Browse files
Corrected tests
1 parent d230a5d commit 2d7a41f

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

tests/NavigationTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function testGetHTMLNoBar()
201201
);
202202

203203
$navigation->getView()->shouldReceive('make')->once()
204-
->with('view', $data)->andReturn('html goes here');
204+
->with('view', $data)->andReturn($this->getMockedView());
205205

206206
$return = $navigation->render('default', false);
207207

@@ -226,7 +226,7 @@ public function testGetHTMLEmptyBar()
226226
);
227227

228228
$navigation->getView()->shouldReceive('make')->once()
229-
->with('view', $data)->andReturn('html goes here');
229+
->with('view', $data)->andReturn($this->getMockedView());
230230

231231
$return = $navigation->render('default', 'default');
232232

@@ -252,7 +252,7 @@ public function testGetHTMLWithBar()
252252
);
253253

254254
$navigation->getView()->shouldReceive('make')->once()
255-
->with('view', $data)->andReturn('html goes here');
255+
->with('view', $data)->andReturn($this->getMockedView());
256256

257257
$return = $navigation->render('default', 'default');
258258

@@ -295,6 +295,15 @@ protected function getMockedNavigation()
295295
->shouldAllowMockingProtectedMethods();
296296
}
297297

298+
protected function getMockedView()
299+
{
300+
$view = Mockery::mock('Illuminate\View\View');
301+
302+
$view->shouldReceive('render')->once()->andReturn('html goes here');
303+
304+
return $view;
305+
}
306+
298307
protected function callProtected($object, $name, array $args = array())
299308
{
300309
$reflection = new ReflectionClass($object);

0 commit comments

Comments
 (0)