diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..011c056bb --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,8 @@ +# Reformat code te be PSR-2 compatible +93cc82c4bf42cea403e1acaab201338bea304b6e +# Convert to short syntax (array) +332030325fbad38a64c5e60980d3b14b6434d6dd +# Convert to short syntax +b0fcdfab1aecaeb620f75a83f15aa02bc25765a0 +# Fix codestyle +0f91f32ecff52ef479addb0a5013342d59fe0697 diff --git a/.gitattributes b/.gitattributes index 3e9092c68..705fb391d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ # Ignore all test and documentation for archive -/.github export-ignore -/.gitattributes export-ignore -/.scrutinizer.yml export-ignore -/.travis.yml export-ignore -/docs export-ignore +/.github export-ignore +/.git-blame-ignore-revs export-ignore +/.gitattributes export-ignore +/.scrutinizer.yml export-ignore +/.travis.yml export-ignore +/docs export-ignore diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1065f909..a5beac653 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: env: extensions: dom, json, gd, imagick - key: cache-v1 + key: cache-v4 runs-on: ${{ matrix.os }} @@ -24,10 +24,13 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" + - "8.3" + - "8.4" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Setup cache environment id: cache-env @@ -38,7 +41,7 @@ jobs: key: ${{ env.key }} - name: Cache extensions - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ steps.cache-env.outputs.dir }} key: ${{ steps.cache-env.outputs.key }} @@ -62,7 +65,7 @@ jobs: echo "COMPOSER_CACHE_DIR=~\AppData\Local\Composer" >> $GITHUB_ENV - name: Cache dependencies installed with composer - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ${{ steps.cache-env.outputs.dir }} key: php${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} diff --git a/.gitignore b/.gitignore index 28419e445..05fb29d1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # phpstorm project files .idea +# visual studio code project files +.vscode + # netbeans project files nbproject @@ -18,9 +21,6 @@ Thumbs.db # composer itself is not needed composer.phar -# composer lock -composer.lock - # Mac DS_Store Files .DS_Store diff --git a/assets/AppAsset.php b/assets/AppAsset.php index 3d40487ae..d9d4cc430 100644 --- a/assets/AppAsset.php +++ b/assets/AppAsset.php @@ -1,4 +1,5 @@ =2.7 <=4.2.4" + "codeception/verify": "^3.0 || ^2.2" }, "config": { "allow-plugins": { diff --git a/config/__autocomplete.php b/config/__autocomplete.php index d99dea50e..e5e1c00d7 100644 --- a/config/__autocomplete.php +++ b/config/__autocomplete.php @@ -11,7 +11,8 @@ * } * ``` */ -class Yii { +class Yii +{ /** * @var \yii\web\Application|\yii\console\Application|__Application */ @@ -19,15 +20,16 @@ class Yii { } /** - * @property yii\rbac\DbManager $authManager + * @property yii\rbac\DbManager $authManager * @property \yii\web\User|__WebUser $user - * */ -class __Application { +class __Application +{ } /** * @property app\models\User $identity */ -class __WebUser { +class __WebUser +{ } diff --git a/config/test.php b/config/test.php index 317bc1cb6..fb5e2929e 100644 --- a/config/test.php +++ b/config/test.php @@ -1,4 +1,5 @@ validate()) { - return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0); + return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0); } return false; } diff --git a/requirements.php b/requirements.php index c1a6bf680..db69a36ee 100644 --- a/requirements.php +++ b/requirements.php @@ -1,4 +1,5 @@ amOnPage(Url::toRoute('/site/contact')); } - + public function contactPageWorks(AcceptanceTester $I) { $I->wantTo('ensure that contact page works'); @@ -25,7 +25,7 @@ public function contactFormCanBeSubmitted(AcceptanceTester $I) $I->fillField('#contactform-verifycode', 'testme'); $I->click('contact-button'); - + $I->wait(2); // wait for button to be clicked $I->dontSeeElement('#contact-form'); diff --git a/tests/acceptance/HomeCest.php b/tests/acceptance/HomeCest.php index e65df16ae..98fb6b9f7 100644 --- a/tests/acceptance/HomeCest.php +++ b/tests/acceptance/HomeCest.php @@ -6,13 +6,13 @@ class HomeCest { public function ensureThatHomePageWorks(AcceptanceTester $I) { - $I->amOnPage(Url::toRoute('/site/index')); + $I->amOnPage(Url::toRoute('/site/index')); $I->see('My Company'); - + $I->seeLink('About'); $I->click('About'); $I->wait(2); // wait for page to be opened - + $I->see('This is the About page.'); } } diff --git a/tests/functional/ContactFormCest.php b/tests/functional/ContactFormCest.php index d17ef52fd..f1ccaf18f 100644 --- a/tests/functional/ContactFormCest.php +++ b/tests/functional/ContactFormCest.php @@ -1,6 +1,6 @@ see('Contact', 'h1'); + $I->see('Contact', 'h1'); } public function submitEmptyForm(\FunctionalTester $I) @@ -38,7 +38,7 @@ public function submitFormWithIncorrectEmail(\FunctionalTester $I) $I->see('Email is not a valid email address.'); $I->dontSee('Subject cannot be blank', '.help-inline'); $I->dontSee('Body cannot be blank', '.help-inline'); - $I->dontSee('The verification code is incorrect', '.help-inline'); + $I->dontSee('The verification code is incorrect', '.help-inline'); } public function submitFormSuccessfully(\FunctionalTester $I) @@ -52,6 +52,6 @@ public function submitFormSuccessfully(\FunctionalTester $I) ]); $I->seeEmailIsSent(); $I->dontSeeElement('#contact-form'); - $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); + $I->see('Thank you for contacting us. We will respond to you as soon as possible.'); } } diff --git a/tests/functional/LoginFormCest.php b/tests/functional/LoginFormCest.php index 7a83a27d6..a1545a706 100644 --- a/tests/functional/LoginFormCest.php +++ b/tests/functional/LoginFormCest.php @@ -10,7 +10,6 @@ public function _before(\FunctionalTester $I) public function openLoginPage(\FunctionalTester $I) { $I->see('Login', 'h1'); - } // demonstrates `amLoggedInAs` method @@ -54,6 +53,6 @@ public function loginSuccessfully(\FunctionalTester $I) 'LoginForm[password]' => 'admin', ]); $I->see('Logout (admin)'); - $I->dontSeeElement('form#login-form'); + $I->dontSeeElement('form#login-form'); } -} \ No newline at end of file +} diff --git a/tests/unit/models/LoginFormTest.php b/tests/unit/models/LoginFormTest.php index 3c1dcddaa..6f96c2377 100644 --- a/tests/unit/models/LoginFormTest.php +++ b/tests/unit/models/LoginFormTest.php @@ -47,5 +47,4 @@ public function testLoginCorrect() verify(\Yii::$app->user->isGuest)->false(); verify($this->model->errors)->arrayHasNotKey('password'); } - } diff --git a/tests/unit/models/UserTest.php b/tests/unit/models/UserTest.php index 28986cbbd..3db9772a3 100644 --- a/tests/unit/models/UserTest.php +++ b/tests/unit/models/UserTest.php @@ -19,7 +19,7 @@ public function testFindUserByAccessToken() verify($user = User::findIdentityByAccessToken('100-token'))->notEmpty(); verify($user->username)->equals('admin'); - verify(User::findIdentityByAccessToken('non-existing'))->empty(); + verify(User::findIdentityByAccessToken('non-existing'))->empty(); } public function testFindUserByUsername() @@ -38,7 +38,6 @@ public function testValidateUser() verify($user->validateAuthKey('test102key'))->empty(); verify($user->validatePassword('admin'))->notEmpty(); - verify($user->validatePassword('123456'))->empty(); + verify($user->validatePassword('123456'))->empty(); } - } diff --git a/tests/unit/widgets/AlertTest.php b/tests/unit/widgets/AlertTest.php index e9857a161..af2db5d21 100644 --- a/tests/unit/widgets/AlertTest.php +++ b/tests/unit/widgets/AlertTest.php @@ -177,7 +177,8 @@ public function testMultipleWarningMessages() verify($renderingResult)->stringNotContainsString('alert-info'); } - public function testSingleMixedMessages() { + public function testSingleMixedMessages() + { $errorMessage = 'This is an error message'; $dangerMessage = 'This is a danger message'; $successMessage = 'This is a success message'; @@ -204,7 +205,8 @@ public function testSingleMixedMessages() { verify($renderingResult)->stringContainsString('alert-warning'); } - public function testMultipleMixedMessages() { + public function testMultipleMixedMessages() + { $firstErrorMessage = 'This is the first error message'; $secondErrorMessage = 'This is the second error message'; $firstDangerMessage = 'This is the first danger message'; diff --git a/views/site/error.php b/views/site/error.php index 4a37b2568..176874796 100644 --- a/views/site/error.php +++ b/views/site/error.php @@ -3,7 +3,7 @@ /** @var yii\web\View $this */ /** @var string $name */ /** @var string $message */ -/** @var Exception$exception */ +/** @var Exception $exception */ use yii\helpers\Html;