Skip to content

Commit

Permalink
Merge pull request #13 from sizuhiko/update-cakephp-3.6
Browse files Browse the repository at this point in the history
Update test codes to CakePHP 3.6
  • Loading branch information
sizuhiko authored May 28, 2018
2 parents 6f74e79 + 4f9c402 commit e4ade30
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
Expand All @@ -15,13 +13,13 @@ env:
matrix:
fast_finish: true
include:
- php: 5.4
- php: 5.6
env:
- COVERALLS=1
- php: 5.4
- php: 5.6
env:
- PHPCS=1
- php: 5.4
- php: 5.6
env:
- FOC_VALIDATE=1

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "CakeFabricate plugin for CakePHP",
"type": "cakephp-plugin",
"require": {
"php": ">=5.4",
"cakephp/cakephp": "~3.0",
"php": ">=5.6",
"cakephp/cakephp": "~3.6",
"sizuhiko/fabricate": "~2.0"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/CakeFabricateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testBuildErrorIfValidateTrue() {
$result = Fabricate::build('Posts', function($data){
return ["title" => ""];
});
$this->assertArrayHasKey('title', $result->errors());
$this->assertArrayHasKey('title', $result->getErrors());
}

public function testCreate() {
Expand Down
4 changes: 2 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'templates' => [ROOT . 'App' . DS . 'Template' . DS]
]
]);
Cache::config([
Cache::setConfig([
'_cake_core_' => [
'engine' => 'File',
'prefix' => 'cake_core_',
Expand All @@ -64,7 +64,7 @@
if (!getenv('db_dsn')) {
putenv('db_dsn=sqlite:///:memory:');
}
ConnectionManager::config('test', ['url' => getenv('db_dsn')]);
ConnectionManager::setConfig('test', ['url' => getenv('db_dsn')]);

Plugin::load('CakeFabricate', [
'path' => dirname(dirname(__FILE__)) . DS,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_app/Model/Table/PostsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class PostsTable extends Table
*/
public function initialize(array $config)
{
$this->table('posts');
$this->displayField('title');
$this->primaryKey('id');
$this->setTable('posts');
$this->setDisplayField('title');
$this->setPrimaryKey('id');
$this->addBehavior('Timestamp');
$this->belongsTo('Author', [
'className' => 'CakeFabricate\Test\App\Model\Table\UsersTable',
Expand Down
6 changes: 3 additions & 3 deletions tests/test_app/Model/Table/UsersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class UsersTable extends Table
*/
public function initialize(array $config)
{
$this->table('users');
$this->displayField('username');
$this->primaryKey('id');
$this->setTable('users');
$this->setDisplayField('username');
$this->setPrimaryKey('id');
$this->addBehavior('Timestamp');
$this->hasMany('Posts', [
'className' => 'CakeFabricate\Test\App\Model\Table\PostsTable',
Expand Down

0 comments on commit e4ade30

Please sign in to comment.