OptionsDynamicValuesApiTest.php in Drupal 10
File
core/modules/options/tests/src/Functional/OptionsDynamicValuesApiTest.php
View source
<?php
namespace Drupal\Tests\options\Functional;
class OptionsDynamicValuesApiTest extends OptionsDynamicValuesTestBase {
protected $defaultTheme = 'stark';
public function testOptionsAllowedValues() {
$values = options_allowed_values($this->fieldStorage);
$this
->assertEquals([], $values);
$values = options_allowed_values($this->fieldStorage, $this->entity);
$expected_values = [
$this->entity
->label(),
$this->entity
->toUrl()
->toString(),
$this->entity
->uuid(),
$this->entity
->bundle(),
];
$expected_values = array_combine($expected_values, $expected_values);
$this
->assertEquals($expected_values, $values);
}
}