fixed tests
This commit is contained in:
parent
0b344a2ec4
commit
7cefdecd2f
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Initialize;
|
||||
|
||||
use DB;
|
||||
use Zoomyboy\LaravelNami\Api;
|
||||
|
||||
class InitializeActivities
|
||||
{
|
||||
private Api $api;
|
||||
|
||||
public function __construct(Api $api)
|
||||
{
|
||||
$this->api = $api;
|
||||
}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$groupId = $this->api->groups()->first()->id;
|
||||
app(ActivityCreator::class)->createFor($this->api, $groupId);
|
||||
}
|
||||
|
||||
public function restore(): void
|
||||
{
|
||||
DB::table('activity_subactivity')->delete();
|
||||
DB::table('activities')->delete();
|
||||
DB::table('subactivities')->delete();
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@ class Initializer
|
|||
InitializeGroups::class,
|
||||
InitializeNationalities::class,
|
||||
InitializeFees::class,
|
||||
InitializeActivities::class,
|
||||
InitializeConfessions::class,
|
||||
InitializeCountries::class,
|
||||
InitializeGenders::class,
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Access to an undefined property Zoomyboy\\\\LaravelNami\\\\Member\\:\\:\\$first_activity_id\\.$#"
|
||||
count: 1
|
||||
path: packages/laravel-nami/src/Member.php
|
||||
|
||||
-
|
||||
message: "#^Access to an undefined property Zoomyboy\\\\LaravelNami\\\\Member\\:\\:\\$first_subactivity_id\\.$#"
|
||||
count: 1
|
||||
path: packages/laravel-nami/src/Member.php
|
25
phpstan.neon
25
phpstan.neon
|
@ -260,11 +260,6 @@ parameters:
|
|||
count: 1
|
||||
path: app/Member/Member.php
|
||||
|
||||
-
|
||||
message: "#^Job class App\\\\Member\\\\DeleteJob constructor invoked with 2 parameters in App\\\\Member\\\\DeleteJob\\:\\:dispatch\\(\\), 1 required\\.$#"
|
||||
count: 1
|
||||
path: app/Member/MemberController.php
|
||||
|
||||
-
|
||||
message: "#^Property App\\\\Member\\\\MemberController\\:\\:\\$filter type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
|
@ -295,11 +290,6 @@ parameters:
|
|||
count: 1
|
||||
path: app/Membership/MembershipResource.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Membership\\\\Requests\\\\StoreRequest\\:\\:rules\\(\\) return type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
path: app/Membership/Requests/StoreRequest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Payment\\\\PaymentResource\\:\\:toArray\\(\\) return type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
|
@ -464,11 +454,6 @@ parameters:
|
|||
count: 1
|
||||
path: tests/Feature/Pdf/GenerateTest.php
|
||||
|
||||
-
|
||||
message: "#^Method Tests\\\\TestCase\\:\\:assertErrors\\(\\) has parameter \\$errors with no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
path: tests/TestCase.php
|
||||
|
||||
-
|
||||
message: "#^PHPDoc tag @param has invalid value \\(\\<class\\-string\\> \\$class\\)\\: Unexpected token \"\\<\", expected type at offset 18$#"
|
||||
count: 1
|
||||
|
@ -1153,3 +1138,13 @@ parameters:
|
|||
message: "#^Property Zoomyboy\\\\LaravelNami\\\\Tests\\\\Unit\\\\PushMemberTest\\:\\:\\$attributes type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
path: packages/laravel-nami/tests/Unit/PushMemberTest.php
|
||||
|
||||
-
|
||||
message: "#^Access to an undefined property Zoomyboy\\\\LaravelNami\\\\Member\\:\\:\\$first_activity_id\\.$#"
|
||||
count: 1
|
||||
path: packages/laravel-nami/src/Member.php
|
||||
|
||||
-
|
||||
message: "#^Access to an undefined property Zoomyboy\\\\LaravelNami\\\\Member\\:\\:\\$first_subactivity_id\\.$#"
|
||||
count: 1
|
||||
path: packages/laravel-nami/src/Member.php
|
||||
|
|
|
@ -110,8 +110,8 @@ class IndexTest extends TestCase
|
|||
$response = $this->get('/member');
|
||||
|
||||
$this->assertInertiaHas([
|
||||
'activity' => $member->memberships->first()->activity_id,
|
||||
'subactivity' => $member->memberships->first()->subactivity_id,
|
||||
'activity_id' => $member->memberships->first()->activity_id,
|
||||
'subactivity_id' => $member->memberships->first()->subactivity_id,
|
||||
'activity_name' => '€ Mitglied',
|
||||
'subactivity_name' => 'Wölfling',
|
||||
'human_date' => '02.11.2022',
|
||||
|
|
|
@ -127,7 +127,7 @@ class StoreTest extends TestCase
|
|||
$nationality = Nationality::factory()->create();
|
||||
$subscription = Subscription::factory()->create();
|
||||
$billKind = BillKind::factory()->create();
|
||||
$activity = Activity::factory()->create();
|
||||
$activity = Activity::factory()->create(['name' => '€ Mitglied']);
|
||||
$subactivity = Subactivity::factory()->create();
|
||||
|
||||
$response = $this
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
namespace Tests\Feature\Member;
|
||||
|
||||
use App\Activity;
|
||||
use App\Confession;
|
||||
use App\Country;
|
||||
use App\Enum\Activity;
|
||||
use App\Enum\Subactivity;
|
||||
use App\Fee;
|
||||
use App\Group;
|
||||
use App\Member\Actions\NamiPutMemberAction;
|
||||
use App\Member\Member;
|
||||
use App\Nationality;
|
||||
use App\Payment\Subscription;
|
||||
use App\Subactivity;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Tests\TestCase;
|
||||
|
|
Loading…
Reference in New Issue