I have a basic check in PhpUnit where I am asserting if some object property is null using
$this->assertNull($object->property);
I would like to check if this property was never null in the life-span of this test method.
I read that PHPUnit has some never()
method (see Table 8.1 Matchers in the Test Doubles section), but I was not able to find how I should use it.
More details added:
I am calling several methods in the test. Each of this methods can/will trigger observer. I would like to check if this property was potentially changed to null by some observer and then later set by other logic in the code. I am trying to capture some special scenario where object gets set to null and then later it repopulates again.