class LanguageEntityFieldAccessHookTest
Same name and namespace in other branches
- 10 core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php \Drupal\Tests\language\Functional\LanguageEntityFieldAccessHookTest
- 11.x core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php \Drupal\Tests\language\Functional\LanguageEntityFieldAccessHookTest
- 8.9.x core/modules/language/tests/src/Functional/LanguageEntityFieldAccessHookTest.php \Drupal\Tests\language\Functional\LanguageEntityFieldAccessHookTest
Tests language picker compatibility with hook_entity_field_access.
@group language
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\language\Functional\LanguageEntityFieldAccessHookTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of LanguageEntityFieldAccessHookTest
File
-
core/
modules/ language/ tests/ src/ Functional/ LanguageEntityFieldAccessHookTest.php, line 12
Namespace
Drupal\Tests\language\FunctionalView source
class LanguageEntityFieldAccessHookTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'node',
'text',
'field',
'filter',
'language',
'language_entity_field_access_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests compatibility with hook_entity_field_access().
*/
public function testHookEntityFieldAccess() {
// Create an admin user and do the login.
$user = $this->drupalCreateUser([], NULL, TRUE);
$this->drupalLogin($user);
// Assess the field is not visible.
$this->drupalGet('node/add/page');
$this->assertSession()
->fieldNotExists('langcode[0][value]');
$this->drupalLogout();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.