Skip to content

Instantly share code, notes, and snippets.

@ShawnMcCool
Last active June 30, 2022 09:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShawnMcCool/41bb39ed7ba8a4c12cfb6f3531101b4f to your computer and use it in GitHub Desktop.
Save ShawnMcCool/41bb39ed7ba8a4c12cfb6f3531101b4f to your computer and use it in GitHub Desktop.
New Test Framework Requirements

Core Principles:

  • tests are an executable story
    • most production similar implementation possible
    • communicate story along with implementation
  • no inheritance
  • no unnecessary features like data providers
  • give full control over error and success reporting
    • assertions can have both success and error messages
    • assertions can arbitrarily have added context such as 'array diff'
  • core built from a predicate based assertion mechanism
  • runs and reports all assertions, not just the first that failed (not exception-based)

Maybe Features?:

  • PHPUnit Test Class Name Compatibility?
    • hijack ide expectations perhaps?
    • maybe not worth it?

Design Requirements:

  • no duck typing

Runner Requirements:

  • run all tests
  • run a directory
  • run a single test
  • show test documentation or not

Components of an assertion:

  • predicate
  • success message
  • error message
  • additional context

General Test Principles

  • tests should be navigatable to / from SUT with IDE when possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment