Skip to content

Commit

Permalink
[8.x] Adds docs regarding dd, ddHeaders, ddSession (#7395)
Browse files Browse the repository at this point in the history
* Adds docs regarding `dd`, `ddHeaders`, `ddSession`

* Update http-tests.md

Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
nunomaduro and taylorotwell authored Oct 26, 2021
1 parent 02a3ade commit 473a7fb
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions http-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ After making a test request to your application, the `dump`, `dumpHeaders`, and

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Tests\TestCase;

class ExampleTest extends TestCase
Expand All @@ -208,6 +206,33 @@ After making a test request to your application, the `dump`, `dumpHeaders`, and
}
}

Alternatively, you may use the `dd`, `ddHeaders`, and `ddSession` methods to dump information about the response and then stop execution:

<?php

namespace Tests\Feature;

use Tests\TestCase;

class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function test_basic_test()
{
$response = $this->get('/');

$response->ddHeaders();

$response->ddSession();

$response->dd();
}
}

<a name="exception-handling"></a>
### Exception Handling

Expand Down

0 comments on commit 473a7fb

Please sign in to comment.