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

[tests-only][full-ci] removing the setresponse in given/then step in TrashbinContext and TagsContext #7261

Merged
merged 4 commits into from
Sep 15, 2023

Conversation

KarunAtreya
Copy link
Contributor

@KarunAtreya KarunAtreya commented Sep 11, 2023

Description

We have used setResponse() and $this->response in the Given/Then steps and some helper functions (maybe to reuse existing available methods). But storing responses from Given/Then steps and helper functions is not a good idea because it can lead to a false positive assertion in the Then steps.
So, check the use of setResponse() and $this->response in

  • Given steps
  • Then steps (Then steps can use $this->response but must prevent saving to it)
  • Helper functions

So this pr make the above changes in TrashbinContext.php and TagsContext.php

Related Issue

#7082

Motivation and Context

  • To remove setResponse() and $this->response in the Given/Then steps and some helper functions
  • To avoid false positive assertions

How Has This Been Tested?

  • test environment:
  • locally
  • CI

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@KarunAtreya KarunAtreya force-pushed the refactor_GivenWhenThen_steps branch from 1ec4a25 to 9884e11 Compare September 11, 2023 10:20
@KarunAtreya KarunAtreya changed the title [tests-only][full-ci] removing the setresponse in given/then step in TrashbinContext [tests-only][full-ci] removing the setresponse in given/then step in TrashbinContext and TagsContext Sep 11, 2023
@KarunAtreya KarunAtreya self-assigned this Sep 11, 2023
@KarunAtreya KarunAtreya marked this pull request as ready for review September 11, 2023 10:59
@KarunAtreya KarunAtreya force-pushed the refactor_GivenWhenThen_steps branch 6 times, most recently from 28b056b to 0b0ad24 Compare September 13, 2023 10:50
@KarunAtreya KarunAtreya force-pushed the refactor_GivenWhenThen_steps branch from 0b0ad24 to 1e72e4b Compare September 14, 2023 03:43
@KarunAtreya KarunAtreya force-pushed the refactor_GivenWhenThen_steps branch 2 times, most recently from ce23078 to b1d5311 Compare September 14, 2023 06:42
@KarunAtreya KarunAtreya force-pushed the refactor_GivenWhenThen_steps branch from b1d5311 to a11122f Compare September 14, 2023 06:45
Copy link
Contributor

@SwikritiT SwikritiT left a comment

Choose a reason for hiding this comment

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

LGTM

@SwikritiT SwikritiT requested a review from saw-jan September 14, 2023 10:43
Copy link
Member

@saw-jan saw-jan left a comment

Choose a reason for hiding this comment

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

👍 ✨

@KarunAtreya KarunAtreya force-pushed the refactor_GivenWhenThen_steps branch 2 times, most recently from aa61e9f to 40ce0a4 Compare September 15, 2023 07:10
@KarunAtreya KarunAtreya force-pushed the refactor_GivenWhenThen_steps branch from 40ce0a4 to 43ec932 Compare September 15, 2023 08:45
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants