addConnection([ 'driver' => 'sqlite', 'database' => ':memory:', ], 'default'); $capsule->setAsGlobal(); $capsule->bootEloquent(); $capsule->getConnection('default')->getSchemaBuilder() ->create('configurations', static function (Blueprint $table): void { $table->increments('id'); $table->string('name')->unique(); $table->string('value')->nullable(); }); $assert( CloudPaidIpChangeFeature::visible(), 'A missing visibility row must preserve the existing tenant entry.' ); Capsule::table('configurations')->insert([ 'name' => CloudPaidIpChangeFeature::CONFIG_KEY, 'value' => 'false', ]); $assert( !CloudPaidIpChangeFeature::visible(), 'The disabled visibility row did not hide the tenant feature.' ); try { CloudPaidIpChangeFeature::assertVisible(); $assert(false, 'The hidden tenant feature did not reject direct access.'); } catch (CloudError $error) { $assert( $error->httpStatus === 403, 'The hidden tenant feature returned the wrong HTTP status.' ); } Capsule::table('configurations') ->where('name', CloudPaidIpChangeFeature::CONFIG_KEY) ->update(['value' => 'true']); $assert( CloudPaidIpChangeFeature::visible(), 'The enabled visibility row did not expose the tenant feature.' ); CloudPaidIpChangeFeature::assertVisible(); echo "Cloud paid IP-change visibility tests passed.\n";