mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Update Yii2 framework to the latest version
This commit is contained in:
@@ -6,6 +6,7 @@ namespace api\modules\authserver;
|
||||
use Yii;
|
||||
use yii\base\BootstrapInterface;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\web\Response;
|
||||
|
||||
class Module extends \yii\base\Module implements BootstrapInterface {
|
||||
|
||||
@@ -13,7 +14,7 @@ class Module extends \yii\base\Module implements BootstrapInterface {
|
||||
|
||||
public $defaultRoute = 'index';
|
||||
|
||||
public function beforeAction($action) {
|
||||
public function beforeAction($action): bool {
|
||||
if (!parent::beforeAction($action)) {
|
||||
return false;
|
||||
}
|
||||
@@ -23,10 +24,18 @@ class Module extends \yii\base\Module implements BootstrapInterface {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function afterAction($action, $result) {
|
||||
if ($result === null) {
|
||||
Yii::$app->response->format = Response::FORMAT_RAW;
|
||||
}
|
||||
|
||||
return parent::afterAction($action, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \yii\base\Application $app
|
||||
*/
|
||||
public function bootstrap($app) {
|
||||
public function bootstrap($app): void {
|
||||
$legacyHost = $app->params['authserverHost'];
|
||||
$app->getUrlManager()->addRules([
|
||||
"//{$legacyHost}/authserver/auth/<action>" => "{$this->id}/authentication/<action>",
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace api\tests\functional\authserver;
|
||||
|
||||
use api\tests\_pages\AuthserverRoute;
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace api\tests\_support\models\authentication;
|
||||
|
||||
use api\components\ReCaptcha\Validator as ReCaptchaValidator;
|
||||
@@ -55,7 +57,8 @@ class RegistrationFormTest extends TestCase {
|
||||
}
|
||||
|
||||
public function testSignup() {
|
||||
Mock::func(EmailValidator::class, 'checkdnsrr')->andReturnTrue();
|
||||
Mock::func(EmailValidator::class, 'checkdnsrr')->andReturn(true);
|
||||
Mock::func(EmailValidator::class, 'dns_get_record')->andReturn(['']);
|
||||
$model = new RegistrationForm([
|
||||
'username' => 'some_username',
|
||||
'email' => 'some_email@example.com',
|
||||
@@ -72,7 +75,8 @@ class RegistrationFormTest extends TestCase {
|
||||
}
|
||||
|
||||
public function testSignupWithDefaultLanguage() {
|
||||
Mock::func(EmailValidator::class, 'checkdnsrr')->andReturnTrue();
|
||||
Mock::func(EmailValidator::class, 'checkdnsrr')->andReturn(true);
|
||||
Mock::func(EmailValidator::class, 'dns_get_record')->andReturn(['']);
|
||||
$model = new RegistrationForm([
|
||||
'username' => 'some_username',
|
||||
'email' => 'some_email@example.com',
|
||||
|
Reference in New Issue
Block a user