/** * @expectedException InvalidArgumentException * @expectedExceptionMessage There is no service defined with id [abc] */ public function _testGetServiceWithoutSet() { $this->context->getService('abc'); }