Drupal 8.0.0 beta 12. More info: https://www.drupal.org/node/2514176
This commit is contained in:
commit
9921556621
13277 changed files with 1459781 additions and 0 deletions
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\options\Tests\OptionsSelectDynamicValuesTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\options\Tests;
|
||||
|
||||
/**
|
||||
* Tests an options select with a dynamic allowed values function.
|
||||
*
|
||||
* @group options
|
||||
*/
|
||||
class OptionsSelectDynamicValuesTest extends OptionsDynamicValuesTestBase {
|
||||
/**
|
||||
* Tests the 'options_select' widget (single select).
|
||||
*/
|
||||
function testSelectListDynamic() {
|
||||
// Create an entity.
|
||||
$this->entity->save();
|
||||
|
||||
// Create a web user.
|
||||
$web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content'));
|
||||
$this->drupalLogin($web_user);
|
||||
|
||||
// Display form.
|
||||
$this->drupalGet('entity_test_rev/manage/' . $this->entity->id());
|
||||
$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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in a new issue