X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FKernel%2FCommentHostnameTest.php;fp=web%2Fcore%2Fmodules%2Fcomment%2Ftests%2Fsrc%2FKernel%2FCommentHostnameTest.php;h=dc4f37b63f35d4b238c59c14d3ce3d6d5e81c7b7;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php b/web/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php new file mode 100644 index 000000000..dc4f37b63 --- /dev/null +++ b/web/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php @@ -0,0 +1,46 @@ + '203.0.113.1']); + /** @var \Symfony\Component\HttpFoundation\RequestStack $stack */ + $stack = $this->container->get('request_stack'); + $stack->push($request); + + CommentType::create([ + 'id' => 'foo', + 'target_entity_type_id' => 'entity_test', + ])->save(); + $comment = Comment::create(['comment_type' => 'foo']); + + // Check that the hostname was set correctly. + $this->assertEquals('203.0.113.1', $comment->getHostname()); + } + +}