Mercurial > hg > isophonics-drupal-site
comparison core/modules/options/tests/src/Functional/OptionsDynamicValuesApiTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\options\Functional; | |
4 | |
5 /** | |
6 * Tests the options allowed values api. | |
7 * | |
8 * @group options | |
9 */ | |
10 class OptionsDynamicValuesApiTest extends OptionsDynamicValuesTestBase { | |
11 | |
12 /** | |
13 * Tests options_allowed_values(). | |
14 * | |
15 * @see options_test_dynamic_values_callback() | |
16 */ | |
17 public function testOptionsAllowedValues() { | |
18 // Test allowed values without passed $items. | |
19 $values = options_allowed_values($this->fieldStorage); | |
20 $this->assertEqual([], $values); | |
21 | |
22 $values = options_allowed_values($this->fieldStorage, $this->entity); | |
23 | |
24 $expected_values = [ | |
25 $this->entity->label(), | |
26 $this->entity->url(), | |
27 $this->entity->uuid(), | |
28 $this->entity->bundle(), | |
29 ]; | |
30 $expected_values = array_combine($expected_values, $expected_values); | |
31 $this->assertEqual($expected_values, $values); | |
32 } | |
33 | |
34 } |