Switch to DatabaseTransactions

This commit is contained in:
philipp lang 2022-02-12 01:08:56 +01:00
parent cb3ec60c59
commit 08445cc97a
9 changed files with 18 additions and 18 deletions

View File

@ -5,7 +5,7 @@ namespace Tests\Feature\Course;
use App\Course\Models\Course; use App\Course\Models\Course;
use App\Course\Models\CourseMember; use App\Course\Models\CourseMember;
use App\Member\Member; use App\Member\Member;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase; use Tests\TestCase;
use Zoomyboy\LaravelNami\Backend\FakeBackend; use Zoomyboy\LaravelNami\Backend\FakeBackend;
@ -14,7 +14,7 @@ use Zoomyboy\LaravelNami\Fakes\CourseFake;
class DeleteTest extends TestCase class DeleteTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
public function testItDeletesACourse(): void public function testItDeletesACourse(): void
{ {

View File

@ -4,7 +4,7 @@ namespace Tests\Feature\Course;
use App\Course\Models\Course; use App\Course\Models\Course;
use App\Member\Member; use App\Member\Member;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase; use Tests\TestCase;
use Zoomyboy\LaravelNami\Backend\FakeBackend; use Zoomyboy\LaravelNami\Backend\FakeBackend;
@ -13,7 +13,7 @@ use Zoomyboy\LaravelNami\Fakes\CourseFake;
class StoreTest extends TestCase class StoreTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
/** /**
* @return array<string, array{payload: array<string, mixed>, errors: array<string, mixed>}> * @return array<string, array{payload: array<string, mixed>, errors: array<string, mixed>}>

View File

@ -5,7 +5,7 @@ namespace Tests\Feature\Course;
use App\Course\Models\Course; use App\Course\Models\Course;
use App\Course\Models\CourseMember; use App\Course\Models\CourseMember;
use App\Member\Member; use App\Member\Member;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase; use Tests\TestCase;
use Zoomyboy\LaravelNami\Backend\FakeBackend; use Zoomyboy\LaravelNami\Backend\FakeBackend;
@ -14,7 +14,7 @@ use Zoomyboy\LaravelNami\Fakes\CourseFake;
class UpdateTest extends TestCase class UpdateTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
/** /**
* @return array<string, array{payload: array<string, mixed>, errors: array<string, mixed>}> * @return array<string, array{payload: array<string, mixed>, errors: array<string, mixed>}>

View File

@ -11,7 +11,7 @@ use App\Member\Member;
use App\Nationality; use App\Nationality;
use App\Setting\GeneralSettings; use App\Setting\GeneralSettings;
use App\Subactivity; use App\Subactivity;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
@ -21,7 +21,7 @@ use Zoomyboy\LaravelNami\Backend\FakeBackend;
class InitializeTest extends TestCase class InitializeTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
public function initializeProvider(callable $callback = null): void public function initializeProvider(callable $callback = null): void
{ {

View File

@ -5,14 +5,14 @@ namespace Tests\Feature\Member;
use App\Course\Models\Course; use App\Course\Models\Course;
use App\Course\Models\CourseMember; use App\Course\Models\CourseMember;
use App\Member\Member; use App\Member\Member;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase; use Tests\TestCase;
use Zoomyboy\LaravelNami\Backend\FakeBackend; use Zoomyboy\LaravelNami\Backend\FakeBackend;
class IndexTest extends TestCase class IndexTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
public function testItGetsMembers(): void public function testItGetsMembers(): void
{ {

View File

@ -3,7 +3,7 @@
namespace Tests\Feature; namespace Tests\Feature;
use App\Setting\GeneralSettings; use App\Setting\GeneralSettings;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
@ -14,7 +14,7 @@ use Zoomyboy\LaravelNami\Backend\FakeBackend;
class NamiLoginTest extends TestCase class NamiLoginTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
public function setUp(): void public function setUp(): void
{ {

View File

@ -14,7 +14,7 @@ use App\Pdf\PdfRepositoryFactory;
use Carbon\Carbon; use Carbon\Carbon;
use Database\Factories\Member\MemberFactory; use Database\Factories\Member\MemberFactory;
use Database\Factories\Payment\PaymentFactory; use Database\Factories\Payment\PaymentFactory;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Storage; use Storage;
use Tests\TestCase; use Tests\TestCase;
@ -22,7 +22,7 @@ use Tests\TestCase;
class GenerateTest extends TestCase class GenerateTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
public function setUp(): void public function setUp(): void
{ {

View File

@ -3,14 +3,14 @@
namespace Tests\Feature\Settings; namespace Tests\Feature\Settings;
use App\Setting\GeneralSettings; use App\Setting\GeneralSettings;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase; use Tests\TestCase;
class GlobalSettingTest extends TestCase class GlobalSettingTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
public function testItLoadsGeneralSettings(): void public function testItLoadsGeneralSettings(): void
{ {

View File

@ -4,7 +4,7 @@ namespace Tests\Feature;
use App\Setting\GeneralSettings; use App\Setting\GeneralSettings;
use App\User; use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Hash;
@ -16,7 +16,7 @@ use Zoomyboy\LaravelNami\Backend\FakeBackend;
class UserLoginTest extends TestCase class UserLoginTest extends TestCase
{ {
use RefreshDatabase; use DatabaseTransactions;
public function setUp(): void public function setUp(): void
{ {