I want to write a test using PHPUnit which includes a check to make sure that a value is either a string
or NULL
.
AFAIK, I can write such a test like so:
if (is_string($value) || is_null($value)) {
$result = TRUE;
} else {
$result = FALSE;
}
$this->assertTrue($result);
However, I've seen that PHPUnit has a logicalOr()
method, which I don't know if I should be using to make a more 'native' test? And if I should be using it, I can't figure out how to do so...