Mercurial > hg > isophonics-drupal-site
view core/modules/node/tests/src/Functional/NodeViewLanguageTest.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
<?php namespace Drupal\Tests\node\Functional; use Drupal\language\Entity\ConfigurableLanguage; /** * Tests the node language extra field display. * * @group node */ class NodeViewLanguageTest extends NodeTestBase { /** * Modules to enable. * * @var array */ public static $modules = ['node', 'datetime', 'language']; /** * Tests the language extra field display. */ public function testViewLanguage() { // Add Spanish language. ConfigurableLanguage::createFromLangcode('es')->save(); // Set language field visible. entity_get_display('node', 'page', 'full') ->setComponent('langcode') ->save(); // Create a node in Spanish. $node = $this->drupalCreateNode(['langcode' => 'es']); $this->drupalGet($node->toUrl()); $this->assertText('Spanish', 'The language field is displayed properly.'); } }