invokeArgs($target, $arguments); }; $expiry = time() - 60; $expiredRunning = [ 'id' => '7', 'api_id' => '7', 'uuid' => '77777777-7777-4777-8777-777777777777', 'name' => 'expired-running-vm', 'state' => 'running', 'state_fresh' => true, 'state_sync_status' => 'fresh', 'service_status' => 'expired_grace', 'network_status' => 'blocked_expired', 'service_expires_at' => $expiry, 'service_paused' => true, 'region' => 'Tokyo', 'os_source' => 'cloud_template', 'os_name' => 'AlmaLinux 10', 'vcpu' => 2, 'memory_mib' => 2048, 'disk_gib' => 40, ]; $controller = new CloudPageController(); $source = new UserCopySourceCatalog(UserCopyManifest::load()); $copy = UserCopyCatalog::forPage( new UserCopyRuntimeReader(sys_get_temp_dir() . '/virt-copy-missing', $source), 'zh-CN', 'cloud.instances' ); $row = $invoke($controller, 'vmListRow', [$expiredRunning, $copy]); $detail = $invoke($controller, 'vmDetailView', [$expiredRunning]); $assert($row['state_label'] === '已暂停' && $row['state_class'] === 'other', 'Expired list first paint still presents the live power state as running.'); $assert($row['service_expiry_display'] !== '暂未提供' && str_contains($row['service_expiry_display'], date('Y/m/d', $expiry)), 'Instance list first paint omitted the service expiry date.'); $assert($detail['state_copy_key'] === 'instance_detail.state.paused' && $detail['state_class'] === 'other' && !array_key_exists('state_label', $detail), 'Expired detail first paint still presents the live power state as running.'); echo "Expired instance SSR presentation checks passed.\n";