fix ContainerBuilder mock generation in tests

By default, PHPUnit mocks all methods of the mocked class. This breaks
when one of the methods has an argument that is type-hinted with a
non-existing class or interface.