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