This commit is contained in:
Milos Holba
2020-11-13 19:02:08 +01:00
parent 1c62da4e7c
commit 382756a6f0
10 changed files with 218 additions and 82 deletions

View File

@@ -1,21 +0,0 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$response = $this->get('/');
$response->assertStatus(200);
}
}

59
tests/Unit/BulkdTest.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
namespace Tests\Unit;
use App\User;
// use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\TestCase;
use App\FileManagerFile;
use Laravel\Passport\Passport;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Testing\RefreshDatabase;
class BulkTest extends TestCase
{
// use DatabaseMigrations;
use RefreshDatabase;
/**
* @test
*/
public function bulk_delete_user ()
{
$this->withoutExceptionHandling();
$data ='{
"data": [
{
"force_delete": false,
"type": "file",
"unique_id": 0
},
{
"force_delete": false,
"type": "file",
"unique_id": 1
},
{
"force_delete": false,
"type": "file",
"unique_id": 2
}
]
}';
$user = factory(User::class)->create();
factory(FileManagerFile::class, 3)->create();
$this->assertDatabaseCount('file_manager_files', 3);
$this->actingAs($user)->withoutMiddleware()->json('POST','/api/remove-item', json_decode($data , true))
->assertStatus(201);
// $this->assertDatabaseCount('file_manager_files', 3);
}
}

View File

@@ -1,18 +0,0 @@
<?php
namespace Tests\Unit;
use PHPUnit\Framework\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
}