-
-
Save Tjoosten/da3e709f915493899ca4c23135d7b6a3 to your computer and use it in GitHub Desktop.
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
dd(session()->all); | |
Output: | |
"_token" => "EytBe27yGOdW9C831i6fbMobTlshjVSfqghnpcJa" | |
"flash_notification" => Illuminate\Support\Collection {#25879 | |
#items: array:1 [ | |
0 => Laracasts\Flash\Message {#25864 | |
+title: null | |
+message: "De verhuring is verwijderd." | |
+level: "info" | |
+important: false | |
+overlay: false | |
} | |
] | |
} | |
"_flash" => array:2 [ | |
"new" => [] | |
"old" => array:1 [ | |
0 => "flash_notification" | |
] | |
] | |
"_previous" => array:1 [ | |
"url" => "http://localhost/verhuur/verwijder/1" | |
] | |
] | |
// test case: | |
/** | |
* try to delete a valid lease. | |
* | |
* @test | |
* @group all | |
*/ | |
public function testLeaseDelete() | |
{ | |
$user = factory(User::class)->create(); | |
$lease = factory(Lease::class)->create(); | |
$this->actingAs($user) | |
->seeIsAuthenticatedAs($user) | |
->get(route('lease.delete', ['id' => $lease->id])) | |
->assertStatus(302) | |
->assertSessionHas([ | |
'message' => trans('lease.flash-lease-delete') | |
]); | |
} | |
// test output: | |
There was 1 failure: | |
1) Tests\Feature\LeaseTest::testLeaseDelete | |
Failed asserting that null matches expected 'De verhuring is verwijderd.'. | |
R:\Clients\SIJOT\sijot-current\vendor\laravel\framework\src\Illuminate\Foundation\Testing\TestResponse.php:501 | |
R:\Clients\SIJOT\sijot-current\vendor\laravel\framework\src\Illuminate\Foundation\Testing\TestResponse.php:519 | |
R:\Clients\SIJOT\sijot-current\vendor\laravel\framework\src\Illuminate\Foundation\Testing\TestResponse.php:492 | |
R:\Clients\SIJOT\sijot-current\tests\Feature\LeaseTest.php:113 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment