Skip to content

Commit

Permalink
Update composer depedencies to be the same as the advanced application (
Browse files Browse the repository at this point in the history
#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>
  • Loading branch information
developedsoftware and Luke English authored Jun 17, 2022
1 parent 24d97b9 commit 9d3b845
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Thumbs.db
# composer itself is not needed
composer.phar

# composer lock
composer.lock

# Mac DS_Store Files
.DS_Store

Expand Down
2 changes: 1 addition & 1 deletion assets/AppAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ class AppAsset extends AssetBundle
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap4\BootstrapAsset',
'yii\bootstrap5\BootstrapAsset'
];
}
2 changes: 1 addition & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ actor: Tester
bootstrap: _bootstrap.php
paths:
tests: tests
log: tests/_output
output: tests/_output
data: tests/_data
helpers: tests/_support
settings:
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@
"minimum-stability": "dev",
"require": {
"php": ">=7.4.0",
"yiisoft/yii2": "~2.0.14",
"yiisoft/yii2-bootstrap4": "~2.0.0",
"yiisoft/yii2": "~2.0.45",
"yiisoft/yii2-bootstrap5": "~2.0.2",
"yiisoft/yii2-symfonymailer": "~2.0.3"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.1.0",
"yiisoft/yii2-gii": "~2.2.0",
"yiisoft/yii2-faker": "~2.0.0",
"codeception/codeception": "^4.0",
"codeception/module-asserts": "^1.0",
"codeception/module-yii2": "^1.0",
"codeception/module-filesystem": "^1.0",
"phpunit/phpunit": "~9.5.0",
"codeception/codeception": "^5.0.0-alpha2 || ^4.0",
"codeception/lib-innerbrowser": "^3.0 || ^1.1",
"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",
"symfony/browser-kit": ">=2.7 <=4.2.4"
"symfony/browser-kit": "^6.0 || >=2.7 <=4.2.4"
},
"config": {
"allow-plugins": {
Expand Down
3 changes: 3 additions & 0 deletions config/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
'components' => [
'db' => $db,
'mailer' => [
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' => '@app/mail',
// send all mails to a file by default.
'useFileTransport' => true,
'messageClass' => 'yii\symfonymailer\Message'
],
Expand Down
7 changes: 3 additions & 4 deletions config/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure transport
// for the mailer to send real emails.
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' => '@app/mail',
// send all mails to a file by default.
'useFileTransport' => true,
],
'log' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance.suite.yml.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class_name: AcceptanceTester
actor: AcceptanceTester
modules:
enabled:
- WebDriver:
Expand Down
2 changes: 1 addition & 1 deletion tests/functional.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
#basic/web/index.php
class_name: FunctionalTester
actor: FunctionalTester
modules:
enabled:
- Filesystem
Expand Down
2 changes: 1 addition & 1 deletion tests/unit.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# suite for unit (internal) tests.
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.

class_name: UnitTester
actor: UnitTester
modules:
enabled:
- Asserts
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/models/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testFindUserByUsername()
/**
* @depends testFindUserByUsername
*/
public function testValidateUser($user)
public function testValidateUser()
{
$user = User::findByUsername('admin');
verify($user->validateAuthKey('test100key'))->notEmpty();
Expand Down
8 changes: 4 additions & 4 deletions views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

use app\assets\AppAsset;
use app\widgets\Alert;
use yii\bootstrap4\Breadcrumbs;
use yii\bootstrap4\Html;
use yii\bootstrap4\Nav;
use yii\bootstrap4\NavBar;
use yii\bootstrap5\Breadcrumbs;
use yii\bootstrap5\Html;
use yii\bootstrap5\Nav;
use yii\bootstrap5\NavBar;

AppAsset::register($this);
?>
Expand Down
6 changes: 3 additions & 3 deletions views/site/contact.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

/** @var yii\web\View $this */
/** @var yii\bootstrap4\ActiveForm $form */
/** @var yii\bootstrap5\ActiveForm $form */
/** @var app\models\ContactForm $model */

use yii\bootstrap4\ActiveForm;
use yii\bootstrap4\Html;
use yii\bootstrap5\ActiveForm;
use yii\bootstrap5\Html;
use yii\captcha\Captcha;

$this->title = 'Contact';
Expand Down
6 changes: 3 additions & 3 deletions views/site/login.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

/** @var yii\web\View $this */
/** @var yii\bootstrap4\ActiveForm $form */
/** @var yii\bootstrap5\ActiveForm $form */
/** @var app\models\LoginForm $model */

use yii\bootstrap4\ActiveForm;
use yii\bootstrap4\Html;
use yii\bootstrap5\ActiveForm;
use yii\bootstrap5\Html;

$this->title = 'Login';
$this->params['breadcrumbs'][] = $this->title;
Expand Down
4 changes: 2 additions & 2 deletions widgets/Alert.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @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.
Expand Down Expand Up @@ -57,7 +57,7 @@ public function run()
$flash = $session->getFlash($type);

foreach ((array) $flash as $i => $message) {
echo \yii\bootstrap4\Alert::widget([
echo \yii\bootstrap5\Alert::widget([
'body' => $message,
'closeButton' => $this->closeButton,
'options' => array_merge($this->options, [
Expand Down

0 comments on commit 9d3b845

Please sign in to comment.