How to inject symfony2 container in ControllerSpecification for specking the controller

243 views
Skip to first unread message

Silviu Constantin Voicu

unread,
Jul 24, 2013, 12:55:19 PM7/24/13
to phpsp...@googlegroups.com
Hello,

I know that maybe my question could be an old one, because is refferring to phpspec/phpspec2 and https://github.com/everzet/fullstack-bdd-sflive2012/
but I said that because is not yet a new version for phpspec/phpspec and phpspec/prophecy, I wanted to understand better the old version I order to be able to make one for the new version of phpspec with prophecy.

I left the code as it is, when I run phpspec run spec/Bossa/Bundle/TrainingBundle/Controller, well in fact in my local project but which has the same code, I get notice undefined property coursesController and controller, 3 example (3 broken)

If in return in the function it_should_respond_to_list_action_call I choose to have  $response = $this->object->listAction();

then I have trouble with container which is null  and therefore I have: Fatal error: Call to a member function has() on a non-object in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php 

Thank you.
Reply all
Reply to author
Forward
0 new messages