-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.php
34 lines (25 loc) · 1.03 KB
/
setup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
use ITB\ShopwareRemoteAdminApiTestRunner\ApiTest\Runner;
use ITB\ShopwareRemoteAdminApiTestRunner\Setup\AfterInstallConfigurator;
use ITB\ShopwareRemoteAdminApiTestRunner\Setup\DatabaseBackupExecutor;
use Symfony\Component\Dotenv\Dotenv;
// Get command-line arguments
$locale = $argv[1] ?? null;
$currencyIsoCode = $argv[2] ?? null;
require_once __DIR__ . '/vendor/autoload.php';
$dotenv = new Dotenv();
$dotenv->loadEnv(__DIR__ . '/.env');
require __DIR__ . '/vendor/shopware/platform/src/Core/TestBootstrap.php';
$remotelyCalledApiTest = new Runner();
$remotelyCalledApiTest->beforeCall(true);
$remotelyCalledApiTest->afterCall(true);
$afterInstallConfigurator = new AfterInstallConfigurator();
if ($locale !== null) {
$afterInstallConfigurator->changeSystemLanguage($locale);
}
if ($currencyIsoCode !== null) {
$afterInstallConfigurator->changeSystemCurrency($currencyIsoCode);
}
$databaseBackupExecutor = new DatabaseBackupExecutor(__DIR__ . '/var/dump');
$databaseBackupExecutor->createDatabaseBackup();