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
property()
andpropertyName()
methods - #98passCallback()
method to use a callback function to do validation - #100- Support for using
with()
,returnValue()
, andthrowException()
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
attribute()
andattributeName()
methods (useproperty()
andpropertyName()
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
- 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
- Method verifier would reuse previous return value if parameters were changed by
with()
- #93
3.1.0 - 2022-10-07
Method
verifier to write assertions about a method's return value - #86ThrownException
verifier to write assertions about exceptions thrown by methods - #86method()
method to Value verifier to write assertions for methods of objects & classes - #86with()
method to configure parameters to pass to subject methods - #86withMessage()
method to write assertions about an exception message - #86withCode()
method to write assertions about an exception code - #86withVerifier()
now supports passing additional arguments to the verifier constructor - #86- (Dev) GitHub workflow for acceptance testing - #85
- 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()
inValue
verifier can be used as a shortcut for->method($name)->with($args)
- #86
- (Dev) Removed Travis CI integration (replaced with GitHub workflow) - #85
3.0.0 - 2022-06-16
constraint()
method to apply custom constraints to subjects - #73withVerifier()
method to inject custom verifiers to assertion chain - #73withoutLineEndings()
method to ignore lineending differences when comparing strings - #73closed()
method asserts value is a closed resource - #73contain()
to file assertions - #82equalToFiles()
to file assertions to compare two files - #82json()
andequalToJsonString()
to file assertions - #82list()
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()
andsetConstraintFactory()
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
, andtest:phpunit
to pre-commit - #79, #83 - (Dev) Added 80% test coverage check for pre-push - #79
- Assertion message is now combined from subject's name (second parameter to
verify()
orverify_file()
), conjunction, and message passed to conjunction - #73, #81 - Renamed
sameAs()
toidenticalTo()
- #73 - Modifiers now reset after each individual assertion - #73
- File
equalTo()
now compares file contents to a string (useequalToFile()
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
- Dropped support for PHP < 7.2 - #73
- Dropped support for PHPUnit versions 6 & 7 - #73
- Removed
verify_directory()
function (merged intoverify_file()
) - #73 - Removed
BeBat\Verify\VerifyDirectory
class (merged intoBeBat\Verify\API\File
) - #73 - Removed optional message parameter from
verify()
andverify_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()
, andequalToXmlStructure()
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()
, andwithType()
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