assert icon indicating copy to clipboard operation
assert copied to clipboard

Is there a way to assert for known specific values?

Open dennis-fedco opened this issue 3 years ago • 1 comments

Is there an efficient concise way to Assert for known possible values ahead of time, i.e. if a variable has values of either 0 or 1 (strings)? This is for a specific case with checkboxes.

But what about a more general case, like {alpha, beta, gamma, zetta}?

dennis-fedco avatar Mar 01 '22 19:03 dennis-fedco

Assertion::choice may helps

Assertion::choice(mixed $value, array $choices); Assertion::choicesNotEmpty(array $values, array $choices);

alejgarciarodriguez avatar Feb 08 '23 15:02 alejgarciarodriguez