Skip to content
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\Framework\Filesystem\Io\File::read() should be able to accept resource in second argument #27869

Merged
merged 9 commits into from
Sep 25, 2020

Conversation

bnymn
Copy link
Contributor

@bnymn bnymn commented Apr 15, 2020

\Magento\Framework\Filesystem\Io\File::read() method is not compatible with the IoInterface. This PR aims to make it compatible.

Description (*)

Related Pull Requests

Fixed Issues (if relevant)

  1. \Magento\Framework\Filesystem\Io\File::read() method is not compatible with \Magento\Framework\Filesystem\Io\IoInterface::read() #27866: \Magento\Framework\Filesystem\Io\File::read() method is not compatible with \Magento\Framework\Filesystem\Io\IoInterface::read()

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2020

Hi @bnymn. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@sidolov sidolov added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Aug 17, 2020
@ghost ghost assigned lenaorobei Aug 18, 2020
Copy link
Contributor

@lenaorobei lenaorobei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign CLA and address test failures.

@ghost ghost moved this from Pending Review to Changes Requested in Pull Requests Dashboard Aug 18, 2020
@engcom-Charlie engcom-Charlie self-assigned this Aug 26, 2020
@engcom-Charlie
Copy link
Contributor

Hi @bnymn, please sign CLA and look through failed tests. Otherwise, we can't proceed with your PR.

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@lenaorobei
Copy link
Contributor

@magento run all tests

@lenaorobei
Copy link
Contributor

@magento run Static Tests

@engcom-Charlie
Copy link
Contributor

Hi, @bnymn can you please fix static tests?
Thank you.

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@engcom-Charlie engcom-Charlie moved this from Changes Requested to Review in Progress in Pull Requests Dashboard Sep 3, 2020
@lenaorobei lenaorobei added Risk: high Auto-Tests: Covered All changes in Pull Request is covered by auto-tests labels Sep 3, 2020
@ghost ghost moved this from Review in Progress to Ready for Testing in Pull Requests Dashboard Sep 3, 2020
@magento-engcom-team
Copy link
Contributor

Hi @lenaorobei, thank you for the review.
ENGCOM-8127 has been created to process this Pull Request

@engcom-Delta engcom-Delta self-assigned this Sep 23, 2020
@engcom-Delta engcom-Delta moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Sep 23, 2020
@engcom-Delta
Copy link
Contributor

✔️ QA passed
Result:
Code snippet for testing:

$file = ObjectManager::getInstance()->get(File::class);
        if (!is_dir('var/tmp_1')) {
            // dir doesn't exist, make it
            mkdir('var/tmp_1');
        }
        file_put_contents('var/tmp_1/sample_file', 'Some test file');
        $targetHandle = fopen('var/tmp_1/' . rand(), 'w');
        $file->cd('var/tmp_1');
        $result = $file->read('sample_file', $targetHandle);
        $output->writeln($result);

Before:
❌ $result is null
image

After:
✔️ File content is copied to the target path
image

✔️ File is copied to the target file when second argument is string only: `$result = $file->read('sample_file', 'test');
image

@engcom-Delta engcom-Delta added the QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope label Sep 24, 2020
@engcom-Delta
Copy link
Contributor

Note: Automation tests are passed

@m2-assistant
Copy link

m2-assistant bot commented Sep 25, 2020

Hi @bnymn, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@ghost ghost moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Filesystem Partner: Webjump partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Risk: high Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Pull Requests Dashboard
  
Recently Merged
Development

Successfully merging this pull request may close these issues.

None yet

7 participants