addConnection([ 'driver' => 'sqlite', 'database' => ':memory:', ], 'default'); $db->setAsGlobal(); $db->bootEloquent(); $db->schema('default')->create( 'cloud_storage_backends', static function (Blueprint $table): void { $table->increments('id'); $table->string('admin_state'); $table->string('health_state'); $table->unsignedBigInteger('config_revision'); $table->unsignedBigInteger('tested_revision'); } ); Capsule::table('cloud_storage_backends')->insert([ 'id' => 1, 'admin_state' => 'active', 'health_state' => 'healthy', 'config_revision' => 3, 'tested_revision' => 3, ]); $summary = CloudObjectStorageBackendRegistry::summary(); $assert((int) $summary['writable_backends'] === 1, 'A current active healthy backend was not writable for backup creation.'); Capsule::table('cloud_storage_backends')->where('id', 1)->update([ 'tested_revision' => 2, ]); $summary = CloudObjectStorageBackendRegistry::summary(); $assert((int) $summary['writable_backends'] === 0, 'A stale backend revision remained writable for backup creation.'); Capsule::table('cloud_storage_backends')->where('id', 1)->update([ 'tested_revision' => 3, 'health_state' => 'unreachable', ]); $summary = CloudObjectStorageBackendRegistry::summary(); $assert((int) $summary['writable_backends'] === 0, 'An unreachable backend remained writable for backup creation.'); echo "Backup multi-backend availability behavior passed.\n";