Mercurial > hg > cmmr2012-drupal-site
diff core/modules/comment/tests/src/Kernel/CommentHostnameTest.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
line wrap: on
line diff
--- a/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/modules/comment/tests/src/Kernel/CommentHostnameTest.php Thu May 09 15:34:47 2019 +0100 @@ -37,9 +37,17 @@ 'id' => 'foo', 'target_entity_type_id' => 'entity_test', ])->save(); + + // Check that the hostname is empty by default. $comment = Comment::create(['comment_type' => 'foo']); + $this->assertEquals('', $comment->getHostname()); + \Drupal::configFactory() + ->getEditable('comment.settings') + ->set('log_ip_addresses', TRUE) + ->save(TRUE); // Check that the hostname was set correctly. + $comment = Comment::create(['comment_type' => 'foo']); $this->assertEquals('203.0.113.1', $comment->getHostname()); }