EntityLegalTestBase.php in Entity Legal 3.0.x
File
src/Tests/EntityLegalTestBase.php
View source
<?php
namespace Drupal\entity_legal\Tests;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\entity_legal\Traits\EntityLegalTestTrait;
abstract class EntityLegalTestBase extends WebTestBase {
use EntityLegalTestTrait;
protected $adminUser;
public static $modules = [
'block',
'entity_legal',
'field_ui',
'token',
];
protected function setUp() {
parent::setUp();
$this->adminUser = $this
->drupalCreateUser([
'administer entity legal',
'administer permissions',
'administer user form display',
'administer users',
]);
if ($this->profile !== 'standard') {
$this
->drupalPlaceBlock('local_actions_block');
$this
->drupalPlaceBlock('page_title_block');
}
}
protected function randomMachineName($length = 8) {
return strtolower(parent::randomMachineName($length));
}
public function getUncachedEntity($entity_type, $entity_id) {
$controller = \Drupal::entityTypeManager()
->getStorage($entity_type);
$controller
->resetCache([
$entity_id,
]);
return $controller
->load($entity_id);
}
}