coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

Refactor tests

Open petrduda opened this issue 2 years ago • 0 comments

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

petrduda avatar Mar 09 '23 12:03 petrduda