phpcbf and added .gitea workflows
This commit is contained in:
@@ -7,20 +7,19 @@ use Cake\Core\Configure;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Database\Connection;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\TestSuite\Fixture\SchemaLoader;
|
||||
use CakeProducts\CakeProductsPlugin;
|
||||
use CakeCarts\CakeCartsPlugin;
|
||||
use Migrations\TestSuite\Migrator;
|
||||
use TestApp\Controller\AppController;
|
||||
|
||||
if (!defined('DS')) {
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
}
|
||||
if (!defined('WINDOWS')) {
|
||||
if (DS === '\\' || substr(PHP_OS, 0, 3) === 'WIN') {
|
||||
define('WINDOWS', true);
|
||||
} else {
|
||||
define('WINDOWS', false);
|
||||
}
|
||||
if (DS === '\\' || substr(PHP_OS, 0, 3) === 'WIN') {
|
||||
define('WINDOWS', true);
|
||||
} else {
|
||||
define('WINDOWS', false);
|
||||
}
|
||||
}
|
||||
|
||||
define('PLUGIN_ROOT', dirname(__DIR__));
|
||||
@@ -45,69 +44,69 @@ require CORE_PATH . 'config/bootstrap.php';
|
||||
require CAKE . 'functions.php';
|
||||
|
||||
Configure::write('App', [
|
||||
'namespace' => 'TestApp',
|
||||
'encoding' => 'UTF-8',
|
||||
'paths' => [
|
||||
'testWebroot' => PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS,
|
||||
'webroot' => PLUGIN_ROOT . DS . 'webroot' . DS,
|
||||
'templates' => [
|
||||
PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'templates' . DS,
|
||||
],
|
||||
],
|
||||
'namespace' => 'TestApp',
|
||||
'encoding' => 'UTF-8',
|
||||
'paths' => [
|
||||
'testWebroot' => PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'webroot' . DS,
|
||||
'webroot' => PLUGIN_ROOT . DS . 'webroot' . DS,
|
||||
'templates' => [
|
||||
PLUGIN_ROOT . DS . 'tests' . DS . 'test_app' . DS . 'templates' . DS,
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
Configure::write('debug', true);
|
||||
Configure::write('CakeCarts', [
|
||||
'Carts' => [
|
||||
'table' => 'CakeCarts.Carts',
|
||||
],
|
||||
'CartItems' => [
|
||||
'requirePricing' => false,
|
||||
],
|
||||
'Users' => [
|
||||
'user_id' => 'uuid', // integer or uuid
|
||||
],
|
||||
'Carts' => [
|
||||
'table' => 'CakeCarts.Carts',
|
||||
],
|
||||
'CartItems' => [
|
||||
'requirePricing' => false,
|
||||
],
|
||||
'Users' => [
|
||||
'user_id' => 'uuid', // integer or uuid
|
||||
],
|
||||
]);
|
||||
|
||||
$cache = [
|
||||
'default' => [
|
||||
'engine' => 'File',
|
||||
'path' => CACHE,
|
||||
],
|
||||
'_cake_translations_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_myapp_cake_core_',
|
||||
'path' => CACHE . 'persistent/',
|
||||
'serialize' => true,
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
'_cake_model_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_my_app_cake_model_',
|
||||
'path' => CACHE . 'models/',
|
||||
'serialize' => 'File',
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
'default' => [
|
||||
'engine' => 'File',
|
||||
'path' => CACHE,
|
||||
],
|
||||
'_cake_translations_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_myapp_cake_core_',
|
||||
'path' => CACHE . 'persistent/',
|
||||
'serialize' => true,
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
'_cake_model_' => [
|
||||
'className' => 'File',
|
||||
'prefix' => 'crud_my_app_cake_model_',
|
||||
'path' => CACHE . 'models/',
|
||||
'serialize' => 'File',
|
||||
'duration' => '+10 seconds',
|
||||
],
|
||||
];
|
||||
|
||||
Cache::setConfig($cache);
|
||||
|
||||
class_alias(AppController::class, 'App\Controller\AppController');
|
||||
|
||||
Plugin::getCollection()->add(new \CakeCarts\CakeCartsPlugin());
|
||||
Plugin::getCollection()->add(new CakeCartsPlugin());
|
||||
|
||||
Chronos::setTestNow(Chronos::now());
|
||||
|
||||
if (!getenv('DB_URL')) {
|
||||
putenv('DB_URL=sqlite:///:memory:');
|
||||
putenv('DB_URL=sqlite:///:memory:');
|
||||
}
|
||||
|
||||
ConnectionManager::setConfig('test', [
|
||||
'className' => Connection::class,
|
||||
'url' => getenv('DB_URL') ?: null,
|
||||
'timezone' => 'UTC',
|
||||
'quoteIdentifiers' => false,
|
||||
'cacheMetadata' => true,
|
||||
'className' => Connection::class,
|
||||
'url' => getenv('DB_URL') ?: null,
|
||||
'timezone' => 'UTC',
|
||||
'quoteIdentifiers' => false,
|
||||
'cacheMetadata' => true,
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user