comparison core/modules/comment/tests/src/Kernel/CommentItemTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
25 */ 25 */
26 public static $modules = ['comment', 'entity_test', 'user']; 26 public static $modules = ['comment', 'entity_test', 'user'];
27 27
28 protected function setUp() { 28 protected function setUp() {
29 parent::setUp(); 29 parent::setUp();
30 $this->installEntitySchema('comment');
30 $this->installSchema('comment', ['comment_entity_statistics']); 31 $this->installSchema('comment', ['comment_entity_statistics']);
31 $this->installConfig(['comment']); 32 $this->installConfig(['comment']);
32 } 33 }
33 34
34 /** 35 /**
68 /** 69 /**
69 * Tests comment author name. 70 * Tests comment author name.
70 */ 71 */
71 public function testCommentAuthorName() { 72 public function testCommentAuthorName() {
72 $this->installEntitySchema('comment'); 73 $this->installEntitySchema('comment');
74 $this->addDefaultCommentField('entity_test', 'entity_test', 'comment');
73 75
74 $host = EntityTest::create(['name' => $this->randomString()]); 76 $host = EntityTest::create(['name' => $this->randomString()]);
75 $host->save(); 77 $host->save();
76 78
77 // Create some comments. 79 // Create some comments.
79 'subject' => 'My comment title', 81 'subject' => 'My comment title',
80 'uid' => 1, 82 'uid' => 1,
81 'name' => 'entity-test', 83 'name' => 'entity-test',
82 'mail' => 'entity@localhost', 84 'mail' => 'entity@localhost',
83 'entity_type' => 'entity_test', 85 'entity_type' => 'entity_test',
86 'field_name' => 'comment',
84 'entity_id' => $host->id(), 87 'entity_id' => $host->id(),
85 'comment_type' => 'entity_test', 88 'comment_type' => 'entity_test',
86 'status' => 1, 89 'status' => 1,
87 ]); 90 ]);
88 $comment->save(); 91 $comment->save();
97 'uid' => 0, 100 'uid' => 0,
98 'name' => 'barry', 101 'name' => 'barry',
99 'mail' => 'test@example.com', 102 'mail' => 'test@example.com',
100 'homepage' => 'https://example.com', 103 'homepage' => 'https://example.com',
101 'entity_type' => 'entity_test', 104 'entity_type' => 'entity_test',
105 'field_name' => 'comment',
102 'entity_id' => $host->id(), 106 'entity_id' => $host->id(),
103 'comment_type' => 'entity_test', 107 'comment_type' => 'entity_test',
104 'status' => 1, 108 'status' => 1,
105 ]); 109 ]);
106 $comment_anonymous->save(); 110 $comment_anonymous->save();