0

I am trying to test some laravel controllers but am not doing so well so far. I am meant to be using PHPSpec to do this. I have no idea where to start and I am meant to be testing the crud functionality of the controller. I understand how I might be able to do this, but really do not understand how I can translate this into a PHPSpec test.

   public function show($id)
   {
         $temp = $this->users->find($id);

         return Response::json($this->users->find($id));
   }

For example, how would I be able to test this method using PHPSpec? Would it be as simple as assertions? Many Thanks in advance.

csc
  • 59
  • 2
  • 7

1 Answers1

0

I don't think that you should use phpspec to test this. phpspec is primarily a tool for designing your object's API, and its interactions with other objects. For testing a controller you would probably want to do a more integrated test, and I think phpunit is more suited to this task.

shanethehat
  • 15,460
  • 11
  • 57
  • 87