'entity_type' => 'entity_test',
'field_name' => 'comment',
'entity_id' =>
$host->
id(),
'comment_type' => 'entity_test',
'created' => 123456,
'status' => 1,
]);
$comment_anonymous->
save();
// @todo Expand the test coverage in https://www.drupal.org/node/2464635
$this->
assertFieldAccess('comment', 'cid',
$comment->
id());
$this->
assertFieldAccess('comment', 'cid',
$comment_anonymous->
id());
$this->
assertFieldAccess('comment', 'uuid',
$comment->
uuid());
$this->
assertFieldAccess('comment', 'subject', 'My comment title'
);
$this->
assertFieldAccess('comment', 'subject', 'Anonymous comment title'
);
$this->
assertFieldAccess('comment', 'name', 'anonymous'
);
$this->
assertFieldAccess('comment', 'mail', 'test@example.com'
);
$this->
assertFieldAccess('comment', 'homepage', 'https://example.com'
);
$this->
assertFieldAccess('comment', 'uid',
$user->
getAccountName());
// $this->assertFieldAccess('comment', 'created', \Drupal::service('date.formatter')->format(123456));
// $this->assertFieldAccess('comment', 'changed', \Drupal::service('date.formatter')->format(REQUEST_TIME));
$this->
assertFieldAccess('comment', 'status', 'On'
);
}