OptionsSelectDynamicValuesTest.php in Drupal 10
File
core/modules/options/tests/src/Functional/OptionsSelectDynamicValuesTest.php
View source
<?php
namespace Drupal\Tests\options\Functional;
class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase {
protected $defaultTheme = 'stark';
public function testSelectListDynamic() {
$this->entity
->save();
$web_user = $this
->drupalCreateUser([
'view test entity',
'administer entity_test content',
]);
$this
->drupalLogin($web_user);
$this
->drupalGet('entity_test_rev/manage/' . $this->entity
->id() . '/edit');
$options = $this
->assertSession()
->selectExists('edit-test-options')
->findAll('css', 'option');
$this
->assertCount(count($this->test) + 1, $options);
foreach ($options as $option) {
$value = $option
->getValue();
if ($value != '_none') {
$this
->assertContains($value, $this->test);
}
}
}
}