@@ -191,6 +191,14 @@ public function iRunACommandToInstallAnExtension(): void
191191 $ this ->runPieCommand (['install ' , $ this ->thePackage ]);
192192 }
193193
194+ #[When('I run a command to forcefully install an extension ' )]
195+ public function iRunACommandToForcefullyInstallAnExtension (): void
196+ {
197+ $ this ->theExtension = 'example_pie_extension ' ;
198+ $ this ->thePackage = 'asgrim/example-pie-extension ' ;
199+ $ this ->runPieCommand (['install ' , '--force ' , $ this ->thePackage ]);
200+ }
201+
194202 #[When('I run a command to install an extension without enabling it ' )]
195203 public function iRunACommandToInstallAnExtensionWithoutEnabling (): void
196204 {
@@ -265,6 +273,20 @@ public function theExtensionShouldHaveBeenInstalledAndEnabled(): void
265273 Assert::same ($ isExtEnabled , 'yes ' );
266274 }
267275
276+ #[Then('the extension should not have been re-installed ' )]
277+ public function theExtensionShouldNotHaveBeenReinstalled (): void
278+ {
279+ $ this ->assertCommandSuccessful ();
280+
281+ Assert::contains ($ this ->output , 'PIE package asgrim/example-pie-extension (example_pie_extension) is already installed and verified. ' );
282+
283+ $ isExtEnabled = (new Process ([self ::PHP_BINARY , '-r ' , 'echo extension_loaded(" ' . $ this ->theExtension . '")?"yes":"no"; ' ]))
284+ ->mustRun ()
285+ ->getOutput ();
286+
287+ Assert::same ($ isExtEnabled , 'yes ' );
288+ }
289+
268290 #[Given('I have an invalid extension installed ' )]
269291 public function iHaveAnInvalidExtensionInstalled (): void
270292 {
0 commit comments