ConfigEntityListMultilingualTest.php in Zircon Profile 8
File
core/modules/config/src/Tests/ConfigEntityListMultilingualTest.php
View source
<?php
namespace Drupal\config\Tests;
use Drupal\simpletest\WebTestBase;
use Drupal\language\Entity\ConfigurableLanguage;
class ConfigEntityListMultilingualTest extends WebTestBase {
public static $modules = array(
'config_test',
'language',
'block',
);
protected function setUp() {
parent::setUp();
\Drupal::entityManager()
->getStorage('config_test')
->load('override')
->delete();
ConfigurableLanguage::createFromLangcode('hu')
->save();
$this
->drupalPlaceBlock('local_actions_block');
}
function testListUI() {
$this
->drupalLogin($this
->drupalCreateUser(array(
'access administration pages',
'administer site configuration',
)));
$this
->drupalGet('admin/structure/config_test');
$this
->assertLinkByHref('admin/structure/config_test/manage/dotted.default');
$this
->clickLink('Add test configuration');
$edit = array(
'label' => 'Antilop',
'id' => 'antilop',
'langcode' => 'hu',
);
$this
->drupalPostForm(NULL, $edit, t('Save'));
$this
->assertLinkByHref('admin/structure/config_test/manage/antilop');
$this
->drupalGet('hu/admin/structure/config_test');
$this
->assertLinkByHref('hu/admin/structure/config_test/manage/dotted.default');
$this
->assertLinkByHref('hu/admin/structure/config_test/manage/antilop');
}
}