OptionsSelectDynamicValuesTest.php in Zircon Profile 8
File
core/modules/options/src/Tests/OptionsSelectDynamicValuesTest.php
View source
<?php
namespace Drupal\options\Tests;
class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase {
function testSelectListDynamic() {
$this->entity
->save();
$web_user = $this
->drupalCreateUser(array(
'view test entity',
'administer entity_test content',
));
$this
->drupalLogin($web_user);
$this
->drupalGet('entity_test_rev/manage/' . $this->entity
->id() . '/edit');
$options = $this
->xpath('//select[@id="edit-test-options"]/option');
$this
->assertEqual(count($options), count($this->test) + 1);
foreach ($options as $option) {
$value = (string) $option['value'];
if ($value != '_none') {
$this
->assertTrue(array_search($value, $this->test));
}
}
}
}