FacetSummaryResourceTestBase.php in Facets 8
File
modules/facets_summary/tests/src/Functional/Rest/FacetSummaryResourceTestBase.php
View source
<?php
namespace Drupal\Tests\facets_summary\Functional\Rest;
use Drupal\facets_summary\Entity\FacetsSummary;
use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
abstract class FacetSummaryResourceTestBase extends EntityResourceTestBase {
public static $modules = [
'facets_summary',
];
public static $entityTypeId = 'facets_summary';
protected static $labelFieldName = 'name';
protected $defaultTheme = 'stark';
protected function setUpAuthorization($method) {
$this
->grantPermissionsToTestedRole([
'administer facets',
]);
}
public function createEntity() {
$entity = FacetsSummary::create();
$entity
->set('id', 'tapir')
->set('name', 'Tapir')
->set('uuid', 'tapir-uuid')
->save();
return $entity;
}
protected function getExpectedNormalizedEntity() {
return [
'dependencies' => [],
'facet_source_id' => NULL,
'facets' => [],
'id' => 'tapir',
'langcode' => 'en',
'name' => 'Tapir',
'processor_configs' => [],
'status' => TRUE,
'uuid' => 'tapir-uuid',
];
}
protected function getNormalizedPostEntity() {
}
}