phpunit avoid constructor arguments for mock
You can use getMockBuilder instead of just getMock: $mock = $this->getMockBuilder(‘class_name’) ->disableOriginalConstructor() ->getMock(); See the section on “Test Doubles” in PHPUnit’s documentation for details. Although you can do this, it’s much better to not need to. You can refactor your code so instead of a concrete class (with a constructor) needing to be injected, you … Read more