コード例 #1
0
ファイル: CreateTest.php プロジェクト: frankcr/sftw8
 protected function setUp()
 {
     parent::setUp();
     $this->addDefaultCommentField('node', 'resttest');
     // Get the 'serializer' service.
     $this->serializer = $this->container->get('serializer');
 }
コード例 #2
0
ファイル: ResourceTest.php プロジェクト: eigentor/tommiblog
 /**
  * {@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();
 }
コード例 #3
0
ファイル: ResourceTest.php プロジェクト: nstielau/drops-8
 /**
  * {@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();
 }
コード例 #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);
 }
コード例 #5
0
ファイル: CsrfTest.php プロジェクト: eigentor/tommiblog
 /**
  * {@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);
 }
コード例 #6
0
 /**
  * {@inheritdoc}
  */
 protected function setUp() {
   parent::setUp();
   $this->addDefaultCommentField('entity_test', 'entity_test');
 }
コード例 #7
0
 protected function setUp()
 {
     parent::setUp();
     // Enable REST API for the watchdog resource.
     $this->enableService('dblog');
 }
コード例 #8
0
ファイル: CreateTest.php プロジェクト: Nikola-xiii/d8intranet
 protected function setUp()
 {
     parent::setUp();
     // Get the 'serializer' service.
     $this->serializer = $this->container->get('serializer');
 }
コード例 #9
0
 public function setUp()
 {
     parent::setUp();
     $this->enableService('annotationExample');
 }