Update composer depedencies to be the same as the advanced application (#262)

* Compatible with PHP 8.1 and Codeception 5
* Add PHP 8.1 to workflow
* PHP 7.4 as a minimum
* Updated dependencies

Co-authored-by: Luke English <luke.english@ec2i.biz>
This commit is contained in:
Luke English 2022-06-17 17:15:52 +01:00 committed by GitHub
parent 24d97b99f8
commit 9d3b84517a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 36 additions and 29 deletions

3
.gitignore vendored
View File

@ -18,6 +18,9 @@ Thumbs.db
# composer itself is not needed # composer itself is not needed
composer.phar composer.phar
# composer lock
composer.lock
# Mac DS_Store Files # Mac DS_Store Files
.DS_Store .DS_Store

View File

@ -26,6 +26,6 @@ class AppAsset extends AssetBundle
]; ];
public $depends = [ public $depends = [
'yii\web\YiiAsset', 'yii\web\YiiAsset',
'yii\bootstrap4\BootstrapAsset', 'yii\bootstrap5\BootstrapAsset'
]; ];
} }

View File

@ -2,7 +2,7 @@ actor: Tester
bootstrap: _bootstrap.php bootstrap: _bootstrap.php
paths: paths:
tests: tests tests: tests
log: tests/_output output: tests/_output
data: tests/_data data: tests/_data
helpers: tests/_support helpers: tests/_support
settings: settings:

View File

