Skip to content

Instantly share code, notes, and snippets.

@ndamnjanovic
Created October 31, 2013 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndamnjanovic/7247324 to your computer and use it in GitHub Desktop.
Save ndamnjanovic/7247324 to your computer and use it in GitHub Desktop.
Tips when writing tests in Laravel 4
TIP 1: Exception when performing many requests
-----------------------------------------------------------------------------------------------
If you have more than one $this->call() or $this->client->request(), inside one test method,
you may experience problems like:
{"error":{"type":"ErrorException","message":"Undefined variable: header","file":"/*,"line":1}}
or
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
You can solve this problem, if you do $this->client->restart(), before every next request that you're making.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment