Esempio n. 1
0
 protected function setUp()
 {
     parent::setUp();
     $this->addDefaultCommentField('node', 'resttest');
     // Get the 'serializer' service.
     $this->serializer = $this->container->get('serializer');
 }
Esempio n. 2
0
 /**
  * {@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();
 }
Esempio n. 3
0
 /**
  * {@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);
 }
Esempio n. 5
0
 /**
  * {@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);
 }
Esempio n. 6
0
 /**
  * {@inheritdoc}
  */
 protected function setUp() {
   parent::setUp();
   $this->addDefaultCommentField('entity_test', 'entity_test');
 }
Esempio n. 7
0
 protected function setUp()
 {
     parent::setUp();
     // Enable REST API for the watchdog resource.
     $this->enableService('dblog');
 }
Esempio n. 8
0
 protected function setUp()
 {
     parent::setUp();
     // Get the 'serializer' service.
     $this->serializer = $this->container->get('serializer');
 }
 public function setUp()
 {
     parent::setUp();
     $this->enableService('annotationExample');
 }