AimeosTestAbstract::getEnvironmentSetUp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 45
Code Lines 36

Duplication

Lines 0
Ratio 0 %

Importance

Changes 14
Bugs 0 Features 0
Metric Value
eloc 36
c 14
b 0
f 0
dl 0
loc 45
rs 9.344
nc 1
nop 1
cc 1
1
<?php
2
3
class AimeosTestAbstract extends Orchestra\Testbench\BrowserKit\TestCase
4
{
5
	protected function getEnvironmentSetUp($app)
6
	{
7
		putenv( 'APP_DEBUG=1' );
8
9
		$app['config']->set('app.key', 'SomeRandomStringWith32Characters');
10
		$app['config']->set('app.cipher', 'AES-256-CBC');
11
12
		$app['config']->set('database.default', 'mysql');
13
		$app['config']->set('database.connections.mysql', [
14
			'driver' => 'mysql',
15
			'host' => env('DB_HOST', '127.0.0.1'),
16
            'port' => env('DB_PORT', '3306'),
17
			'database' => env('DB_DATABASE', 'laravel'),
18
			'username' => env('DB_USERNAME', 'aimeos'),
19
			'password' => env('DB_PASSWORD', 'aimeos'),
20
            'unix_socket' => env('DB_SOCKET', ''),
21
			'collation' => 'utf8_unicode_ci',
22
		]);
23
24
		$app['config']->set('shop.resource.db', [
25
			'adapter' => 'mysql',
26
			'host' => env('DB_HOST', '127.0.0.1'),
27
			'database' => env('DB_DATABASE', 'laravel'),
28
			'username' => env('DB_USERNAME', 'aimeos'),
29
			'password' => env('DB_PASSWORD', 'aimeos'),
30
			'stmt' => ["SET SESSION sort_buffer_size=2097144; SET SESSION sql_mode='ANSI'; SET NAMES 'utf8_bin'"],
31
			'opt-persistent' => 0,
32
			'limit' => 3,
33
			'defaultTableOptions' => [
34
				'collate' => 'utf8_unicode_ci',
35
				'charset' => 'utf8',
36
			],
37
		]);
38
39
		$app['config']->set('shop.authorize', false);
40
		$app['config']->set('shop.disableSites', false);
41
		$app['config']->set('shop.accessControl', false);
42
		$app['config']->set('shop.routes.jqadm', ['prefix' => '{site}/jqadm']);
43
		$app['config']->set('shop.routes.jsonadm', ['prefix' => '{site}/jsonadm']);
44
		$app['config']->set('shop.routes.jsonapi', ['prefix' => '{site}/jsonapi']);
45
		$app['config']->set('shop.routes.account', ['prefix' => '{site}/myaccount']);
46
		$app['config']->set('shop.routes.default', ['prefix' => '{site}/shop']);
47
		$app['config']->set('shop.routes.update', ['prefix' => '{site}']);
48
		$app['config']->set('shop.routes.login', []);
49
		$app['config']->set('shop.extdir', dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'ext' );
50
	}
51
52
53
	protected function getPackageProviders($app)
54
	{
55
		return ['Aimeos\Shop\ShopServiceProvider'];
56
	}
57
}