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