Mercurial > hg > isophonics-drupal-site
comparison core/modules/taxonomy/tests/src/Functional/TermIndexTest.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 | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\Tests\taxonomy\Functional; | 3 namespace Drupal\Tests\taxonomy\Functional; |
4 | 4 |
5 use Drupal\Component\Utility\Unicode; | |
6 use Drupal\Core\Field\FieldStorageDefinitionInterface; | 5 use Drupal\Core\Field\FieldStorageDefinitionInterface; |
7 | 6 |
8 /** | 7 /** |
9 * Tests the hook implementations that maintain the taxonomy index. | 8 * Tests the hook implementations that maintain the taxonomy index. |
10 * | 9 * |
47 $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access'])); | 46 $this->drupalLogin($this->drupalCreateUser(['administer taxonomy', 'bypass node access'])); |
48 | 47 |
49 // Create a vocabulary and add two term reference fields to article nodes. | 48 // Create a vocabulary and add two term reference fields to article nodes. |
50 $this->vocabulary = $this->createVocabulary(); | 49 $this->vocabulary = $this->createVocabulary(); |
51 | 50 |
52 $this->fieldName1 = Unicode::strtolower($this->randomMachineName()); | 51 $this->fieldName1 = mb_strtolower($this->randomMachineName()); |
53 $handler_settings = [ | 52 $handler_settings = [ |
54 'target_bundles' => [ | 53 'target_bundles' => [ |
55 $this->vocabulary->id() => $this->vocabulary->id(), | 54 $this->vocabulary->id() => $this->vocabulary->id(), |
56 ], | 55 ], |
57 'auto_create' => TRUE, | 56 'auto_create' => TRUE, |
67 ->setComponent($this->fieldName1, [ | 66 ->setComponent($this->fieldName1, [ |
68 'type' => 'entity_reference_label', | 67 'type' => 'entity_reference_label', |
69 ]) | 68 ]) |
70 ->save(); | 69 ->save(); |
71 | 70 |
72 $this->fieldName2 = Unicode::strtolower($this->randomMachineName()); | 71 $this->fieldName2 = mb_strtolower($this->randomMachineName()); |
73 $this->createEntityReferenceField('node', 'article', $this->fieldName2, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); | 72 $this->createEntityReferenceField('node', 'article', $this->fieldName2, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED); |
74 | 73 |
75 entity_get_form_display('node', 'article', 'default') | 74 entity_get_form_display('node', 'article', 'default') |
76 ->setComponent($this->fieldName2, [ | 75 ->setComponent($this->fieldName2, [ |
77 'type' => 'options_select', | 76 'type' => 'options_select', |