class RdfCommentStorageLoadTest
Tests rdf_comment_storage_load.
@group rdf @group legacy
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Entity\EntityKernelTestBase uses \Drupal\Tests\user\Traits\UserCreationTrait implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\rdf\Kernel\RdfCommentStorageLoadTest implements \Drupal\KernelTests\Core\Entity\EntityKernelTestBase
- class \Drupal\KernelTests\Core\Entity\EntityKernelTestBase uses \Drupal\Tests\user\Traits\UserCreationTrait implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of RdfCommentStorageLoadTest
File
-
core/
modules/ rdf/ tests/ src/ Kernel/ RdfCommentStorageLoadTest.php, line 16
Namespace
Drupal\Tests\rdf\KernelView source
class RdfCommentStorageLoadTest extends EntityKernelTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'comment',
'rdf',
];
/**
* Tests rdf_comment_storage_load.
*/
public function testRdfCommentStorageLoad() {
$field_created_item = $this->prophesize(CreatedItem::class);
$field_created_item->setValue([
time(),
]);
$field_list = $this->prophesize(FieldItemList::class);
$field_list->reveal();
$field_list->first()
->willReturn($field_created_item->reveal());
$comment = $this->prophesize(Comment::class);
$comment->bundle()
->willReturn('page');
$comment->get('created')
->willReturn($field_list);
$comment->getFieldDefinitions()
->willReturn(NULL);
// Set commented entity and parent entity to NULL.
$comment->getCommentedEntity()
->willReturn(NULL);
$comment->getParentComment()
->willReturn(NULL);
/** @var \Drupal\Core\Extension\ModuleHandler $module_handler */
$module_handler = \Drupal::service('module_handler');
$module_handler->invoke('rdf', 'comment_storage_load', [
[
$comment->reveal(),
],
]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.