更新
This commit is contained in:
@@ -40,11 +40,12 @@ $config = [
|
||||
'title' => '医生工作站 0.2.0',
|
||||
'notes' => '稳定性更新',
|
||||
'packages' => [
|
||||
'windows_x64' => [
|
||||
'url' => 'https://cdn.example.com/DoctorWorkstation-Windows-x64-0.2.0.zip',
|
||||
'sha256' => $sha,
|
||||
'size' => 123,
|
||||
'filename' => 'DoctorWorkstation-Windows-x64-0.2.0.zip',
|
||||
'windows_x64' => [
|
||||
'url' => 'https://cdn.example.com/DoctorWorkstation-Setup-Windows-x64-0.2.0.exe',
|
||||
'sha256' => $sha,
|
||||
'size' => 123,
|
||||
'filename' => 'DoctorWorkstation-Setup-Windows-x64-0.2.0.exe',
|
||||
'type' => 'inno_setup',
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -53,10 +54,12 @@ $optional = DesktopWorkstationLogic::evaluate($config, '0.1.8', 'windows', 'x64'
|
||||
desktopUpdateExpect($optional['has_update'] === true, 'newer published version is an update');
|
||||
desktopUpdateExpect($optional['force'] === false, 'force stays off when above min version');
|
||||
desktopUpdateExpect($optional['can_install'] === true, 'hashed package can be installed');
|
||||
desktopUpdateExpect(
|
||||
is_array($optional['package']) && $optional['package']['sha256'] === $sha,
|
||||
'matching windows package is returned'
|
||||
);
|
||||
desktopUpdateExpect(
|
||||
is_array($optional['package'])
|
||||
&& $optional['package']['sha256'] === $sha
|
||||
&& $optional['package']['type'] === 'inno_setup',
|
||||
'matching Windows installer package is returned with its explicit type'
|
||||
);
|
||||
|
||||
$forcedByMin = DesktopWorkstationLogic::evaluate($config, '0.1.0', 'windows', 'x64');
|
||||
desktopUpdateExpect($forcedByMin['force'] === true, 'below min version forces upgrade');
|
||||
@@ -90,10 +93,11 @@ desktopUpdateExpect(
|
||||
$adminView = file_get_contents(dirname(__DIR__, 2) . '/admin/src/views/setting/desktop_workstation/index.vue');
|
||||
desktopUpdateExpect(is_string($adminView), 'admin view source is readable');
|
||||
desktopUpdateExpect(
|
||||
str_contains($adminView, 'setting.desktop_workstation/setConfig')
|
||||
&& str_contains($adminView, 'force_update'),
|
||||
'admin page can save force-update configuration'
|
||||
);
|
||||
str_contains($adminView, 'setting.desktop_workstation/setConfig')
|
||||
&& str_contains($adminView, 'force_update')
|
||||
&& str_contains($adminView, 'inno_setup'),
|
||||
'admin page can save force-update and Inno Setup configuration'
|
||||
);
|
||||
|
||||
$migration = file_get_contents(
|
||||
dirname(__DIR__) . '/sql/1.9.20260821/add_desktop_workstation_update_menu.sql'
|
||||
|
||||
Reference in New Issue
Block a user