Mercurial > hg > isophonics-drupal-site
comparison core/modules/taxonomy/tests/src/Functional/TaxonomyTestTrait.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\taxonomy\Functional; | 3 namespace Drupal\Tests\taxonomy\Functional; |
4 | 4 |
5 use Drupal\Component\Utility\Unicode; | |
6 use Drupal\Core\Language\LanguageInterface; | 5 use Drupal\Core\Language\LanguageInterface; |
7 use Drupal\taxonomy\Entity\Vocabulary; | 6 use Drupal\taxonomy\Entity\Vocabulary; |
8 use Drupal\taxonomy\Entity\Term; | 7 use Drupal\taxonomy\Entity\Term; |
9 | 8 |
10 /** | 9 /** |
18 public function createVocabulary() { | 17 public function createVocabulary() { |
19 // Create a vocabulary. | 18 // Create a vocabulary. |
20 $vocabulary = Vocabulary::create([ | 19 $vocabulary = Vocabulary::create([ |
21 'name' => $this->randomMachineName(), | 20 'name' => $this->randomMachineName(), |
22 'description' => $this->randomMachineName(), | 21 'description' => $this->randomMachineName(), |
23 'vid' => Unicode::strtolower($this->randomMachineName()), | 22 'vid' => mb_strtolower($this->randomMachineName()), |
24 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, | 23 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED, |
25 'weight' => mt_rand(0, 10), | 24 'weight' => mt_rand(0, 10), |
26 ]); | 25 ]); |
27 $vocabulary->save(); | 26 $vocabulary->save(); |
28 return $vocabulary; | 27 return $vocabulary; |