]> git.mxchange.org Git - friendica.git/blob - tests/src/Console/AutomaticInstallationConsoleTest.php
Merge pull request #7381 from MrPetovan/task/7309-frio-compose
[friendica.git] / tests / src / Console / AutomaticInstallationConsoleTest.php
1 <?php
2
3 namespace Friendica\Test\src\Console;
4
5 use Dice\Dice;
6 use Friendica\App;
7 use Friendica\BaseObject;
8 use Friendica\Console\AutomaticInstallation;
9 use Friendica\Core\Config\Cache\ConfigCache;
10 use Friendica\Core\Installer;
11 use Friendica\Core\L10n\L10n;
12 use Friendica\Core\Logger;
13 use Friendica\Database\Database;
14 use Friendica\Test\Util\DBAMockTrait;
15 use Friendica\Test\Util\DBStructureMockTrait;
16 use Friendica\Test\Util\RendererMockTrait;
17 use Friendica\Test\Util\VFSTrait;
18 use Friendica\Util\BaseURL;
19 use Friendica\Util\Logger\VoidLogger;
20 use Mockery\MockInterface;
21 use org\bovigo\vfs\vfsStream;
22 use org\bovigo\vfs\vfsStreamFile;
23
24 class AutomaticInstallationConsoleTest extends ConsoleTest
25 {
26         use VFSTrait;
27         use DBAMockTrait;
28         use DBStructureMockTrait;
29         use RendererMockTrait;
30
31         /**
32          * @var vfsStreamFile Assert file without DB credentials
33          */
34         private $assertFile;
35         /**
36          * @var vfsStreamFile Assert file with DB credentials
37          */
38         private $assertFileDb;
39
40         /**
41          * @var ConfigCache The configuration cache to check after each test
42          */
43         private $configCache;
44
45         /**
46          * @var App\Mode
47          */
48         private $appMode;
49
50         /**
51          * @var Database
52          */
53         private $dba;
54
55         /**
56          * @var Dice|MockInterface
57          */
58         private $dice;
59
60         public function setUp()
61         {
62                 $this->markTestSkipped('Needs class \'Installer\' as constructing argument for console tests');
63
64                 parent::setUp();
65
66                 $this->setUpVfsDir();;
67
68                 if ($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php')) {
69                         $this->root->getChild('config')
70                                 ->removeChild('local.config.php');
71                 }
72                 $this->dice = \Mockery::mock(Dice::class)->makePartial();
73
74                 $l10nMock = \Mockery::mock(L10n::class);
75                 $l10nMock->shouldReceive('t')->andReturnUsing(function ($args) { return $args; });
76
77                 $this->dice->shouldReceive('create')
78                            ->with(L10n::class)
79                            ->andReturn($l10nMock);
80
81                 BaseObject::setDependencyInjection($this->dice);
82
83                 $this->configCache = new ConfigCache();
84                 $this->configCache->set('system', 'basepath', $this->root->url());
85                 $this->configCache->set('config', 'php_path', trim(shell_exec('which php')));
86                 $this->configCache->set('system', 'theme', 'smarty3');
87
88                 $this->configMock->shouldReceive('set')->andReturnUsing(function ($cat, $key, $value) {
89                         if ($key !== 'basepath') {
90                                 return $this->configCache->set($cat, $key, $value);
91                         } else {
92                                 return true;
93                         }
94                 });
95
96                 $this->configMock->shouldReceive('has')->andReturn(true);
97                 $this->configMock->shouldReceive('get')->andReturnUsing(function ($cat, $key) {
98                         return $this->configCache->get($cat, $key);
99                 });
100                 $this->configMock->shouldReceive('load')->andReturnUsing(function ($config, $overwrite = false) {
101                         $this->configCache->load($config, $overwrite);
102                 });
103
104                 $this->mode->shouldReceive('isInstall')->andReturn(true);
105                 Logger::init(new VoidLogger());
106         }
107
108         /**
109          * Returns the dataset for each automatic installation test
110          *
111          * @return array the dataset
112          */
113         public function dataInstaller()
114         {
115                 return [
116                         'empty' => [
117                                 'data' => [
118                                         'database' => [
119                                                 'hostname'    => '',
120                                                 'username'    => '',
121                                                 'password'    => '',
122                                                 'database'    => '',
123                                                 'port'        => '',
124                                         ],
125                                         'config' => [
126                                                 'php_path'    => '',
127                                                 'hostname'    => 'friendica.local',
128                                                 'admin_email' => '',
129                                         ],
130                                         'system' => [
131                                                 'basepath'    => '',
132                                                 'urlpath'     => '',
133                                                 'url'         => 'http://friendica.local',
134                                                 'ssl_policy'  => 0,
135                                                 'default_timezone' => '',
136                                                 'language'    => '',
137                                         ],
138                                 ],
139                         ],
140                         'normal' => [
141                                 'data' => [
142                                         'database' => [
143                                                 'hostname'    => 'testhost',
144                                                 'port'        => 3306,
145                                                 'username'    => 'friendica',
146                                                 'password'    => 'a password',
147                                                 'database'    => 'database',
148                                         ],
149                                         'config' => [
150                                                 'php_path'    => '',
151                                                 'hostname'    => 'friendica.local',
152                                                 'admin_email' => 'admin@philipp.info',
153                                         ],
154                                         'system' => [
155                                                 'urlpath'     => 'test/it',
156                                                 'url'         => 'http://friendica.local/test/it',
157                                                 'basepath'    => '',
158                                                 'ssl_policy'  => '2',
159                                                 'default_timezone' => 'en',
160                                                 'language'    => 'Europe/Berlin',
161                                         ],
162                                 ],
163                         ],
164                         'special' => [
165                                 'data' => [
166                                         'database' => [
167                                                 'hostname'    => 'testhost.new.domain',
168                                                 'port'        => 3341,
169                                                 'username'    => 'fr"ยง%ica',
170                                                 'password'    => '$%\"gse',
171                                                 'database'    => 'db',
172                                         ],
173                                         'config' => [
174                                                 'php_path'    => '',
175                                                 'hostname'    => 'friendica.local',
176                                                 'admin_email' => 'admin@philipp.info',
177                                         ],
178                                         'system' => [
179                                                 'urlpath'     => 'test/it',
180                                                 'url'         => 'https://friendica.local/test/it',
181                                                 'basepath'    => '',
182                                                 'ssl_policy'  => '1',
183                                                 'default_timezone' => 'en',
184                                                 'language'    => 'Europe/Berlin',
185                                         ],
186                                 ],
187                         ],
188                 ];
189         }
190
191         private function assertFinished($txt, $withconfig = false, $copyfile = false)
192         {
193                 $cfg = '';
194
195                 if ($withconfig) {
196                         $cfg = <<<CFG
197
198
199 Creating config file...
200
201  Complete!
202 CFG;
203                 }
204
205                 if ($copyfile) {
206                         $cfg = <<<CFG
207
208
209 Copying config file...
210
211  Complete!
212 CFG;
213                 }
214
215                 $finished = <<<FIN
216 Initializing setup...
217
218  Complete!
219
220
221 Checking environment...
222
223  NOTICE: Not checking .htaccess/URL-Rewrite during CLI installation.
224
225  Complete!
226 {$cfg}
227
228
229 Checking database...
230
231  Complete!
232
233
234 Inserting data into database...
235
236  Complete!
237
238
239 Installing theme
240
241  Complete
242
243
244
245 Installation is finished
246
247
248 FIN;
249                 $this->assertEquals($finished, $txt);
250         }
251
252         private function assertStuckDB($txt)
253         {
254                 $finished = <<<FIN
255 Initializing setup...
256
257  Complete!
258
259
260 Checking environment...
261
262  NOTICE: Not checking .htaccess/URL-Rewrite during CLI installation.
263
264  Complete!
265
266
267 Creating config file...
268
269  Complete!
270
271
272 Checking database...
273
274 [Error] --------
275 Could not connect to database.: 
276
277
278 FIN;
279
280                 $this->assertEquals($finished, $txt);
281         }
282
283         private function assertStuckURL($txt)
284         {
285                 $finished = <<<FIN
286 Initializing setup...
287
288  Complete!
289
290
291 Checking environment...
292
293  NOTICE: Not checking .htaccess/URL-Rewrite during CLI installation.
294
295  Complete!
296
297
298 Creating config file...
299
300 The Friendica URL has to be set during CLI installation.
301
302 FIN;
303
304                 $this->assertEquals($finished, $txt);
305         }
306
307         /**
308          * Asserts one config entry
309          *
310          * @param string     $cat           The category to test
311          * @param string     $key           The key to test
312          * @param null|array $assertion     The asserted value (null = empty, or array/string)
313          * @param string     $default_value The default value
314          */
315         public function assertConfigEntry($cat, $key, $assertion = null, $default_value = null)
316         {
317                 if (!empty($assertion[$cat][$key])) {
318                         $this->assertEquals($assertion[$cat][$key], $this->configCache->get($cat, $key));
319                 } elseif (!empty($assertion) && !is_array($assertion)) {
320                         $this->assertEquals($assertion, $this->configCache->get($cat, $key));
321                 } elseif (!empty($default_value)) {
322                         $this->assertEquals($default_value, $this->configCache->get($cat, $key));
323                 } else {
324                         $this->assertEmpty($this->configCache->get($cat, $key), $this->configCache->get($cat, $key));
325                 }
326         }
327
328         /**
329          * Asserts all config entries
330          *
331          * @param null|array $assertion    The optional assertion array
332          * @param boolean    $saveDb       True, if the db credentials should get saved to the file
333          * @param boolean    $default      True, if we use the default values
334          * @param boolean    $defaultDb    True, if we use the default value for the DB
335          * @param boolean    $realBasepath True, if we use the real basepath of the installation, not the mocked one
336          */
337         public function assertConfig($assertion = null, $saveDb = false, $default = true, $defaultDb = true, $realBasepath = false)
338         {
339                 if (!empty($assertion['database']['hostname'])) {
340                         $assertion['database']['hostname'] .= (!empty($assertion['database']['port']) ? ':' . $assertion['database']['port'] : '');
341                 }
342
343                 $this->assertConfigEntry('database', 'hostname', ($saveDb) ? $assertion : null, (!$saveDb || $defaultDb) ? Installer::DEFAULT_HOST : null);
344                 $this->assertConfigEntry('database', 'username', ($saveDb) ? $assertion : null);
345                 $this->assertConfigEntry('database', 'password', ($saveDb) ? $assertion : null);
346                 $this->assertConfigEntry('database', 'database', ($saveDb) ? $assertion : null);
347
348                 $this->assertConfigEntry('config', 'admin_email', $assertion);
349                 $this->assertConfigEntry('config', 'php_path', trim(shell_exec('which php')));
350                 $this->assertConfigEntry('config', 'hostname', $assertion);
351
352                 $this->assertConfigEntry('system', 'default_timezone', $assertion, ($default) ? Installer::DEFAULT_TZ : null);
353                 $this->assertConfigEntry('system', 'language', $assertion, ($default) ? Installer::DEFAULT_LANG : null);
354                 $this->assertConfigEntry('system', 'url', $assertion);
355                 $this->assertConfigEntry('system', 'urlpath', $assertion);
356                 $this->assertConfigEntry('system', 'ssl_policy', $assertion, ($default) ? BaseURL::DEFAULT_SSL_SCHEME : null);
357                 $this->assertConfigEntry('system', 'basepath', ($realBasepath) ? $this->root->url() : $assertion);
358         }
359
360         /**
361          * Test the automatic installation without any parameter/setting
362          * Should stuck because of missing hostname
363          */
364         public function testEmpty()
365         {
366                 $console = new AutomaticInstallation($this->consoleArgv);
367
368                 $txt = $this->dumpExecute($console);
369
370                 $this->assertStuckURL($txt);
371         }
372
373         /**
374          * Test the automatic installation without any parameter/setting
375          * except URL
376          */
377         public function testEmptyWithURL()
378         {
379                 $this->mockConnect(true, 1);
380                 $this->mockConnected(true, 1);
381                 $this->mockExistsTable('user', false, 1);
382                 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
383
384                 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
385                 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
386
387                 $console = new AutomaticInstallation($this->consoleArgv);
388                 $console->setOption('url', 'http://friendica.local');
389
390                 $txt = $this->dumpExecute($console);
391
392                 $this->assertFinished($txt, true, false);
393                 $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php'));
394
395                 $this->assertConfig(['config' => ['hostname' => 'friendica.local'], 'system' => ['url' => 'http://friendica.local', 'ssl_policy' => 0, 'urlPath' => '']], false, true, true, true);
396         }
397
398         /**
399          * Test the automatic installation with a prepared config file
400          * @dataProvider dataInstaller
401          */
402         public function testWithConfig(array $data)
403         {
404                 $this->mockConnect(true, 1);
405                 $this->mockConnected(true, 1);
406                 $this->mockExistsTable('user', false, 1);
407                 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
408
409                 $conf = function ($cat, $key) use ($data) {
410                         if ($cat == 'database' && $key == 'hostname' && !empty($data['database']['port'])) {
411                                 return $data[$cat][$key] . ':' . $data['database']['port'];
412                         }
413                         return $data[$cat][$key];
414                 };
415
416                 $config = <<<CONF
417 <?php
418
419 // Local configuration
420
421 // If you're unsure about what any of the config keys below do, please check the static/defaults.config.php for detailed
422 // documentation of their data type and behavior.
423
424 return [
425         'database' => [
426                 'hostname' => '{$conf('database', 'hostname')}',
427                 'username' => '{$conf('database', 'username')}',
428                 'password' => '{$conf('database', 'password')}',
429                 'database' => '{$conf('database', 'database')}',
430                 'charset' => 'utf8mb4',
431         ],
432
433         // ****************************************************************
434         // The configuration below will be overruled by the admin panel.
435         // Changes made below will only have an effect if the database does
436         // not contain any configuration for the friendica system.
437         // ****************************************************************
438
439         'config' => [
440                 'admin_email' => '{$conf('config', 'admin_email')}',
441                 'hostname' => '{$conf('config', 'hostname')}',
442                 'sitename' => 'Friendica Social Network',
443                 'register_policy' => \Friendica\Module\Register::OPEN,
444                 'register_text' => '',
445         ],
446         'system' => [
447                 'basepath' => '{$conf('system', 'basepath')}',
448                 'urlpath' => '{$conf('system', 'urlpath')}',
449                 'url' => '{$conf('system', 'url')}',
450                 'ssl_policy' => '{$conf('system', 'ssl_policy')}',
451                 'default_timezone' => '{$conf('system', 'default_timezone')}',
452                 'language' => '{$conf('system', 'language')}',
453         ],
454 ];
455 CONF;
456
457                 vfsStream::newFile('prepared.config.php')
458                         ->at($this->root)
459                         ->setContent($config);
460
461                 $console = new AutomaticInstallation($this->consoleArgv);
462                 $console->setOption('f', 'prepared.config.php');
463
464                 $txt = $this->dumpExecute($console);
465
466                 $this->assertFinished($txt, false, true);
467
468                 $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php'));
469                 $this->assertEquals($config, file_get_contents($this->root->getChild('config' . DIRECTORY_SEPARATOR . 'local.config.php')->url()));
470
471                 $this->assertConfig($data, true, false, false);
472         }
473
474         /**
475          * Test the automatic installation with environment variables
476          * Includes saving the DB credentials to the file
477          * @dataProvider dataInstaller
478          */
479         public function testWithEnvironmentAndSave(array $data)
480         {
481                 $this->mockConnect(true, 1);
482                 $this->mockConnected(true, 1);
483                 $this->mockExistsTable('user', false, 1);
484                 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
485
486                 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
487                 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
488
489                 $this->assertTrue(putenv('MYSQL_HOST='     . $data['database']['hostname']));
490                 $this->assertTrue(putenv('MYSQL_PORT='     . $data['database']['port']));
491                 $this->assertTrue(putenv('MYSQL_DATABASE=' . $data['database']['database']));
492                 $this->assertTrue(putenv('MYSQL_USERNAME=' . $data['database']['username']));
493                 $this->assertTrue(putenv('MYSQL_PASSWORD=' . $data['database']['password']));
494
495                 $this->assertTrue(putenv('FRIENDICA_HOSTNAME='   . $data['config']['hostname']));
496                 $this->assertTrue(putenv('FRIENDICA_BASE_PATH='  . $data['system']['basepath']));
497                 $this->assertTrue(putenv('FRIENDICA_URL='        . $data['system']['url']));
498                 $this->assertTrue(putenv('FRIENDICA_PHP_PATH='   . $data['config']['php_path']));
499                 $this->assertTrue(putenv('FRIENDICA_ADMIN_MAIL=' . $data['config']['admin_email']));
500                 $this->assertTrue(putenv('FRIENDICA_TZ='         . $data['system']['default_timezone']));
501                 $this->assertTrue(putenv('FRIENDICA_LANG='       . $data['system']['language']));
502
503                 $console = new AutomaticInstallation($this->consoleArgv);
504                 $console->setOption('savedb', true);
505
506                 $txt = $this->dumpExecute($console);
507
508                 $this->assertFinished($txt, true);
509                 $this->assertConfig($data, true, true, false, true);
510         }
511
512         /**
513          * Test the automatic installation with environment variables
514          * Don't save the db credentials to the file
515          * @dataProvider dataInstaller
516          */
517         public function testWithEnvironmentWithoutSave(array $data)
518         {
519                 $this->mockConnect(true, 1);
520                 $this->mockConnected(true, 1);
521                 $this->mockExistsTable('user', false, 1);
522                 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
523
524                 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
525                 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
526
527                 $this->assertTrue(putenv('MYSQL_HOST=' . $data['database']['hostname']));
528                 $this->assertTrue(putenv('MYSQL_PORT=' . $data['database']['port']));
529                 $this->assertTrue(putenv('MYSQL_DATABASE=' . $data['database']['database']));
530                 $this->assertTrue(putenv('MYSQL_USERNAME=' . $data['database']['username']));
531                 $this->assertTrue(putenv('MYSQL_PASSWORD=' . $data['database']['password']));
532
533                 $this->assertTrue(putenv('FRIENDICA_HOSTNAME='   . $data['config']['hostname']));
534                 $this->assertTrue(putenv('FRIENDICA_BASE_PATH='  . $data['system']['basepath']));
535                 $this->assertTrue(putenv('FRIENDICA_URL='        . $data['system']['url']));
536                 $this->assertTrue(putenv('FRIENDICA_PHP_PATH='   . $data['config']['php_path']));
537                 $this->assertTrue(putenv('FRIENDICA_ADMIN_MAIL=' . $data['config']['admin_email']));
538                 $this->assertTrue(putenv('FRIENDICA_TZ='         . $data['system']['default_timezone']));
539                 $this->assertTrue(putenv('FRIENDICA_LANG='       . $data['system']['language']));
540
541                 $console = new AutomaticInstallation($this->consoleArgv);
542
543                 $txt = $this->dumpExecute($console);
544
545                 $this->assertFinished($txt, true);
546                 $this->assertConfig($data, false, true, false, true);
547         }
548
549         /**
550          * Test the automatic installation with arguments
551          * @dataProvider dataInstaller
552          */
553         public function testWithArguments(array $data)
554         {
555                 $this->mockConnect(true, 1);
556                 $this->mockConnected(true, 1);
557                 $this->mockExistsTable('user', false, 1);
558                 $this->mockUpdate([$this->root->url(), false, true, true], null, 1);
559
560                 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
561                 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
562
563                 $console = new AutomaticInstallation($this->consoleArgv);
564
565                 $option = function($var, $cat, $key) use ($data, $console) {
566                         if (!empty($data[$cat][$key])) {
567                                 $console->setOption($var, $data[$cat][$key]);
568                         }
569                 };
570                 $option('dbhost'    , 'database', 'hostname');
571                 $option('dbport'    , 'database', 'port');
572                 $option('dbuser'    , 'database', 'username');
573                 $option('dbpass'    , 'database', 'password');
574                 $option('dbdata'    , 'database', 'database');
575                 $option('url'       , 'system'  , 'url');
576                 $option('phppath'   , 'config'  , 'php_path');
577                 $option('admin'     , 'config'  , 'admin_email');
578                 $option('tz'        , 'system'  , 'default_timezone');
579                 $option('lang'      , 'system'  , 'language');
580                 $option('basepath'  , 'system'  , 'basepath');
581
582                 $txt = $this->dumpExecute($console);
583
584                 $this->assertFinished($txt, true);
585                 $this->assertConfig($data, true, true, true, true);
586         }
587
588         /**
589          * Test the automatic installation with a wrong database connection
590          */
591         public function testNoDatabaseConnection()
592         {
593                 $this->mockConnect(false, 1);
594
595                 $this->mockGetMarkupTemplate('local.config.tpl', 'testTemplate', 1);
596                 $this->mockReplaceMacros('testTemplate', \Mockery::any(), '', 1);
597
598                 $console = new AutomaticInstallation($this->consoleArgv);
599                 $console->setOption('url', 'http://friendica.local');
600
601                 $txt = $this->dumpExecute($console);
602
603                 $this->assertStuckDB($txt);
604                 $this->assertTrue($this->root->hasChild('config' . DIRECTORY_SEPARATOR . 'local.config.php'));
605
606                 $this->assertConfig(['config' => ['hostname' => 'friendica.local'], 'system' => ['url' => 'http://friendica.local', 'ssl_policy' => 0, 'urlpath' => '']], false, true, false, true);
607         }
608
609         public function testGetHelp()
610         {
611                 // Usable to purposely fail if new commands are added without taking tests into account
612                 $theHelp = <<<HELP
613 Installation - Install Friendica automatically
614 Synopsis
615         bin/console autoinstall [-h|--help|-?] [-v] [-a] [-f]
616
617 Description
618     Installs Friendica with data based on the local.config.php file or environment variables
619
620 Notes
621     Not checking .htaccess/URL-Rewrite during CLI installation.
622
623 Options
624     -h|--help|-?            Show help information
625     -v                      Show more debug information.
626     -a                      All setup checks are required (except .htaccess)
627     -f|--file <config>      prepared config file (e.g. "config/local.config.php" itself) which will override every other config option - except the environment variables)
628     -s|--savedb               Save the DB credentials to the file (if environment variables is used)
629     -H|--dbhost <host>        The host of the mysql/mariadb database (env MYSQL_HOST)
630     -p|--dbport <port>        The port of the mysql/mariadb database (env MYSQL_PORT)
631     -d|--dbdata <database>    The name of the mysql/mariadb database (env MYSQL_DATABASE)
632     -U|--dbuser <username>    The username of the mysql/mariadb database login (env MYSQL_USER or MYSQL_USERNAME)
633     -P|--dbpass <password>    The password of the mysql/mariadb database login (env MYSQL_PASSWORD)
634     -U|--url <url>            The full base URL of Friendica - f.e. 'https://friendica.local/sub' (env FRIENDICA_URL) 
635     -B|--phppath <php_path>   The path of the PHP binary (env FRIENDICA_PHP_PATH)
636     -b|--basepath <base_path> The basepath of Friendica (env FRIENDICA_BASE_PATH)
637     -t|--tz <timezone>        The timezone of Friendica (env FRIENDICA_TZ)
638     -L|--lang <language>      The language of Friendica (env FRIENDICA_LANG)
639  
640 Environment variables
641    MYSQL_HOST                  The host of the mysql/mariadb database (mandatory if mysql and environment is used)
642    MYSQL_PORT                  The port of the mysql/mariadb database
643    MYSQL_USERNAME|MYSQL_USER   The username of the mysql/mariadb database login (MYSQL_USERNAME is for mysql, MYSQL_USER for mariadb)
644    MYSQL_PASSWORD              The password of the mysql/mariadb database login
645    MYSQL_DATABASE              The name of the mysql/mariadb database
646    FRIENDICA_URL               The full base URL of Friendica - f.e. 'https://friendica.local/sub'
647    FRIENDICA_PHP_PATH          The path of the PHP binary - leave empty for auto detection
648    FRIENDICA_BASE_PATH         The basepath of Friendica - leave empty for auto detection
649    FRIENDICA_ADMIN_MAIL        The admin email address of Friendica (this email will be used for admin access)
650    FRIENDICA_TZ                The timezone of Friendica
651    FRIENDICA_LANG              The langauge of Friendica
652    
653 Examples
654         bin/console autoinstall -f 'input.config.php
655                 Installs Friendica with the prepared 'input.config.php' file
656
657         bin/console autoinstall --savedb
658                 Installs Friendica with environment variables and saves them to the 'config/local.config.php' file
659
660         bin/console autoinstall -h localhost -p 3365 -U user -P passwort1234 -d friendica
661                 Installs Friendica with a local mysql database with credentials
662
663 HELP;
664
665                 $console = new AutomaticInstallation($this->consoleArgv);
666                 $console->setOption('help', true);
667
668                 $txt = $this->dumpExecute($console);
669
670                 $this->assertEquals($theHelp, $txt);
671         }
672 }