<?php

namespace Tests\Common\Http\Controllers\Qiniu;

use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Modules\Common\Http\Controllers\Qiniu\ImageUploadController;
use PHPUnit\Framework\TestCase;
use Tests\UsedTestCase;

class ImageUploadControllerTest extends UsedTestCase
{

    public function testUpload()
    {
        Storage::fake('avatars');

        $file = UploadedFile::fake()->image('avatar.jpg');

        $response = $this->withHeaders([
            'Authorization' => 'Bearer '. $this->token,
        ])->post('/api/qiniu/upload/image', [
            'photo' => $file,
        ]);

        $response->dump();
    }
}
