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