You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
json2db/tests/Feature/Upload/UploadJsonTest.php

31 lines
725 B

<?php
namespace Tests\Feature\Upload;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Testing\File;
use Tests\TestCase;
class UploadJsonTest extends TestCase
{
/**
* upload json file.
*
* @return void
* @group upload
* @group json
*/
public function test_example()
{
$content = file_get_contents(base_path('/tests/Storage/Feature/Upload/UploadJsonTest.json'));
$file = File::createWithContent(
'test.json',
$content
);
$this->post('/api/v1/upload/json', [
'file' => $file,
'format' => 'json'
])->assertSuccessful();
}
}