/** * @expectedException ReflectionException */ public function testCallingNonExistingElementThrowsException() { $this->container->shouldReceive('make')->andThrow('ReflectionException'); $this->fb->nonExistingElement('test'); }