File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ public function handle(): void
4444 return ;
4545 }
4646
47+ // Do not make a major version update
48+ $ majorVersionCms = (int ) $ healthResult ->cms_version ;
49+ $ majorTargetVersion = (int ) $ this ->targetVersion ;
50+
51+ if ($ majorVersionCms <> $ majorTargetVersion ) {
52+ Log::info ("No major update for Site: " . $ this ->site ->id );
53+
54+ return ;
55+ }
56+
4757 // Store pre-update response code
4858 $ this ->preUpdateCode = $ this ->site ->getFrontendStatus ();
4959
Original file line number Diff line number Diff line change @@ -58,6 +58,29 @@ public function testJobQuitsIfNoUpdateIsAvailable()
5858 $ this ->assertTrue (true );
5959 }
6060
61+ public function testJobQuitsIfAvailableUpdateWouldBeAMajorUpdate ()
62+ {
63+ $ site = $ this ->getSiteMock (
64+ [
65+ 'checkHealth ' => $ this ->getHealthCheckMock (),
66+ 'getUpdate ' => $ this ->getGetUpdateMock ("2.0.0 " )
67+ ]
68+ );
69+
70+ Log::spy ();
71+
72+ $ object = new UpdateSite ($ site , "2.0.0 " );
73+ $ object ->handle ();
74+
75+ Log::shouldHaveReceived ('info ' )
76+ ->once ()
77+ ->withArgs (function ($ message ) {
78+ return str_contains ($ message , 'No major update for Site ' );
79+ });
80+
81+ $ this ->assertTrue (true );
82+ }
83+
6184 public function testJobQuitsIfAvailableUpdateDoesNotMatchTargetVersion ()
6285 {
6386 $ site = $ this ->getSiteMock (
You can’t perform that action at this time.
0 commit comments