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

Fix #25761: Site map doesn't include home page #26445

Merged
merged 6 commits into from
Feb 7, 2020

Conversation

deepaksnair
Copy link
Contributor

@deepaksnair deepaksnair commented Jan 18, 2020

Description (*)

Site map doesn't include home page url issue fixed

Fixed Issues (if relevant)

  1. Site map doesn't include home page #25761: Site map doesn't include home page

Manual testing scenarios (*)

  1. Go to Stores > Settings > Configuration > Catalog > XML Sitemap > Generation Settings section
  2. Change option Enabled to Yes
  3. Go to Marketing > Seo & Search > Site Map
  4. Create a new site map and generate
  5. Open new site map in browser

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 Jan 18, 2020

Hi @deepaksnair. 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.

@deepaksnair
Copy link
Contributor Author

@magento give me test instance

@deepaksnair
Copy link
Contributor Author

@magento give me 2.4-develop instance

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

Could you provide automated tests to the PR?

<group id="generate" translate="label" type="text" sortOrder="4" showInDefault="1">
<group id="store" translate="label" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Store Url Options</label>
<field id="changefreq" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
Copy link
Contributor

Choose a reason for hiding this comment

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

Good practice is to increase sortOrder numbers by 10. This way extension developers are still able to extend the grid with their elements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lbajsarowicz , thanks for reveiwing PR, I have updated the sort orders. Please help to verify.
Also can you please suggest how can I provide automated tests to PR.

@ghost ghost assigned lbajsarowicz Jan 18, 2020
@magento-engcom-team
Copy link
Contributor

Hi @deepaksnair. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @deepaksnair. Thank you for your request. I'm working on Magento 2.4-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @deepaksnair, here is your Magento instance.
Admin access: https://i-26445-2-4-develop.instances.magento-community.engineering/admin_b6fe
Login: 2d937ef6 Password: e0524ea52c83
Instance will be terminated in up to 3 hours.

@deepaksnair
Copy link
Contributor Author

Hello @lbajsarowicz , I have added automated test cases in last commit, please help to verify PR.
Thanks

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

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

Great job! Only a few things to be changed.

}

/**
* @return \PHPUnit_Framework_MockObject_MockObject
Copy link
Contributor

Choose a reason for hiding this comment

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

Use \PHPUnit\Framework\MockObject\MockObject

Copy link
Contributor

Choose a reason for hiding this comment

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

And return type is actually:
SitemapItemInterfaceFactory|MockObject

}

/**
* @return \PHPUnit_Framework_MockObject_MockObject
Copy link
Contributor

Choose a reason for hiding this comment

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

Use \PHPUnit\Framework\MockObject\MockObject
And return type is ConfigReaderInterface|MockObject

use Magento\Sitemap\Model\SitemapItem;
use Magento\Sitemap\Model\SitemapItemInterfaceFactory;

class StoreUrlTest extends \PHPUnit\Framework\TestCase
Copy link
Contributor

Choose a reason for hiding this comment

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

Import class.

$resolver = new StoreUrlItemResolver($configReaderMock, $itemFactoryMock);
$items = $resolver->getItems(1);

$this->assertTrue(count($items) == 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is ->assertCount(1, $items)

}

/**
* {@inheritdoc}
Copy link
Contributor

Choose a reason for hiding this comment

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

@inheritdoc should not be in braces

}

/**
* {@inheritdoc}
Copy link
Contributor

Choose a reason for hiding this comment

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

@inheritdoc should not be in braces

@lbajsarowicz lbajsarowicz changed the title fixed issue #25761 Fix #25761: Site map doesn't include home page Jan 23, 2020
@deepaksnair
Copy link
Contributor Author

Hello @lbajsarowicz , I have resolved all the feedback given by you, please help to review it again.
Thanks.

@magento-engcom-team
Copy link
Contributor

Hi @lbajsarowicz, thank you for the review.
ENGCOM-6670 has been created to process this Pull Request
✳️ @lbajsarowicz, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@engcom-Alfa engcom-Alfa self-assigned this Jan 24, 2020
@engcom-Alfa engcom-Alfa added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jan 24, 2020
@engcom-Alfa
Copy link
Contributor

Hi @deepaksnair, thank you for your contribution.

Could you fix failing static tests and add this phrase Store Url Options into the translation file?

Thanks!

@lbajsarowicz
Copy link
Contributor

@deepaksnair Please fix Static Tests.
I'd love to help you with Automated tests - call me on Community Engineering Slack, please.

@deepaksnair
Copy link
Contributor Author

Hello @lbajsarowicz , @engcom-Alfa , I have resolved the issues in Static Tests also added translations, please help to verify.
Thanks

@magento-engcom-team
Copy link
Contributor

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

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Feb 7, 2020

Hi @deepaksnair, 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.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
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.

6 participants