Merge pull request #2 from cakephp/2.x

2.x to phpunit-5.7
This commit is contained in:
Val Bancer 2017-08-03 02:10:37 +02:00 committed by GitHub
commit 746bb4619e
2 changed files with 13 additions and 9 deletions

View file

@ -1,5 +1,8 @@
language: php language: php
# We require precise here, as 5.3 doesn't exist on trusty.
dist: precise
php: php:
- 5.3 - 5.3
- 5.4 - 5.4
@ -37,8 +40,8 @@ matrix:
before_script: before_script:
- composer global require "phpunit/phpunit=$PHPUNIT" - composer require "phpunit/phpunit=$PHPUNIT"
- echo "require_once '$HOME/.composer/vendor/autoload.php';" >> app/Config/bootstrap.php - echo "require_once 'vendors/autoload.php';" >> app/Config/bootstrap.php
- sudo locale-gen de_DE - sudo locale-gen de_DE
- sudo locale-gen es_ES - sudo locale-gen es_ES
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
@ -49,8 +52,8 @@ before_script:
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi" - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE SCHEMA test3;' -U postgres -d cakephp_test; fi"
- chmod -R 777 ./app/tmp - chmod -R 777 ./app/tmp
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]] ; then pecl install timezonedb ; fi - if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.3" ]] ; then pecl install timezonedb ; fi
- sh -c "if [ '$PHPCS' = '1' ]; then composer global require 'cakephp/cakephp-codesniffer:1.*'; fi" - sh -c "if [ '$PHPCS' = '1' ]; then composer require 'cakephp/cakephp-codesniffer:1.*'; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then ~/.composer/vendor/bin/phpcs --config-set installed_paths ~/.composer/vendor/cakephp/cakephp-codesniffer; fi" - sh -c "if [ '$PHPCS' = '1' ]; then vendors/bin/phpcs --config-set installed_paths vendors/cakephp/cakephp-codesniffer; fi"
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install apcu-5.1.3 || true; fi - if [[ ${TRAVIS_PHP_VERSION:0:1} == "7" ]] ; then echo "yes" | pecl install apcu-5.1.3 || true; fi
- if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi - if [[ ${TRAVIS_PHP_VERSION:0:1} == "5" ]] ; then echo "yes" | pecl install apcu-4.0.11 || true; fi
@ -62,8 +65,8 @@ before_script:
private \$identities = array( private \$identities = array(
'mysql' => array( 'mysql' => array(
'datasource' => 'Database/Mysql', 'datasource' => 'Database/Mysql',
'host' => '0.0.0.0', 'host' => '127.0.0.1',
'login' => 'travis' 'login' => 'root'
), ),
'pgsql' => array( 'pgsql' => array(
'datasource' => 'Database/Postgres', 'datasource' => 'Database/Postgres',
@ -136,9 +139,10 @@ before_script:
} }
} }
}" > app/Config/database.php }" > app/Config/database.php
script: script:
- sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi" - sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then ~/.composer/vendor/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;" - sh -c "if [ '$PHPCS' = '1' ]; then vendors/bin/phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;"
notifications: notifications:
email: false email: false

View file

@ -2832,12 +2832,12 @@ class Model extends CakeObject implements CakeEventListener {
if (!$cascade && !$callbacks) { if (!$cascade && !$callbacks) {
return $db->delete($this, $conditions); return $db->delete($this, $conditions);
} }
$recursive = min($this->recursive, 0);
$ids = $this->find('all', array_merge(array( $ids = $this->find('all', array_merge(array(
'fields' => "{$this->alias}.{$this->primaryKey}", 'fields' => "{$this->alias}.{$this->primaryKey}",
'order' => false, 'order' => false,
'group' => "{$this->alias}.{$this->primaryKey}", 'group' => "{$this->alias}.{$this->primaryKey}",
'recursive' => $recursive), compact('conditions')) 'recursive' => 0), compact('conditions'))
); );
if ($ids === false || $ids === null) { if ($ids === false || $ids === null) {