Skip to content

Commit e77d8f9

Browse files
committed
remove deprecated calls, require cakephp ^3.5
1 parent 1759704 commit e77d8f9

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"cakephp/cakephp": "~3.0",
15+
"cakephp/cakephp": "^3.5",
1616
"php": ">=5.6"
1717
},
1818
"require-dev": {

src/Model/Behavior/SearchableBehavior.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ class SearchableBehavior extends Behavior
2929
*/
3030
public function initialize(array $config)
3131
{
32-
$connection = $this->_table->connection();
32+
$connection = $this->_table->getConnection();
3333

3434
//ensure database engine is MySQL
35-
if (!$connection->driver() instanceof Mysql) {
35+
if (!$connection->getDriver() instanceof Mysql) {
3636
throw new SearchableFatalException('Only MySQL is supported');
3737
}
3838

3939
//build a whitelist of string/text columns
40-
$collection = $connection->schemaCollection();
41-
$columns = $collection->describe($this->_table->table())->columns();
40+
$collection = $connection->getSchemaCollection();
41+
$columns = $collection->describe($this->_table->getTable())->columns();
4242
foreach ($columns as $column) {
43-
$columnInfo = $collection->describe($this->_table->table())->column($column);
43+
$columnInfo = $collection->describe($this->_table->getTable())->getColumn($column);
4444
if (($columnInfo['type'] == 'string') || ($columnInfo['type'] == 'text')) {
4545
$this->_columnsWhitelist[] = $column;
46-
$this->_columnsWhitelist[] = $this->_table->alias() . '.' . $column;
46+
$this->_columnsWhitelist[] = $this->_table->getAlias() . '.' . $column;
4747
}
4848
}
4949
}

tests/TestCase/Model/Behavior/SearchableBehaviorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testInvalidDB()
106106
$this->setExpectedException('Chris48s\Searchable\Exception\SearchableFatalException');
107107

108108
//set up a SQLite DB connection - SQLite is not supported
109-
ConnectionManager::config('invalid', [
109+
ConnectionManager::setConfig('invalid', [
110110
'url' => 'sqlite:///:memory:',
111111
'timezone' => 'UTC'
112112
]);

tests/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
]
6767
];
6868

69-
Cake\Cache\Cache::config($cache);
69+
Cake\Cache\Cache::setConfig($cache);
7070
Cake\Core\Configure::write('Session', [
7171
'defaults' => 'php'
7272
]);
@@ -78,7 +78,7 @@
7878
putenv('db_dsn=sqlite:///:memory:');
7979
}
8080

81-
Cake\Datasource\ConnectionManager::config('test', [
81+
Cake\Datasource\ConnectionManager::setConfig('test', [
8282
'url' => getenv('db_dsn'),
8383
'timezone' => 'UTC'
8484
]);

0 commit comments

Comments
 (0)