5
5
use PhpSpec \ObjectBehavior ;
6
6
use Prophecy \Argument ;
7
7
8
- use Peterjmit \BlogBundle \Model \ BlogManagerInterface ;
8
+ use Peterjmit \BlogBundle \Doctrine \ BlogRepository ;
9
9
10
10
use Symfony \Bundle \FrameworkBundle \Templating \EngineInterface ;
11
11
use Symfony \Component \HttpFoundation \Response ;
12
12
13
13
class BlogControllerSpec extends ObjectBehavior
14
14
{
15
15
function let (
16
- BlogManagerInterface $ manager ,
16
+ BlogRepository $ repository ,
17
17
EngineInterface $ templating
18
18
) {
19
- $ this ->beConstructedWith ($ manager , $ templating );
19
+ $ this ->beConstructedWith ($ repository , $ templating );
20
20
}
21
21
22
22
function it_is_initializable ()
@@ -25,11 +25,11 @@ function it_is_initializable()
25
25
}
26
26
27
27
function it_should_respond_to_index_action (
28
- BlogManagerInterface $ manager ,
28
+ BlogRepository $ repository ,
29
29
EngineInterface $ templating ,
30
30
Response $ mockResponse
31
31
) {
32
- $ manager ->findAll ()->willReturn (array ('An array ' , 'of blog ' , 'posts! ' ));
32
+ $ repository ->findAll ()->willReturn (array ('An array ' , 'of blog ' , 'posts! ' ));
33
33
34
34
$ templating
35
35
->renderResponse (
@@ -45,11 +45,11 @@ function it_should_respond_to_index_action(
45
45
}
46
46
47
47
function it_shows_a_single_blog_post (
48
- BlogManagerInterface $ manager ,
48
+ BlogRepository $ repository ,
49
49
EngineInterface $ templating ,
50
50
Response $ response
51
51
) {
52
- $ manager ->find (1 )->willReturn ('A blog post ' );
52
+ $ repository ->find (1 )->willReturn ('A blog post ' );
53
53
54
54
$ templating
55
55
->renderResponse (
@@ -62,9 +62,9 @@ function it_shows_a_single_blog_post(
62
62
$ this ->showAction (1 )->shouldReturn ($ response );
63
63
}
64
64
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 )
66
66
{
67
- $ manager ->find (999 )->willReturn (null );
67
+ $ repository ->find (999 )->willReturn (null );
68
68
69
69
$ this
70
70
->shouldThrow ('Symfony\Component\HttpKernel\Exception\NotFoundHttpException ' )
0 commit comments