Created
March 18, 2016 14:29
-
-
Save jonnybarnes/0dce2f0aec1c67fe4e55 to your computer and use it in GitHub Desktop.
Cookie test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Tests; | |
use TestCase; | |
use Illuminate\Foundation\Testing\WithoutMiddleware; | |
use Illuminate\Foundation\Testing\DatabaseMigrations; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
class ExampleTest extends TestCase | |
{ | |
public function testCookies() | |
{ | |
$response = $this->call( | |
'GET', | |
'/cookies', | |
[/* parameters */], | |
['hello' => 'world'] | |
); | |
var_dump($response); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::group(['middleware' => 'web'], function () { | |
Route::get('/real/route', 'ProperController@iWantToTest'); | |
Route::get('/cookies', function () { | |
return 'Cookie: ' . Request::cookie('hello'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment