-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
{ASI} :- Image size is not passed to image-uploader when inserting an image from new media gallery #27388
{ASI} :- Image size is not passed to image-uploader when inserting an image from new media gallery #27388
Conversation
Hi @konarshankar07. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
* @param array $data | ||
* @param object $model | ||
*/ | ||
protected function checkAssetValues(array $expectedData, array $data, $model) |
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.
I would suggest using private
scope for the private methods. protected
scope assumes that we consider an inheritance of this test class by another test class. It's not a big deal, however, it's recommended to be strict with scoping and hide implementation details in such cases.
@magento run all tests |
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.
Thanks for the pull request @konarshankar07 ! Please see my code review notes
@@ -65,6 +65,13 @@ public function getHeight(): int; | |||
*/ | |||
public function getWidth(): int; | |||
|
|||
/** | |||
* Retrieve full licensed asset's size |
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.
* Retrieve full licensed asset's size | |
* Retrieve asset file size in bytes |
@@ -14,6 +14,7 @@ | |||
<column xsi:type="varchar" name="content_type" length="255" nullable="true" comment="Content Type"/> | |||
<column xsi:type="int" name="width" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Width"/> | |||
<column xsi:type="int" name="height" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Height"/> | |||
<column xsi:type="int" name="size" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Size"/> |
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.
<column xsi:type="int" name="size" padding="10" unsigned="true" nullable="false" identity="false" default="0" comment="Size"/> | |
<column xsi:type="int" name="size" padding="10" unsigned="true" nullable="false" identity="false" comment="Asset file size in bytes"/> |
@@ -122,7 +144,7 @@ public function assetProvider() | |||
], | |||
'Keyword conversion without interface' => [ | |||
Keyword::class, | |||
null, | |||
'', |
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.
this value should be either a valid interface name or null
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.
As per function argument type declarations for the method is string so instead of null I just replaced with the empty string
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.
Let's keep it logically correct: it should be either interface name as string or null
@@ -54,22 +53,41 @@ public function testExtractData(string $class, $interfaceClass, array $expectedD | |||
'data' => $data, | |||
] | |||
); | |||
$receivedData = $this->dataExtractor->extract($model, $interfaceClass); | |||
$this->checkValues($expectedData, $receivedData, $model); | |||
if ($interfaceClass) { |
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.
I don't see the reason to change the test logic after adding a size
field. Only data provider should be changed. What is the reason for this change?
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.
I'm trying to improve the Unit test for this line
$this->assertEquals(array_keys($expectedData), array_keys($expectedData)); |
Failed tests look to be random and not relevant to the changes in the PR |
Hi @sivaschenko, thank you for the review.
|
✔️ QA Passed Switched to the related Adobe Stock Integration PR 1021 and to the current PR |
Failed functional tests not related to the changes in this PR |
Hi @rogyar, thank you for the review. |
… inserting an image from new media gallery #27388
Hi @konarshankar07, thank you for your contribution! |
Description (*)
This PR is the part of Adobe stock integration
Dependent to
magento/adobe-stock-integration#1021
Fixed Issues (if relevant)
Questions or comments
Contribution checklist (*)