Skip to content

Commit a7ecf41

Browse files
authored
Merge pull request #15 from josegonzalez/patch-1
fix: remove deprecated code usage
2 parents eaa9469 + f1393a0 commit a7ecf41

5 files changed

Lines changed: 14 additions & 15 deletions

File tree

.travis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ matrix:
2323

2424
- php: 7.0
2525
env: PHPSTAN=1 DEFAULT=0
26+
27+
- php: 5.6
28+
env: PREFER_LOWEST=1
2629

27-
before_install:
30+
before_script:
2831
- if [[ $TRAVIS_PHP_VERSION != 7.0 ]]; then phpenv config-rm xdebug.ini; fi
2932

33+
- if [[ $PREFER_LOWEST != 1 ]]; then composer update --no-interaction; fi
34+
- if [[ $PREFER_LOWEST == 1 ]]; then composer update --no-interaction --prefer-lowest --prefer-stable; fi
35+
3036
- if [[ $DB = 'mysql' ]]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
3137
- if [[ $DB = 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
3238

33-
before_script:
34-
- composer install --prefer-dist --no-interaction
35-
3639
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan:^0.9; fi
3740

3841
script:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"require-dev": {
3636
"cakephp/cakephp-codesniffer": "^3.0",
37-
"phpunit/phpunit": "@stable",
37+
"phpunit/phpunit": "^5.7.14|^6.0",
3838
"cakephp/migrations": "^1.0"
3939
},
4040
"autoload": {

src/Model/Behavior/TokenizeBehavior.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function initialize(array $config)
3737
'className' => 'Muffin/Tokenize.Tokens',
3838
'foreignKey' => 'foreign_key',
3939
'conditions' => [
40-
'foreign_alias' => $this->_table->alias(),
41-
'foreign_table' => $this->_table->table(),
40+
'foreign_alias' => $this->_table->getAlias(),
41+
'foreign_table' => $this->_table->getTable(),
4242
],
4343
'dependent' => true,
4444
]);

tests/TestCase/Controller/TokensControllerTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ class TokensControllerTest extends TestCase
1414
public function testVerify()
1515
{
1616
$request = new ServerRequest();
17-
$request->addParams([
18-
'token' => 'foo',
19-
]);
20-
21-
$controller = new TokensController($request, new Response());
17+
$controller = new TokensController($request->withParam('token', 'foo'), new Response());
2218
$controller->Tokens = $this->getMockForModel('Muffin/Tokenize.Tokens', ['verify']);
2319
$controller->Tokens->expects($this->once())
2420
->method('verify')

tests/TestCase/Model/Behavior/TokenizeBehaviorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testBeforeSaveWithExistingEntity()
9393
'alias' => 'Users',
9494
]])
9595
->getMock();
96-
$table->primaryKey('id');
96+
$table->setPrimaryKey('id');
9797
$table->expects($this->once())
9898
->method('dispatchEvent')
9999
->with('Model.afterTokenize', compact('entity', 'token'));
@@ -129,7 +129,7 @@ public function testAfterSave()
129129
'alias' => 'Users',
130130
]])
131131
->getMock();
132-
$table->primaryKey('id');
132+
$table->setPrimaryKey('id');
133133
$table->expects($this->once())
134134
->method('dispatchEvent')
135135
->with('Model.afterTokenize', compact('entity', 'token'));
@@ -170,7 +170,7 @@ public function testTokenize()
170170
'alias' => 'Users',
171171
]])
172172
->getMock();
173-
$table->primaryKey('id');
173+
$table->setPrimaryKey('id');
174174

175175
$table->Tokens = $this->getMockBuilder('Muffin\Tokenize\Model\Table\TokensTable')
176176
->setMethods(['newEntity', 'save'])

0 commit comments

Comments
 (0)