PHPUnit assert no method is called May 26, 2023 by Tarik Yes, it’s quite simple, try this: $classA->expects($this->never())->method($this->anything());