You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to get back into contributing to the project and I've been checking out the roadmap for version 3.0. I want to start by increasing the code coverage, but I ran into a few questions.
I've been adding some exception tests using phpt, but I got stuck on the Base rule test. This rule throws an exception called InvalidRuleConstructorException. However, it seems like this exception isn't being caught by the exceptionMessage and exceptionFullMessage functions. Am I doing something wrong?
The text was updated successfully, but these errors were encountered:
I think I've found the right way to do exception testing, I can follow phpunit itself, correct?
Example:
#[Test]
publicfunctionitShouldThrowsExceptionWhenBaseIsNotValid(): void
{
$this->expectException(InvalidRuleConstructorException::class);
$this->expectExceptionMessage('a base between 1 and 62 is required');
(newBase(63))->evaluate('011010001');
}
I've commented on #1457 that it's best not to include the call to the evaluate() method because it gives the impression that the exception is thrown from that method and not from the Rule's constructor.
Hey everyone,
I'm looking to get back into contributing to the project and I've been checking out the roadmap for version 3.0. I want to start by increasing the code coverage, but I ran into a few questions.
I've been adding some exception tests using phpt, but I got stuck on the Base rule test. This rule throws an exception called
InvalidRuleConstructorException
. However, it seems like this exception isn't being caught by theexceptionMessage
andexceptionFullMessage
functions. Am I doing something wrong?The text was updated successfully, but these errors were encountered: