File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Support \Facades \Config ;
4+ use Native \Desktop \Drivers \Electron \Commands \BuildCommand ;
5+
6+ it ('passes NSIS delete app data flag as true when config is enabled ' , function () {
7+ Config::set ('nativephp.nsis.delete_app_data_on_uninstall ' , true );
8+
9+ $ command = app (BuildCommand::class);
10+ $ envVars = (new ReflectionMethod ($ command , 'getEnvironmentVariables ' ))->invoke ($ command );
11+
12+ expect ($ envVars ['NATIVEPHP_NSIS_DELETE_APP_DATA ' ])->toBe ('true ' );
13+ });
14+
15+ it ('passes NSIS delete app data flag as false when config is disabled ' , function () {
16+ Config::set ('nativephp.nsis.delete_app_data_on_uninstall ' , false );
17+
18+ $ command = app (BuildCommand::class);
19+ $ envVars = (new ReflectionMethod ($ command , 'getEnvironmentVariables ' ))->invoke ($ command );
20+
21+ expect ($ envVars ['NATIVEPHP_NSIS_DELETE_APP_DATA ' ])->toBe ('false ' );
22+ });
23+
24+ it ('defaults NSIS delete app data flag to false when config is not set ' , function () {
25+ Config::set ('nativephp.nsis.delete_app_data_on_uninstall ' , null );
26+
27+ $ command = app (BuildCommand::class);
28+ $ envVars = (new ReflectionMethod ($ command , 'getEnvironmentVariables ' ))->invoke ($ command );
29+
30+ expect ($ envVars ['NATIVEPHP_NSIS_DELETE_APP_DATA ' ])->toBe ('false ' );
31+ });
You can’t perform that action at this time.
0 commit comments