66
77class ViewTest extends PHPUnit_Framework_TestCase {
88
9- public function __construct ()
9+ public function tearDown ()
1010 {
1111 m::close ();
1212 }
@@ -58,7 +58,6 @@ public function testRenderSectionsReturnsEnvironmentSections()
5858 ));
5959
6060 $ view ->shouldReceive ('render ' )->with (m::type ('Closure ' ))->once ()->andReturn ($ sections = array ('foo ' => 'bar ' ));
61- $ view ->getFactory ()->shouldReceive ('getSections ' )->once ()->andReturn ($ sections );
6261
6362 $ this ->assertEquals ($ sections , $ view ->renderSections ());
6463 }
@@ -67,12 +66,12 @@ public function testRenderSectionsReturnsEnvironmentSections()
6766 public function testSectionsAreNotFlushedWhenNotDoneRendering ()
6867 {
6968 $ view = $ this ->getView ();
70- $ view ->getFactory ()->shouldReceive ('incrementRender ' )->once ();
71- $ view ->getFactory ()->shouldReceive ('callComposer ' )->once ()->with ($ view );
72- $ view ->getFactory ()->shouldReceive ('getShared ' )->once ()->andReturn (array ('shared ' => 'foo ' ));
73- $ view ->getEngine ()->shouldReceive ('get ' )->once ()->with ('path ' , array ('foo ' => 'bar ' , 'shared ' => 'foo ' ))->andReturn ('contents ' );
74- $ view ->getFactory ()->shouldReceive ('decrementRender ' )->once ();
75- $ view ->getFactory ()->shouldReceive ('flushSectionsIfDoneRendering ' )->once ();
69+ $ view ->getFactory ()->shouldReceive ('incrementRender ' )->twice ();
70+ $ view ->getFactory ()->shouldReceive ('callComposer ' )->twice ()->with ($ view );
71+ $ view ->getFactory ()->shouldReceive ('getShared ' )->twice ()->andReturn (array ('shared ' => 'foo ' ));
72+ $ view ->getEngine ()->shouldReceive ('get ' )->twice ()->with ('path ' , array ('foo ' => 'bar ' , 'shared ' => 'foo ' ))->andReturn ('contents ' );
73+ $ view ->getFactory ()->shouldReceive ('decrementRender ' )->twice ();
74+ $ view ->getFactory ()->shouldReceive ('flushSectionsIfDoneRendering ' )->twice ();
7675
7776 $ this ->assertEquals ('contents ' , $ view ->render ());
7877 $ this ->assertEquals ('contents ' , (string ) $ view );
@@ -166,7 +165,7 @@ public function testViewGatherDataWithRenderable()
166165
167166 $ view ->renderable = m::mock ('Illuminate\Support\Contracts\RenderableInterface ' );
168167 $ view ->renderable ->shouldReceive ('render ' )->once ()->andReturn ('text ' );
169- $ view ->render ();
168+ $ this -> assertEquals ( ' contents ' , $ view ->render () );
170169 }
171170
172171
0 commit comments