68 - Removing the Browser Kit Dependency

This commit is contained in:
Adam Wathan
2017-02-02 16:48:42 -05:00
parent 4f91fbef08
commit 09e1d5a11d
5 changed files with 90 additions and 161 deletions

View File

@@ -7,7 +7,7 @@ use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class PurchaseTicketsTest extends BrowserKitTestCase
class PurchaseTicketsTest extends TestCase
{
use DatabaseMigrations;
@@ -21,10 +21,25 @@ class PurchaseTicketsTest extends BrowserKitTestCase
private function orderTickets($concert, $params)
{
$savedRequest = $this->app['request'];
$this->json('POST', "/concerts/{$concert->id}/orders", $params);
$this->response = $this->json('POST', "/concerts/{$concert->id}/orders", $params);
$this->app['request'] = $savedRequest;
}
private function assertResponseStatus($status)
{
$this->response->assertStatus($status);
}
private function seeJsonSubset($data)
{
$this->response->assertJson($data);
}
private function decodeResponseJson()
{
return $this->response->decodeResponseJson();
}
private function assertValidationError($field)
{
$this->assertResponseStatus(422);