Skip to content

Commit f8102e3

Browse files
committed
Fix compatibility with cakephp 3.7
1 parent 234fd6d commit f8102e3

7 files changed

+17
-15
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
composer.lock
2+
/vendor
3+
14
# IDE and editor specific files #
25
#################################
36
/nbproject

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"source": "https://github.com/passbolt/passbolt"
2323
},
2424
"require": {
25-
"cakephp/cakephp": "^3.5"
25+
"cakephp/cakephp": "^3.7"
2626
},
2727
"require-dev": {
2828
"phpunit/phpunit": "^5.7|^6.0"

src/Controller/EmailController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
use App\Controller\AppController;
1818
use Cake\Core\Configure;
1919
use Cake\Event\Event;
20-
use Cake\Network\Exception\HttpException;
21-
use Cake\Network\Exception\NotFoundException;
20+
use Cake\Http\Exception\HttpException;
21+
use Cake\Http\Exception\NotFoundException;
2222
use Cake\ORM\TableRegistry;
2323
use Cake\Validation\Validation;
2424

@@ -56,7 +56,7 @@ public function showLastEmail($username)
5656
throw new HttpException(__('Username not correct'));
5757
}
5858
// If username doesn't exist, we return an error.
59-
$Users = TableRegistry::get('Users');
59+
$Users = TableRegistry::getTableLocator()->get('Users');
6060
$u = $Users->find('all')
6161
->where(['username' => $username])
6262
->first();
@@ -65,7 +65,7 @@ public function showLastEmail($username)
6565
if (empty($u)) {
6666
throw new HttpException(__('The username does not exist.'));
6767
}
68-
$EmailQueue = TableRegistry::get('EmailQueue.EmailQueue');
68+
$EmailQueue = TableRegistry::getTableLocator()->get('EmailQueue.EmailQueue');
6969
$email = $EmailQueue->find('all')
7070
->where(['email' => $username])
7171
->order(['created' => 'DESC'])

src/Controller/ResetInstanceController.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
use App\Shell\Task\InstallTask;
1919
use Cake\Core\Configure;
2020
use Cake\Event\Event;
21-
use Cake\Network\Exception\InternalErrorException;
22-
use Cake\Network\Exception\NotFoundException;
21+
use Cake\Http\Exception\InternalErrorException;
22+
use Cake\Http\Exception\NotFoundException;
2323

2424
class ResetInstanceController extends AppController
2525
{

src/Controller/SimulateErrorController.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
use App\Controller\AppController;
1818
use Cake\Event\Event;
19-
use Cake\Network\Exception\BadRequestException;
20-
use Cake\Network\Exception\ForbiddenException;
21-
use Cake\Network\Exception\InternalErrorException;
22-
use Cake\Network\Exception\NotFoundException;
19+
use Cake\Http\Exception\BadRequestException;
20+
use Cake\Http\Exception\ForbiddenException;
21+
use Cake\Http\Exception\InternalErrorException;
22+
use Cake\Http\Exception\NotFoundException;
2323

2424
class SimulateErrorController extends AppController
2525
{

tests/TestCase/Controller/ConfigControllerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @link https://www.passbolt.com Passbolt(tm)
1313
* @since 2.0.0
1414
*/
15-
namespace App\Test\TestCase\Controller\SeleniumTests;
15+
namespace PassboltSeleniumApi\Test\TestCase\Controller\SeleniumTests;
1616

1717
use App\Test\Lib\AppIntegrationTestCase;
1818
use PassboltSeleniumApi\Controller\ConfigController;

tests/TestCase/Controller/SimulateErrorsControllerTest.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
* @link https://www.passbolt.com Passbolt(tm)
1313
* @since 2.0.0
1414
*/
15-
16-
namespace App\Test\TestCase\Controller\SeleniumTests;
15+
namespace PassboltSeleniumApi\Test\TestCase\Controller\SeleniumTests;
1716

1817
use App\Test\Lib\AppIntegrationTestCase;
1918
use Cake\Core\Configure;
2019

2120
class SimulateErrorsControllerTest extends AppIntegrationTestCase
2221
{
23-
public $fixtures = ['app.Base/users'];
22+
public $fixtures = ['app.Base/Users'];
2423

2524
public function testSimulateError404()
2625
{

0 commit comments

Comments
 (0)