comparison core/modules/node/tests/src/Functional/NodeAccessFieldTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
1 <?php 1 <?php
2 2
3 namespace Drupal\Tests\node\Functional; 3 namespace Drupal\Tests\node\Functional;
4 4
5 use Drupal\Component\Utility\Unicode;
6 use Drupal\field\Entity\FieldConfig; 5 use Drupal\field\Entity\FieldConfig;
7 use Drupal\field\Entity\FieldStorageConfig; 6 use Drupal\field\Entity\FieldStorageConfig;
8 7
9 /** 8 /**
10 * Tests the interaction of the node access system with fields. 9 * Tests the interaction of the node access system with fields.
49 // Create some users. 48 // Create some users.
50 $this->adminUser = $this->drupalCreateUser(['access content', 'bypass node access']); 49 $this->adminUser = $this->drupalCreateUser(['access content', 'bypass node access']);
51 $this->contentAdminUser = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields']); 50 $this->contentAdminUser = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields']);
52 51
53 // Add a custom field to the page content type. 52 // Add a custom field to the page content type.
54 $this->fieldName = Unicode::strtolower($this->randomMachineName() . '_field_name'); 53 $this->fieldName = mb_strtolower($this->randomMachineName() . '_field_name');
55 FieldStorageConfig::create([ 54 FieldStorageConfig::create([
56 'field_name' => $this->fieldName, 55 'field_name' => $this->fieldName,
57 'entity_type' => 'node', 56 'entity_type' => 'node',
58 'type' => 'text' 57 'type' => 'text',
59 ])->save(); 58 ])->save();
60 FieldConfig::create([ 59 FieldConfig::create([
61 'field_name' => $this->fieldName, 60 'field_name' => $this->fieldName,
62 'entity_type' => 'node', 61 'entity_type' => 'node',
63 'bundle' => 'page', 62 'bundle' => 'page',