comparison core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.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
6 * Tests an options select with a dynamic allowed values function. 6 * Tests an options select with a dynamic allowed values function.
7 * 7 *
8 * @group options 8 * @group options
9 */ 9 */
10 class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase { 10 class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase {
11
11 /** 12 /**
12 * Tests the 'options_select' widget (single select). 13 * Tests the 'options_select' widget (single select).
13 */ 14 */
14 public function testSelectListDynamic() { 15 public function testSelectListDynamic() {
15 // Create an entity. 16 // Create an entity.
22 // Display form. 23 // Display form.
23 $this->drupalGet('entity_test_rev/manage/' . $this->entity->id() . '/edit'); 24 $this->drupalGet('entity_test_rev/manage/' . $this->entity->id() . '/edit');
24 $options = $this->xpath('//select[@id="edit-test-options"]/option'); 25 $options = $this->xpath('//select[@id="edit-test-options"]/option');
25 $this->assertEqual(count($options), count($this->test) + 1); 26 $this->assertEqual(count($options), count($this->test) + 1);
26 foreach ($options as $option) { 27 foreach ($options as $option) {
27 $value = (string) $option['value']; 28 $value = $option->getValue();
28 if ($value != '_none') { 29 if ($value != '_none') {
29 $this->assertTrue(array_search($value, $this->test)); 30 $this->assertTrue(array_search($value, $this->test));
30 } 31 }
31 } 32 }
32 } 33 }