@ -15,20 +15,22 @@
"minimum-stability": "dev", "minimum-stability": "dev",
"require": { "require": {
"php": ">=7.4.0", "php": ">=7.4.0",
"yiisoft/yii2": "~2.0.14", "yiisoft/yii2": "~2.0.45",
"yiisoft/yii2-bootstrap4": "~2.0.0", "yiisoft/yii2-bootstrap5": "~2.0.2",
"yiisoft/yii2-symfonymailer": "~2.0.3" "yiisoft/yii2-symfonymailer": "~2.0.3"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-debug": "~2.1.0", "yiisoft/yii2-debug": "~2.1.0",
"yiisoft/yii2-gii": "~2.2.0", "yiisoft/yii2-gii": "~2.2.0",
"yiisoft/yii2-faker": "~2.0.0", "yiisoft/yii2-faker": "~2.0.0",
"codeception/codeception": "^4.0", "phpunit/phpunit": "~9.5.0",
"codeception/module-asserts": "^1.0", "codeception/codeception": "^5.0.0-alpha2 || ^4.0",
"codeception/module-yii2": "^1.0", "codeception/lib-innerbrowser": "^3.0 || ^1.1",
"codeception/module-filesystem": "^1.0", "codeception/module-asserts": "^3.0 || ^1.1",
"codeception/module-yii2": "dev-codecept5 || ^1.1",
"codeception/module-filesystem": "^3.0 || ^1.1",
"codeception/verify": "^2.2", "codeception/verify": "^2.2",
"symfony/browser-kit": ">=2.7 <=4.2.4" "symfony/browser-kit": "^6.0 || >=2.7 <=4.2.4"
}, },
"config": { "config": {
"allow-plugins": { "allow-plugins": {

View File

@ -16,6 +16,9 @@ return [
'components' => [ 'components' => [
'db' => $db, 'db' => $db,
'mailer' => [ 'mailer' => [
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' => '@app/mail',
// send all mails to a file by default.
'useFileTransport' => true, 'useFileTransport' => true,
'messageClass' => 'yii\symfonymailer\Message' 'messageClass' => 'yii\symfonymailer\Message'
], ],

View File

@ -27,10 +27,9 @@ $config = [
'errorAction' => 'site/error', 'errorAction' => 'site/error',
], ],
'mailer' => [ 'mailer' => [
'class' => 'yii\swiftmailer\Mailer', 'class' => \yii\symfonymailer\Mailer::class,
// send all mails to a file by default. You have to set 'viewPath' => '@app/mail',
// 'useFileTransport' to false and configure transport // send all mails to a file by default.
// for the mailer to send real emails.
'useFileTransport' => true, 'useFileTransport' => true,
], ],
'log' => [ 'log' => [

View File

@ -1,4 +1,4 @@
class_name: AcceptanceTester actor: AcceptanceTester
modules: modules:
enabled: enabled:
- WebDriver: - WebDriver:

View File

@ -6,7 +6,7 @@
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
#basic/web/index.php #basic/web/index.php
class_name: FunctionalTester actor: FunctionalTester
modules: modules:
enabled: enabled:
- Filesystem - Filesystem

View File

@ -3,7 +3,7 @@
# suite for unit (internal) tests. # suite for unit (internal) tests.
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. # RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
class_name: UnitTester actor: UnitTester
modules: modules:
enabled: enabled:
- Asserts - Asserts

View File

@ -31,7 +31,7 @@ class UserTest extends \Codeception\Test\Unit
/** /**
* @depends testFindUserByUsername * @depends testFindUserByUsername
*/ */
public function testValidateUser($user) public function testValidateUser()
{ {
$user = User::findByUsername('admin'); $user = User::findByUsername('admin');
verify($user->validateAuthKey('test100key'))->notEmpty(); verify($user->validateAuthKey('test100key'))->notEmpty();

View File

@ -5,10 +5,10 @@
use app\assets\AppAsset; use app\assets\AppAsset;
use app\widgets\Alert; use app\widgets\Alert;
use yii\bootstrap4\Breadcrumbs; use yii\bootstrap5\Breadcrumbs;
use yii\bootstrap4\Html; use yii\bootstrap5\Html;
use yii\bootstrap4\Nav; use yii\bootstrap5\Nav;
use yii\bootstrap4\NavBar; use yii\bootstrap5\NavBar;
AppAsset::register($this); AppAsset::register($this);
?> ?>

View File

@ -1,11 +1,11 @@
<?php <?php
/** @var yii\web\View $this */ /** @var yii\web\View $this */
/** @var yii\bootstrap4\ActiveForm $form */ /** @var yii\bootstrap5\ActiveForm $form */
/** @var app\models\ContactForm $model */ /** @var app\models\ContactForm $model */
use yii\bootstrap4\ActiveForm; use yii\bootstrap5\ActiveForm;
use yii\bootstrap4\Html; use yii\bootstrap5\Html;
use yii\captcha\Captcha; use yii\captcha\Captcha;
$this->title = 'Contact'; $this->title = 'Contact';

View File

@ -1,11 +1,11 @@
<?php <?php
/** @var yii\web\View $this */ /** @var yii\web\View $this */
/** @var yii\bootstrap4\ActiveForm $form */ /** @var yii\bootstrap5\ActiveForm $form */
/** @var app\models\LoginForm $model */ /** @var app\models\LoginForm $model */
use yii\bootstrap4\ActiveForm; use yii\bootstrap5\ActiveForm;
use yii\bootstrap4\Html; use yii\bootstrap5\Html;
$this->title = 'Login'; $this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;

View File

@ -23,7 +23,7 @@ use Yii;
* @author Kartik Visweswaran <kartikv2@gmail.com> * @author Kartik Visweswaran <kartikv2@gmail.com>
* @author Alexander Makarov <sam@rmcreative.ru> * @author Alexander Makarov <sam@rmcreative.ru>
*/ */
class Alert extends \yii\bootstrap4\Widget class Alert extends \yii\bootstrap5\Widget
{ {
/** /**
* @var array the alert types configuration for the flash messages. * @var array the alert types configuration for the flash messages.
@ -57,7 +57,7 @@ class Alert extends \yii\bootstrap4\Widget
$flash = $session->getFlash($type); $flash = $session->getFlash($type);
foreach ((array) $flash as $i => $message) { foreach ((array) $flash as $i => $message) {
echo \yii\bootstrap4\Alert::widget([ echo \yii\bootstrap5\Alert::widget([
'body' => $message, 'body' => $message,
'closeButton' => $this->closeButton, 'closeButton' => $this->closeButton,
'options' => array_merge($this->options, [ 'options' => array_merge($this->options, [