Lint Member ShowTest
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
7b54d29345
commit
ef4cf07647
|
@ -9,29 +9,23 @@ use App\Gender;
|
|||
use App\Group;
|
||||
use App\Invoice\Models\Invoice;
|
||||
use App\Invoice\Models\InvoicePosition;
|
||||
use App\Member\Data\MembershipData;
|
||||
use App\Member\Member;
|
||||
use App\Member\Membership;
|
||||
use App\Nationality;
|
||||
use App\Payment\Subscription;
|
||||
use App\Region;
|
||||
use Carbon\Carbon;
|
||||
use Generator;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShowTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
uses(DatabaseTransactions::class);
|
||||
covers(MembershipData::class);
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
beforeEach(function () {
|
||||
Country::factory()->create(['name' => 'Deutschland']);
|
||||
}
|
||||
});
|
||||
|
||||
public function testItShowsSingleMember(): void
|
||||
{
|
||||
it('testItShowsSingleMember', function () {
|
||||
Carbon::setTestNow(Carbon::parse('2006-01-01 15:00:00'));
|
||||
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
|
@ -147,10 +141,9 @@ class ShowTest extends TestCase
|
|||
'status' => 'Neu',
|
||||
]
|
||||
], $response, 'data.invoicePositions.0');
|
||||
}
|
||||
});
|
||||
|
||||
public function testItShowsMinimalSingleMember(): void
|
||||
{
|
||||
it('testItShowsMinimalSingleMember', function () {
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
$member = Member::factory()
|
||||
->for(Group::factory())
|
||||
|
@ -176,18 +169,9 @@ class ShowTest extends TestCase
|
|||
'multiply_pv' => false,
|
||||
'multiply_more_pv' => false,
|
||||
], $response, 'data');
|
||||
}
|
||||
});
|
||||
|
||||
public static function membershipDataProvider(): Generator
|
||||
{
|
||||
yield [now()->subMonths(2), null, true];
|
||||
yield [now()->subMonths(2), now()->subDay(), false];
|
||||
yield [now()->addDays(2), null, false];
|
||||
}
|
||||
|
||||
#[DataProvider('membershipDataProvider')]
|
||||
public function testItShowsIfMembershipIsActive(Carbon $from, ?Carbon $to, bool $isActive): void
|
||||
{
|
||||
it('testItShowsIfMembershipIsActive', function (Carbon $from, ?Carbon $to, bool $isActive) {
|
||||
$this->withoutExceptionHandling()->login()->loginNami();
|
||||
$member = Member::factory()
|
||||
->defaults()
|
||||
|
@ -197,5 +181,8 @@ class ShowTest extends TestCase
|
|||
$response = $this->get("/member/{$member->id}");
|
||||
|
||||
$this->assertInertiaHas($isActive, $response, 'data.memberships.0.is_active');
|
||||
}
|
||||
}
|
||||
})->with([
|
||||
[now()->subMonths(2), null, true],
|
||||
[now()->subMonths(2), now()->subDay(), false],
|
||||
[now()->addDays(2), null, false],
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue