/**
  * Expects a factory call.
  *
  * @param string $service_id      Service ID.
  * @param mixed  $returned_object Object to return.
  *
  * @return void
  */
 protected function expectFactoryCall($service_id, $returned_object)
 {
     if (is_array($returned_object)) {
         $this->application->shouldReceive('getObject')->with($service_id)->andReturnValues($returned_object);
     } else {
         $this->application->shouldReceive('getObject')->with($service_id)->andReturn($returned_object);
     }
 }