firstWhere('key', $key); } it('reports the stripe key of the active mode as missing', function () { OperatingMode::set(OperatingMode::Test); expect(checkFor('billing.stripe_secret')->satisfied)->toBeFalse(); expect(checkFor('billing.stripe_secret')->severity)->toBe(Check::SEVERITY_BLOCKING); }); it('reports it as satisfied once the key of that mode is stored', function () { OperatingMode::set(OperatingMode::Test); app(SecretVault::class)->put('stripe.secret', 'sk_test_x', Operator::factory()->create(), OperatingMode::Test); expect(checkFor('billing.stripe_secret')->satisfied)->toBeTrue(); }); it('does not accept a live key as proof while the test mode is active', function () { // Sonst meldete die Seite Bereitschaft für einen Modus, in dem die Kasse // sperrt — die Seite widerspräche der Sperre aus Task 5. OperatingMode::set(OperatingMode::Test); app(SecretVault::class)->put('stripe.secret', 'sk_live_x', Operator::factory()->create(), OperatingMode::Live); expect(checkFor('billing.stripe_secret')->satisfied)->toBeFalse(); }); it('reports incomplete company details without repeating the list', function () { Settings::forget('company.name'); expect(checkFor('billing.company_details')->satisfied)->toBeFalse(); }); it('names what breaks, not just what is missing', function () { expect(checkFor('billing.company_details')->breaks)->not->toBe(''); }); it('says the installation is not ready while something blocking is open', function () { expect(Readiness::isReady())->toBeFalse(); expect(Readiness::blocking())->not->toBeEmpty(); });