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