protected function setUp() { parent::setUp(); $this->addDefaultCommentField('node', 'resttest'); // Get the 'serializer' service. $this->serializer = $this->container->get('serializer'); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // Create an entity programmatic. $this->entity = $this->entityCreate('entity_test'); $this->entity->save(); Role::load(AccountInterface::ANONYMOUS_ROLE)->grantPermission('view test entity')->save(); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->config = $this->config('rest.settings'); // Create an entity programmatically. $this->entity = $this->entityCreate('entity_test'); $this->entity->save(); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); $permissions = $this->entityPermissions('node', 'view'); $account = $this->drupalCreateUser($permissions); $this->drupalLogin($account); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->enableService('entity:' . $this->testEntityType, 'POST', 'hal_json', array('basic_auth', 'cookie')); // Create a user account that has the required permissions to create // resources via the REST API. $permissions = $this->entityPermissions($this->testEntityType, 'create'); $this->account = $this->drupalCreateUser($permissions); // Serialize an entity to a string to use in the content body of the POST // request. $serializer = $this->container->get('serializer'); $entity_values = $this->entityValues($this->testEntityType); $entity = $this->container->get('entity_type.manager')->getStorage($this->testEntityType)->create($entity_values); $this->serialized = $serializer->serialize($entity, $this->defaultFormat); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); $this->addDefaultCommentField('entity_test', 'entity_test'); }
protected function setUp() { parent::setUp(); // Enable REST API for the watchdog resource. $this->enableService('dblog'); }
protected function setUp() { parent::setUp(); // Get the 'serializer' service. $this->serializer = $this->container->get('serializer'); }
public function setUp() { parent::setUp(); $this->enableService('annotationExample'); }