File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,16 @@ public function handle(): void
5353 return ;
5454 }
5555
56+ // Do not make a major version update
57+ $ majorVersionCms = (int ) $ healthResult ->cms_version ;
58+ $ majorTargetVersion = (int ) $ this ->targetVersion ;
59+
60+ if ($ majorVersionCms <> $ majorTargetVersion ) {
61+ Log::info ("No major update for Site: " . $ this ->site ->id );
62+
63+ return ;
64+ }
65+
5666 // Store pre-update response code
5767 $ this ->preUpdateCode = $ this ->site ->getFrontendStatus ();
5868
Original file line number Diff line number Diff line change @@ -76,6 +76,28 @@ public function testJobQuitsIfWeDetectALoopForAVersion()
7676 $ this ->assertTrue (true );
7777 }
7878
79+ public function testJobQuitsIfAvailableUpdateWouldBeAMajorUpdate ()
80+ {
81+ $ site = $ this ->getSiteMock (
82+ [
83+ 'checkHealth ' => $ this ->getHealthCheckMock (),
84+ 'getUpdate ' => $ this ->getGetUpdateMock ("2.0.0 " )
85+ ]
86+ );
87+
88+ Log::spy ();
89+
90+ $ object = new UpdateSite ($ site , "2.0.0 " );
91+ $ object ->handle ();
92+
93+ Log::shouldHaveReceived ('info ' )
94+ ->once ()
95+ ->withArgs (function ($ message ) {
96+ return str_contains ($ message , 'No major update for Site ' );
97+ });
98+
99+ $ this ->assertTrue (true );
100+ }
79101 public function testJobQuitsIfAvailableUpdateDoesNotMatchTargetVersion ()
80102 {
81103 $ site = $ this ->getSiteMock (
You can’t perform that action at this time.
0 commit comments