I have the a service definition in a custom Drupal 8 module which I would like to test. I've managed to test everything else in my module with unit tests, so my whole suite runs in a fraction of a second, and I'd like to avoid introducing anything Simpletest-based. (My CI infrastructure wouldn't support it anyway.) Is there any way to test my service definition in an isolated unit test? Here's my service definition:
arguments: ['@state', '@config.factory']
The manual test I've been performing is to run this Drush command:
drush ev 'var_dump(\Drupal::service("my_module.client")->_serviceId == "my_module.client" ? "PASS" : "FAIL");'
That's a sufficient smoke test while I'm developing. For a regression test, I'd also like to assert that the class returned is an instance of the correct type.