diff --git a/tests/Fixture/UsersFixture.php b/tests/Fixture/UsersFixture.php index d089120..776aaad 100644 --- a/tests/Fixture/UsersFixture.php +++ b/tests/Fixture/UsersFixture.php @@ -3,42 +3,43 @@ use Cake\TestSuite\Fixture\TestFixture; -class UsersFixture extends TestFixture { +class UsersFixture extends TestFixture +{ -/** - * Fields - * - * @var array - */ - public $fields = [ - 'id' => ['type' => 'integer'], - 'username' => ['type' => 'string', 'length' => 20], - 'avatar' => ['type' => 'string', 'length' => 255, 'default' => '../img/avatar.png'], - 'banner' => ['type' => 'string', 'length' => 255, 'default' => '../img/banner.png'], - '_constraints' => [ - 'primary' => ['type' => 'primary', 'columns' => ['id']], - 'username' => ['type' => 'unique', 'columns' => ['username']] - ], - '_options' => [ - 'engine' => 'InnoDB', 'collation' => 'utf8_general_ci' - ], - ]; + /** + * Fields + * + * @var array + */ + public $fields = [ + 'id' => ['type' => 'integer'], + 'username' => ['type' => 'string', 'length' => 20], + 'avatar' => ['type' => 'string', 'length' => 255, 'default' => '../img/avatar.png'], + 'banner' => ['type' => 'string', 'length' => 255, 'default' => '../img/banner.png'], + '_constraints' => [ + 'primary' => ['type' => 'primary', 'columns' => ['id']], + 'username' => ['type' => 'unique', 'columns' => ['username']] + ], + '_options' => [ + 'engine' => 'InnoDB', 'collation' => 'utf8_general_ci' + ], + ]; -/** - * Records - * - * @var array - */ - public $records = [ - [ - 'username' => 'mariano', - 'avatar' => '../img/avatar.png', - 'banner' => '../img/banner.png' - ], - [ - 'username' => 'larry', - 'avatar' => '../img/avatar.png', - 'banner' => '../img/banner.png' - ] - ]; + /** + * Records + * + * @var array + */ + public $records = [ + [ + 'username' => 'mariano', + 'avatar' => '../img/avatar.png', + 'banner' => '../img/banner.png' + ], + [ + 'username' => 'larry', + 'avatar' => '../img/avatar.png', + 'banner' => '../img/banner.png' + ] + ]; } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 9069986..c38f7dc 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -34,71 +34,71 @@ Configure::write('debug', true); Configure::write('App', [ - 'namespace' => 'App', - 'encoding' => 'UTF-8', - 'base' => false, - 'baseUrl' => false, - 'dir' => 'src', - 'webroot' => 'webroot', - 'www_root' => APP . 'webroot', - 'fullBaseUrl' => 'http://localhost', - 'imageBaseUrl' => 'img/', - 'jsBaseUrl' => 'js/', - 'cssBaseUrl' => 'css/', - 'paths' => [ - 'plugins' => [APP . 'Plugin' . DS], - 'templates' => [APP . 'Template' . DS] - ] + 'namespace' => 'App', + 'encoding' => 'UTF-8', + 'base' => false, + 'baseUrl' => false, + 'dir' => 'src', + 'webroot' => 'webroot', + 'www_root' => APP . 'webroot', + 'fullBaseUrl' => 'http://localhost', + 'imageBaseUrl' => 'img/', + 'jsBaseUrl' => 'js/', + 'cssBaseUrl' => 'css/', + 'paths' => [ + 'plugins' => [APP . 'Plugin' . DS], + 'templates' => [APP . 'Template' . DS] + ] ]); Configure::write('Session', [ - 'defaults' => 'php' + 'defaults' => 'php' ]); Cache::config([ - '_cake_core_' => [ - 'engine' => 'File', - 'prefix' => 'cake_core_', - 'serialize' => true - ], - '_cake_model_' => [ - 'engine' => 'File', - 'prefix' => 'cake_model_', - 'serialize' => true - ], - 'default' => [ - 'engine' => 'File', - 'prefix' => 'default_', - 'serialize' => true - ] + '_cake_core_' => [ + 'engine' => 'File', + 'prefix' => 'cake_core_', + 'serialize' => true + ], + '_cake_model_' => [ + 'engine' => 'File', + 'prefix' => 'cake_model_', + 'serialize' => true + ], + 'default' => [ + 'engine' => 'File', + 'prefix' => 'default_', + 'serialize' => true + ] ]); // Ensure default test connection is defined if (!getenv('db_class')) { - putenv('db_class=Cake\Database\Driver\Sqlite'); - putenv('db_dsn=sqlite::memory:'); + putenv('db_class=Cake\Database\Driver\Sqlite'); + putenv('db_dsn=sqlite::memory:'); } ConnectionManager::config('test', [ - 'className' => 'Cake\Database\Connection', - 'driver' => getenv('db_class'), - 'dsn' => getenv('db_dsn'), - 'database' => getenv('db_database'), - 'username' => getenv('db_login'), - 'password' => getenv('db_password'), - 'timezone' => 'UTC' + 'className' => 'Cake\Database\Connection', + 'driver' => getenv('db_class'), + 'dsn' => getenv('db_dsn'), + 'database' => getenv('db_database'), + 'username' => getenv('db_login'), + 'password' => getenv('db_password'), + 'timezone' => 'UTC' ]); Log::config([ - 'debug' => [ - 'engine' => 'Cake\Log\Engine\FileLog', - 'levels' => ['notice', 'info', 'debug'], - 'file' => 'debug', - ], - 'error' => [ - 'engine' => 'Cake\Log\Engine\FileLog', - 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], - 'file' => 'error', - ] + 'debug' => [ + 'engine' => 'Cake\Log\Engine\FileLog', + 'levels' => ['notice', 'info', 'debug'], + 'file' => 'debug', + ], + 'error' => [ + 'engine' => 'Cake\Log\Engine\FileLog', + 'levels' => ['warning', 'error', 'critical', 'alert', 'emergency'], + 'file' => 'error', + ] ]); Plugin::load('Xety/Cake3Upload', ['path' => ROOT]);