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

Refactor tests #27

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Conversation

petrduda
Copy link
Contributor

@petrduda petrduda commented Feb 5, 2023

  • stop calling static methods in tests as non-static
  • use assertSame() where assertEquals() is not explicitly needed
  • use assertCount() after assertContains() for array comparison
  • add missing Assert::fail() in try+catch blocks when expecting exceptions
  • unify Assert::fail() message
  • replace Consistence\TestCase::ok() with expectNotToPerformAssertions()
  • use try+catch+fail when expecting exceptions with properties
  • rename data providers to singular where applicable
  • use DataProvider suffix for data providers
  • change data provider return type from array to Generator
  • declare data provider values on separate lines
  • isolate data provider cases using Closures
  • name data provider values
  • name data provider cases
  • extract multiple cases from test methods to data providers
  • remove unnecessary private methods for creating mocks

@petrduda petrduda force-pushed the pd-refactor-tests branch 2 times, most recently from 580c161 to 21a11fa Compare February 8, 2023 22:03
@petrduda petrduda changed the title Refactoring tests Refactor tests Feb 8, 2023
@VasekPurchart VasekPurchart self-requested a review February 16, 2023 11:31
VasekPurchart
VasekPurchart previously approved these changes Feb 16, 2023
@VasekPurchart VasekPurchart self-requested a review February 16, 2023 15:35
@VasekPurchart VasekPurchart dismissed their stale review February 20, 2023 15:06

Additional points found.

@petrduda petrduda force-pushed the pd-refactor-tests branch 3 times, most recently from 63b45fd to 849fe02 Compare February 22, 2023 13:45
VasekPurchart
VasekPurchart previously approved these changes Feb 22, 2023
@petrduda petrduda force-pushed the pd-refactor-tests branch from 09c42a6 to 77d6d8b Compare March 27, 2023 13:50
VasekPurchart
VasekPurchart previously approved these changes Mar 28, 2023
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.

2 participants