Skip to content

Fix warnings detected by phpcs & phpunit #383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

fredden
Copy link
Member

@fredden fredden commented Apr 5, 2022

While working on another change, I followed the instructions in the README which say to run vendor/bin/phpunit && vendor/bin/phpcs --standard=Magento2 Magento2/ --extensions=php. These reported errors which were unrelated to the changes I was making. This pull request solves those errors.

For reference, the output of the above commands used to be:

app@8a43352ec6d2:~/html$ vendor/bin/phpunit && vendor/bin/phpcs --standard=Magento2 Magento2/ --extensions=php
PHPUnit 9.5.20 #StandWithUkraine

...........................................W...................  63 / 204 ( 30%)
............................................................... 126 / 204 ( 61%)
....................................S.......................... 189 / 204 ( 92%)
...............                                                 204 / 204 (100%)

Time: 00:06.970, Memory: 134.50 MB

There was 1 warning:

1) Warning
No tests found in class "Magento2\Tests\PHPCompatibility\BaseSniffTest".

phpvfscomposer:///var/www/html/vendor/phpunit/phpunit/phpunit:97

WARNINGS!
Tests: 204, Assertions: 160, Warnings: 1, Skipped: 1.

FILE: /var/www/html/Magento2/Tests/PHPCompatibility/ForbiddenFinalPrivateMethodsUnitTest.php
--------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------
 40 | WARNING | [x] Line indented incorrectly; expected at least 8 spaces, found 7
--------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------

Time: 6.76 secs; Memory: 22MB

app@8a43352ec6d2:~/html$ 

and is now

app@8a43352ec6d2:~/html$ vendor/bin/phpunit && vendor/bin/phpcs --standard=Magento2 Magento2/ --extensions=php
PHPUnit 9.5.20 #StandWithUkraine

...............................................................  63 / 203 ( 31%)
............................................................... 126 / 203 ( 62%)
...................................S........................... 189 / 203 ( 93%)
..............                                                  203 / 203 (100%)

Time: 00:06.908, Memory: 134.50 MB

OK, but incomplete, skipped, or risky tests!
Tests: 203, Assertions: 160, Skipped: 1.
app@8a43352ec6d2:~/html$ 

@sivaschenko
Copy link
Member

@magento import pr to magento-commerce/magento-coding-standard

@m2-github-services
Copy link
Contributor

@sivaschenko the Pull Request is successfully imported.

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 1109817 into magento:develop Apr 22, 2022
@fredden fredden deleted the adhere-to-own-standard branch April 22, 2022 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants