Skip to content

Instantly share code, notes, and snippets.

@mercuryseries
Created August 7, 2016 03:43
Show Gist options
  • Save mercuryseries/2d11a77a14a20d0ee51fddd7a6a8713f to your computer and use it in GitHub Desktop.
Save mercuryseries/2d11a77a14a20d0ee51fddd7a6a8713f to your computer and use it in GitHub Desktop.
Some test method helpers for the Laravel Framework
<?php
trait MakeHttpRequests
{
/**
* Visit the given route with a GET request.
*
* @param string $uri
* @param array $headers
* @return $this
*/
public function visitRoute($route_name)
{
return $this->visit(route($route_name));
}
/**
* Visit the given route with a GET request.
*
* @param string $uri
* @param array $headers
* @return $this
*/
public function getRoute($route_name)
{
return $this->get(route($route_name));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment