File manager - Edit - /var/www/html/spdc/api/tests/Feature/GeneralTest.php
Back
<?php namespace Tests\Feature; use Tests\BaseTest; use App\Models\Form; use App\Models\Field; use App\Models\Category; use Illuminate\Http\JsonResponse; use AluisioPires\LaravelBaseTest\BaseTestTransactions; class GeneralTest extends BaseTest { public function test_image_base_64() { $base64Data = base64_encode(file_get_contents('files/gatinhu.jpeg')); // creating a text occurrency $response = $this->authRequest( 'post', route('test.upload'), JsonResponse::HTTP_OK, [ 'file' => 'data:image/jpeg;base64,' . $base64Data, ] ); } public function test_pdf_base_64() { $base64Data = base64_encode(file_get_contents('files/file.pdf')); // creating a text occurrency $response = $this->authRequest( 'post', route('test.upload'), JsonResponse::HTTP_OK, [ 'file' => 'data:file/pdf;base64,' . $base64Data, ] ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.13 |
proxy
|
phpinfo
|
Settings