55use PhpSpec \ObjectBehavior ;
66use Prophecy \Argument ;
77
8- use Peterjmit \BlogBundle \Model \ BlogManagerInterface ;
8+ use Peterjmit \BlogBundle \Doctrine \ BlogRepository ;
99
1010use Symfony \Bundle \FrameworkBundle \Templating \EngineInterface ;
1111use Symfony \Component \HttpFoundation \Response ;
1212
1313class BlogControllerSpec extends ObjectBehavior
1414{
1515 function let (
16- BlogManagerInterface $ manager ,
16+ BlogRepository $ repository ,
1717 EngineInterface $ templating
1818 ) {
19- $ this ->beConstructedWith ($ manager , $ templating );
19+ $ this ->beConstructedWith ($ repository , $ templating );
2020 }
2121
2222 function it_is_initializable ()
@@ -25,11 +25,11 @@ function it_is_initializable()
2525 }
2626
2727 function it_should_respond_to_index_action (
28- BlogManagerInterface $ manager ,
28+ BlogRepository $ repository ,
2929 EngineInterface $ templating ,
3030 Response $ mockResponse
3131 ) {
32- $ manager ->findAll ()->willReturn (array ('An array ' , 'of blog ' , 'posts! ' ));
32+ $ repository ->findAll ()->willReturn (array ('An array ' , 'of blog ' , 'posts! ' ));
3333
3434 $ templating
3535 ->renderResponse (
@@ -45,11 +45,11 @@ function it_should_respond_to_index_action(
4545 }
4646
4747 function it_shows_a_single_blog_post (
48- BlogManagerInterface $ manager ,
48+ BlogRepository $ repository ,
4949 EngineInterface $ templating ,
5050 Response $ response
5151 ) {
52- $ manager ->find (1 )->willReturn ('A blog post ' );
52+ $ repository ->find (1 )->willReturn ('A blog post ' );
5353
5454 $ templating
5555 ->renderResponse (
@@ -62,9 +62,9 @@ function it_shows_a_single_blog_post(
6262 $ this ->showAction (1 )->shouldReturn ($ response );
6363 }
6464
65- function it_throws_an_exception_if_a_blog_post_doesnt_exist (BlogManagerInterface $ manager )
65+ function it_throws_an_exception_if_a_blog_post_doesnt_exist (BlogRepository $ repository )
6666 {
67- $ manager ->find (999 )->willReturn (null );
67+ $ repository ->find (999 )->willReturn (null );
6868
6969 $ this
7070 ->shouldThrow ('Symfony\Component\HttpKernel\Exception\NotFoundHttpException ' )
0 commit comments