Chris@17: '203.0.113.1']); Chris@17: /** @var \Symfony\Component\HttpFoundation\RequestStack $stack */ Chris@17: $stack = $this->container->get('request_stack'); Chris@17: $stack->push($request); Chris@17: Chris@17: CommentType::create([ Chris@17: 'id' => 'foo', Chris@17: 'target_entity_type_id' => 'entity_test', Chris@17: ])->save(); Chris@17: $comment = Comment::create(['comment_type' => 'foo']); Chris@17: Chris@17: // Check that the hostname was set correctly. Chris@17: $this->assertEquals('203.0.113.1', $comment->getHostname()); Chris@17: } Chris@17: Chris@17: }