Skip to content

Commit

Permalink
Update fixtures + bootstrap.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeta committed Sep 13, 2015
1 parent d0d94a5 commit 6b13e42
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 86 deletions.
73 changes: 37 additions & 36 deletions tests/Fixture/UsersFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
];
}
100 changes: 50 additions & 50 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);

0 comments on commit 6b13e42

Please sign in to comment.