-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2: Fixes for the schema cache.xsd #26933
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
magento/magento2: Fixes for the schema cache.xsd #26933
Conversation
Hi @andrewbess. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @m2-assistant[bot] Here is your new Magento Instance: https://pr-26933.magento-testing-service.engineering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @andrewbess!
Thank you for your contribution!
Could you please add unit tests to check new schema validation?
Maybe, we also should refactor the class \Magento\Framework\App\Cache\TypeList as 'instance' will become a required parameter? We may simplify some checks here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see following review details: #26933 (review)
641b94e
to
1b7d5f9
Compare
Hello @swnsma |
{ | ||
try { | ||
return parent::read($scope); | ||
} catch (\Magento\Framework\Exception\LocalizedException $e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask you why do we need to transform this localized exception and throw once again?
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @rogyar.
Thank you for your remark.
Previously, I have added the render-method that prepares an error message to output error messages correctly.
But it caused other problems.
I have removed new methods.
Please recheck.
Thank you in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check my comment.
Would you be so kind to check strict types declaration, type hints and add 'declare(strict_types=1);' to changed files.
Thank you!
*/ | ||
namespace Magento\Framework\Cache\Test\Unit; | ||
|
||
class XsdTest extends \PHPUnit\Framework\TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @andrewbess,
I have discovered that we already have bunch of tests which test *.xsd files.
They are located in Magento\Test\Integrity namespace.
Could I ask you to move your your tests under this namespace to keep consistency in tests structure?
Please check \Magento\Test\Integrity\Magento\Widget\WidgetConfigTest for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @swnsma.
I have moved tests by the suggested path.
Also, I added declaration strict types where it is required.
Please recheck.
Thank you in advance.
1b7d5f9
to
56b1391
Compare
dfe05e5
to
dcf42e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @andrewbess!
Thank you for your contribution!
Could you please check my notices?
dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Cache/ConfigTest.php
Outdated
Show resolved
Hide resolved
/** | ||
* @var \Magento\Framework\TestFramework\Unit\Utility\XsdValidator | ||
*/ | ||
protected $_xsdValidator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please
protected -> private
$_xsdValidator -> $xsdValidator
dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Cache/ConfigTest.php
Outdated
Show resolved
Hide resolved
dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Framework/Cache/ConfigTest.php
Outdated
Show resolved
Hide resolved
lib/internal/Magento/Framework/Cache/Exception/WrongConfigurationException.php
Outdated
Show resolved
Hide resolved
lib/internal/Magento/Framework/App/Test/Unit/Cache/TypeListTest/Type.php
Outdated
Show resolved
Hide resolved
dcf42e9
to
1f8f2a0
Compare
…ess/magento2 into improvement/cache-schema � Conflicts: � lib/internal/Magento/Framework/App/Test/Unit/Cache/TypeListTest.php
Closed in favor of #27307 |
Hi @andrewbess, thank you for your contribution! |
Description (*)
This PR fixes the schema "cache.xsd" from Magento\Framework\Cache.
Fixed Issues (if relevant)
Fixes: #26224
Contribution checklist (*)