comparison core/modules/comment/tests/src/Kernel/CommentItemTest.php @ 12:7a779792577d

Update Drupal core to v8.4.5 (via Composer)
author Chris Cannam
date Fri, 23 Feb 2018 15:52:07 +0000
parents 4c8ae668cc8c
children af1871eacc83
comparison
equal deleted inserted replaced
11:bfffd8d7479a 12:7a779792577d
69 * Tests comment author name. 69 * Tests comment author name.
70 */ 70 */
71 public function testCommentAuthorName() { 71 public function testCommentAuthorName() {
72 $this->installEntitySchema('comment'); 72 $this->installEntitySchema('comment');
73 73
74 $host = EntityTest::create(['name' => $this->randomString()]);
75 $host->save();
76
74 // Create some comments. 77 // Create some comments.
75 $comment = Comment::create([ 78 $comment = Comment::create([
76 'subject' => 'My comment title', 79 'subject' => 'My comment title',
77 'uid' => 1, 80 'uid' => 1,
78 'name' => 'entity-test', 81 'name' => 'entity-test',
79 'mail' => 'entity@localhost', 82 'mail' => 'entity@localhost',
80 'entity_type' => 'entity_test', 83 'entity_type' => 'entity_test',
84 'entity_id' => $host->id(),
81 'comment_type' => 'entity_test', 85 'comment_type' => 'entity_test',
82 'status' => 1, 86 'status' => 1,
83 ]); 87 ]);
84 $comment->save(); 88 $comment->save();
85 89
93 'uid' => 0, 97 'uid' => 0,
94 'name' => 'barry', 98 'name' => 'barry',
95 'mail' => 'test@example.com', 99 'mail' => 'test@example.com',
96 'homepage' => 'https://example.com', 100 'homepage' => 'https://example.com',
97 'entity_type' => 'entity_test', 101 'entity_type' => 'entity_test',
102 'entity_id' => $host->id(),
98 'comment_type' => 'entity_test', 103 'comment_type' => 'entity_test',
99 'status' => 1, 104 'status' => 1,
100 ]); 105 ]);
101 $comment_anonymous->save(); 106 $comment_anonymous->save();
102 107