public function testSomething(): void
{
$this->mockSomething(); // This makes assertion internally by using `MockObject::expects()`
$this->runSomething(true);
}
private function mockSomething(): void
{
$this->something // This is mock prepared in setUp()
->expects(self::once())
->method('handle');
}
Currently AddDoesNotPerformAssertionToNonAssertingTestRector adds @doesNotPerformAssertions annotation to such tests, which is not true. Method itself does not have assertion calls, but other method(s) called within test makes assertions with MockObject::expects().
Consider test method and its related methods:
Currently
AddDoesNotPerformAssertionToNonAssertingTestRector
adds@doesNotPerformAssertions
annotation to such tests, which is not true. Method itself does not have assertion calls, but other method(s) called within test makes assertions withMockObject::expects()
.