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