NodeAutosaveFormTest.php in Autosave Form 8
File
tests/src/FunctionalJavascript/ContentEntity/NodeAutosaveFormTest.php
View source
<?php
namespace Drupal\Tests\autosave_form\FunctionalJavascript\ContentEntity;
use Drupal\node\Entity\NodeType;
class NodeAutosaveFormTest extends ContentEntityAutosaveFormTestBase {
public static $modules = [
'node',
];
protected $entityType = 'node';
protected $bundle = 'article';
protected function prepareSetUp() {
if (NodeType::load($this->bundle) === NULL) {
$this
->drupalCreateContentType([
'type' => $this->bundle,
]);
}
parent::prepareSetUp();
}
protected function getCreateNewEntityURL() {
return "node/add/{$this->bundle}";
}
protected function getUserPermissions() {
return [
"create {$this->bundle} content",
"edit own {$this->bundle} content",
];
}
}