OptionsDynamicValuesApiTest.php in Drupal 8
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
->assertEqual([], $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
->assertEqual($expected_values, $values);
}
}