Skip to content

Refactor tests#18

Open
petrduda wants to merge 5 commits into
VasekPurchart:masterfrom
petrduda:pd-refactor-tests
Open

Refactor tests#18
petrduda wants to merge 5 commits into
VasekPurchart:masterfrom
petrduda:pd-refactor-tests

Conversation

@petrduda

@petrduda petrduda commented Mar 28, 2023

Copy link
Copy Markdown
  • 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

Comment thread tests/SymfonyCommandTaskIntegrationTest.php Outdated
Comment thread tests/SymfonyCommandTaskIntegrationTest.php Outdated
@petrduda petrduda force-pushed the pd-refactor-tests branch 5 times, most recently from d5cf728 to db2cad8 Compare April 11, 2023 10:23
@petrduda petrduda force-pushed the pd-refactor-tests branch from db2cad8 to fa89860 Compare April 11, 2023 10:28
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