Tempest version
3.10
PHP version
8.5
Operating system
Linux
Description
Hi!
The method validateObject defined here
https://github.com/tempestphp/tempest-framework/blob/3.x/packages/validation/src/Validator.php#L39-L58, will always throw an exception because this condition https://github.com/tempestphp/tempest-framework/blob/3.x/packages/validation/src/Validator.php#L55 is always true.
This test simple test fails:
public function test_validate_passes_with_valid_object(): void
{
$this->validator->validateObject(new ObjectToBeValidated(name: 'ab'));
$this->expectNotToPerformAssertions();
}
In addition, when an exception is thrown, the property ValidationFailed->$targetClass is not set and for each rule which validation failed ($failingRules), FaillingRule->$field is null.
I know it's a not document method validateObject, but I was trying to use anyway, and I found the bug. If it's something internal, please ignore this Bug Report.
I'll try to open also a PR.
Tempest version
3.10
PHP version
8.5
Operating system
Linux
Description
Hi!
The method
validateObjectdefined herehttps://github.com/tempestphp/tempest-framework/blob/3.x/packages/validation/src/Validator.php#L39-L58, will always throw an exception because this condition https://github.com/tempestphp/tempest-framework/blob/3.x/packages/validation/src/Validator.php#L55 is always true.
This test simple test fails:
In addition, when an exception is thrown, the property
ValidationFailed->$targetClassis not set and for each rule which validation failed ($failingRules),FaillingRule->$fieldis null.I know it's a not document method
validateObject, but I was trying to use anyway, and I found the bug. If it's something internal, please ignore this Bug Report.I'll try to open also a PR.