Hey @rephluX
Where in the stack is that error being thrown? Can you post a bit more of the error log for this matter?
In a controller i got something like this
public function download($file)
{
$download = $this->download->getFile($file);
$path = realpath(base_path('resources/downloads')) . $file;
if (!file_exists($path)) {
abort(404);
}
if (!$download->belongsToUser($this->user->id)) {
abort(404);
}
return response()->download($path, $this->getFilename($file), ['content-type' => ' application/pdf']);
}
Right now my test looks something like this:
// ...
$this->actingAs($user1)
->visit('/downloads')
->seePageIs('/downloads')
->see($downloadUser1->name)
->dontSee($downloadUser2->name)
->click($downloadUser1->name)
->seeStatusCode(200);
But for this i got the following error:
InvalidArgumentException: Expecting a DOMNodeList or DOMNode instance, an array, a string, or null, but got "boolean".
I driving my head around how to test this :D Is there any possibility to test the download within an integration test?
Please or to participate in this conversation.