Open ericb opened 1 year ago
When testing that an exception is not thrown, the assertion count is not raised. This is true for both variants on the latest 2.2 release:
verify($callable)->callableDoesNotThrow(\Exception::class); expect($callable)->callableNotToThrow(\Exception::class);
Here is a sample test:
public function testCallableDoesNotThrow() { $testFunction = function() {}; expect($testFunction)->callableNotToThrow(\Exception::class); }
It happens because assertDoesNotThrow does not call any methods of \PhpUnit\Framework\Assert class.
\PhpUnit\Framework\Assert
When testing that an exception is not thrown, the assertion count is not raised. This is true for both variants on the latest 2.2 release:
Here is a sample test: