Skip to content

Commit 938d5b2

Browse files
committed
Upgrade to CakePHP 3.6+.
1 parent cd12e96 commit 938d5b2

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

.travis.yml

+11-9
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ matrix:
1818
fast_finish: true
1919

2020
include:
21-
- php: 7.1
22-
env: PHPCS=1 DEFAULT=0
23-
2421
- php: 7.1
2522
env: DB=pgsql db_dsn='postgres://[email protected]/cakephp_test'
2623

@@ -30,6 +27,12 @@ matrix:
3027
- php: 5.6
3128
env: PREFER_LOWEST=1
3229

30+
- php: 7.1
31+
env: CODECOVERAGE=1 DEFAULT=0
32+
33+
- php: 7.1
34+
env: PHPCS=1 DEFAULT=0
35+
3336
before_script:
3437
- if [[ $PHPCS != 1 ]]; then composer require phpunit/phpunit:"^5.7.14|^6.0" ; fi
3538

@@ -44,13 +47,12 @@ before_script:
4447
- cp phpunit.xml.dist phpunit.xml
4548

4649
script:
47-
- if [[ $DEFAULT == 1 && $TRAVIS_PHP_VERSION == 7.0 ]]; then export CODECOVERAGE=1; vendor/bin/phpunit --coverage-clover=clover.xml ; fi
48-
- if [[ $DEFAULT == 1 && $TRAVIS_PHP_VERSION != 7.0 ]]; then vendor/bin/phpunit ; fi
49-
50-
- if [[ $PHPCS == 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/vendor/,/tmp/,/logs/,/config/Migrations/ -v . ; fi
50+
- if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
51+
- if [[ $PHPCS == 1 ]]; then composer cs-check ; fi
5152

52-
after_success:
53-
- if [[ $DEFAULT == 1 && $TRAVIS_PHP_VERSION == 7.0 ]]; then bash <(curl -s https://codecov.io/bash) ; fi
53+
- if [[ $CODECOVERAGE == 1 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml || true; fi
54+
- if [[ $CODECOVERAGE == 1 ]]; then wget -O codecov.sh https://codecov.io/bash; fi
55+
- if [[ $CODECOVERAGE == 1 ]]; then bash codecov.sh; fi
5456

5557
notifications:
5658
email: false

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-queue/d/total)](https://packagist.org/packages/dereuromark/cakephp-queue)
88
[![Coding Standards](https://img.shields.io/badge/cs-PSR--2--R-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards)
99

10-
This branch is for use with **CakePHP 3**.
10+
This branch is for use with **CakePHP 3.5+**.
1111

1212

1313
## Background

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": ">=5.6",
22-
"cakephp/cakephp": "^3.4.1"
22+
"cakephp/cakephp": "^3.5"
2323
},
2424
"require-dev": {
2525
"cakephp/migrations": "^1.0",

phpunit.xml.dist

+10-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010
stopOnFailure="false"
1111
stopOnIncomplete="false"
1212
stopOnSkipped="false"
13-
syntaxCheck="false">
14-
13+
syntaxCheck="false"
14+
>
15+
<php>
16+
<!-- E_ALL => 32767 -->
17+
<!-- E_ALL & ~E_USER_DEPRECATED => 16383 -->
18+
<ini name="error_reporting" value="16383"/>
19+
</php>
1520
<testsuites>
16-
<testsuite name="Geo">
17-
<directory>./tests/</directory>
21+
<testsuite name="geo">
22+
<directory>tests/</directory>
1823
</testsuite>
1924
</testsuites>
2025

@@ -29,7 +34,7 @@
2934
<!-- Prevent coverage reports from looking in tests, vendors, config folders -->
3035
<filter>
3136
<whitelist>
32-
<directory suffix=".php">./src/</directory>
37+
<directory suffix=".php">src/</directory>
3338
</whitelist>
3439
</filter>
3540

tests/bootstrap.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
],
8282
];
8383

84-
Cake\Cache\Cache::config($cache);
84+
Cake\Cache\Cache::setConfig($cache);
8585

8686
Cake\Core\Plugin::load('Queue', ['path' => ROOT . DS, 'autoload' => true, 'bootstrap' => false, 'routes' => true]);
8787
Cake\Core\Plugin::load('Foo', ['path' => ROOT . DS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'Foo' . DS]);
@@ -90,20 +90,20 @@
9090
DispatcherFactory::add('Routing');
9191
DispatcherFactory::add('ControllerFactory');
9292

93-
Cake\Mailer\Email::configTransport('default', [
93+
Cake\Mailer\Email::setConfigTransport('default', [
9494
'className' => 'Debug',
9595
]);
96-
Cake\Mailer\Email::configTransport('queue', [
96+
Cake\Mailer\Email::setConfigTransport('queue', [
9797
'className' => 'Queue.Queue',
9898
]);
99-
Cake\Mailer\Email::config('default', [
99+
Cake\Mailer\Email::setConfig('default', [
100100
'transport' => 'default',
101101
]);
102102

103103
// Allow local overwrite
104104
// E.g. in your console: export db_dsn="mysql://root:[email protected]/cake_test"
105105
if (!getenv('db_class') && getenv('db_dsn')) {
106-
ConnectionManager::config('test', ['url' => getenv('db_dsn')]);
106+
ConnectionManager::setConfig('test', ['url' => getenv('db_dsn')]);
107107
return;
108108
}
109109
if (!getenv('db_class')) {
@@ -112,7 +112,7 @@
112112
}
113113

114114
// Uses Travis config then (MySQL, Postgres, ...)
115-
ConnectionManager::config('test', [
115+
ConnectionManager::setConfig('test', [
116116
'className' => 'Cake\Database\Connection',
117117
'driver' => getenv('db_class'),
118118
'dsn' => getenv('db_dsn'),

0 commit comments

Comments
 (0)