Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ php:
- 7.1
- 7.2

services:
- mysql
- postgresql

env:
matrix:
- DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
Expand Down Expand Up @@ -37,7 +41,7 @@ before_script:
- if [[ $DB = 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi
- if [[ $DB = 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi

- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer; fi
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:^3.0; fi
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan; fi

script:
Expand Down
3 changes: 2 additions & 1 deletion src/Model/Entity/TagAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public function untag($tags = null)

foreach ($untags as $untag) {
foreach ($tags as $k => $tag) {
if ((empty($untag[$pk]) || $tag[$pk] === $untag[$pk]) &&
if (
(empty($untag[$pk]) || $tag[$pk] === $untag[$pk]) &&
(empty($untag[$df]) || $tag[$df] === $untag[$df])
) {
unset($tags[$k]);
Expand Down
6 changes: 5 additions & 1 deletion src/Model/Table/TagsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ public function initialize(array $config)
$this->setTable('tags_tags');
$this->setDisplayField('label');
$this->addBehavior('Timestamp');
if (Plugin::loaded('Muffin/Slug')) {
$method = 'isLoaded';
if (!method_exists(Plugin::class, 'isLoaded')) {
$method = 'loaded';
}
if (Plugin::{$method}('Muffin/Slug')) {
$this->addBehavior('Muffin/Slug.Slug');
}
}
Expand Down
2 changes: 0 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@
}

require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';

\Cake\Core\Plugin::load('Muffin/Tags', ['path' => dirname(dirname(__FILE__)) . DS]);