M
M
My joy2017-08-10 14:29:11
PHPUnit
My joy, 2017-08-10 14:29:11

Laravel + PHPUnit: how to submit a file in API tests?

hello fellow friends!
I found the following implementation in the description of laravel testing:

public function testApplication()
{
    $response = $this->call('POST', '/url', ['param' => 'value']);
    $this->assertEquals(200, $response->status());
}

How can I send a file this way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-08-10
@t-alexashka

https://laravel.com/docs/5.4/dusk#attaching-files
https://laravel.com/docs/5.4/http-tests#testing-fi...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question