Skip to content

Latest commit

 

History

History
131 lines (104 loc) · 7.4 KB

CHANGELOG.md

File metadata and controls

131 lines (104 loc) · 7.4 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

3.2.0 - 2023-08-18

Added

  • property() and propertyName() methods - #98
  • passCallback() method to use a callback function to do validation - #100
  • Support for using with(), returnValue(), and throwException() on invokable objects, rather than their methods - #101
  • (Dev) Pull request & issue templates - #98
  • (Dev) Test coverage for PHP 8.2 and PHPUnit 10 - #98
  • (Dev) Contribution guidelines and security policy - #98

Deprecated

  • attribute() and attributeName() methods (use property() and propertyName() instead) - #98
  • Using attribute() / property() with a class name as the subject #98
  • staticAttribute() method (this functionality will be removed in the next major version) - #98

Fixed

  • Passing the constraint factory along when calling withVerifier() - #98
  • list() assertion now uses correct PHPUnit constraint - #98
  • (Dev) PHPUnit test configuration - #98

3.1.1 - 2022-11-09

Fixed

  • Method verifier would reuse previous return value if parameters were changed by with() - #93

3.1.0 - 2022-10-07

Added

  • Method verifier to write assertions about a method's return value - #86
  • ThrownException verifier to write assertions about exceptions thrown by methods - #86
  • method() method to Value verifier to write assertions for methods of objects & classes - #86
  • with() method to configure parameters to pass to subject methods - #86
  • withMessage() method to write assertions about an exception message - #86
  • withCode() method to write assertions about an exception code - #86
  • withVerifier() now supports passing additional arguments to the verifier constructor - #86
  • (Dev) GitHub workflow for acceptance testing - #85

Changed

  • Attribute assertions were moved to their own verifier extending from Value - #86
  • Attribute assertions can no longer read data from a parent class's private properties - #86
  • Attribute assertions can read from dynamic properties if the subject has a __get() method - #86
  • Value verifier class is no longer final, although it's public API is - #86
  • __call() in Value verifier can be used as a shortcut for ->method($name)->with($args) - #86

Removed

  • (Dev) Removed Travis CI integration (replaced with GitHub workflow) - #85

3.0.0 - 2022-06-16

Added

  • constraint() method to apply custom constraints to subjects - #73
  • withVerifier() method to inject custom verifiers to assertion chain - #73
  • withoutLineEndings() method to ignore lineending differences when comparing strings - #73
  • closed() method asserts value is a closed resource - #73
  • contain() to file assertions - #82
  • equalToFiles() to file assertions to compare two files - #82
  • json() and equalToJsonString() to file assertions - #82
  • list() method asserts an array is a list - #73
  • bebat/filesystem-assertions and relevant assertions - #73, #82
    • containFiles()
    • user()
    • group()
    • file()
    • link()
    • linkTarget()
    • executable()
    • permissions()
  • matching() modifier to look for matching permissions, rather than exact - #73
  • Constraint factory class (BeBat\Verify\Constraint\Factory) - #73
  • Moved documentation to Read The Docs - #82
  • (Dev) setAssert() and setConstraintFactory() methods for unit testing custom classes - #73
  • (Dev) Automatically generate PHPStan configs for current version(s) of PHP & PHPUnit on install & update - #73
  • (Dev) Added CaptainHook for managing Git hooks - #79
  • (Dev) Added syntax check, style:check, test:static, and test:phpunit to pre-commit - #79, #83
  • (Dev) Added 80% test coverage check for pre-push - #79

Changed

  • Assertion message is now combined from subject's name (second parameter to verify() or verify_file()), conjunction, and message passed to conjunction - #73, #81
  • Renamed sameAs() to identicalTo() - #73
  • Modifiers now reset after each individual assertion - #73
  • File equalTo() now compares file contents to a string (use equalToFile() to compare two files) - #82
  • Moved & renamed classes - #73
    • BeBat\Verify\VerifyBase -> BeBat\Verify\API\Base
    • BeBat\Verify\Verify -> BeBat\Verify\API\Value
    • BeBat\Verify\VerifyFile -> BeBat\Verify\API\File
    • BeBat\Verify\Assert -> BeBat\Verify\API\Assert
  • Internal data type is now checked by default by contain() assertion on arrays - #81
  • (Internal) Refactored all assertion methods to use PHPUnit constraints, dramatically simplifying internal API and code - #73

Removed

  • Dropped support for PHP < 7.2 - #73
  • Dropped support for PHPUnit versions 6 & 7 - #73
  • Removed verify_directory() function (merged into verify_file()) - #73
  • Removed BeBat\Verify\VerifyDirectory class (merged into BeBat\Verify\API\File) - #73
  • Removed optional message parameter from verify() and verify_file() (messages are now passed to conjunctions) - #73
  • Removed internalType() assertion (removed from PHPUnit) - #73
  • Removed subset() assertion (removed from PHPUnit) - #73
  • Removed equalToXmlFile(), equalToXmlString(), and equalToXmlStructure() assertions (these assertions would require more code duplication and development in order to be compatible with the constraint paradigm to be worth the effort) - #73
  • Removed withAttributes() modifier (only applied to XML assertions) - #73
  • Removed withCase(), withLineEndings(), withOrder, withIdentity(), and withType() modifiers (they no longer served a purpose now that modifiers reset after each assertion) - #82
  • (Dev) Removed pre-commit and commit message Git hooks - #73, #79