class ViewNonTranslatableEntityTest
Same name and namespace in other branches
- 11.x core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php \Drupal\Tests\views\Functional\Entity\ViewNonTranslatableEntityTest
- 10 core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php \Drupal\Tests\views\Functional\Entity\ViewNonTranslatableEntityTest
- 8.9.x core/modules/views/tests/src/Functional/Entity/ViewNonTranslatableEntityTest.php \Drupal\Tests\views\Functional\Entity\ViewNonTranslatableEntityTest
Tests the view creation of non-translatable entities.
@group views
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 implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\views\Functional\Entity\ViewNonTranslatableEntityTest implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of ViewNonTranslatableEntityTest
File
-
core/
modules/ views/ tests/ src/ Functional/ Entity/ ViewNonTranslatableEntityTest.php, line 14
Namespace
Drupal\Tests\views\Functional\EntityView source
class ViewNonTranslatableEntityTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'entity_test',
'content_translation',
'language_test',
'views_ui',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests displaying a view of non-translatable entities.
*/
public function testViewNoTranslatableEntity() {
// Add a new language.
ConfigurableLanguage::createFromLangcode('sr')->save();
// Create a non-translatable entity.
$no_language_entity = NoLanguageEntityTest::create();
$no_language_entity->save();
// Visit the view page and assert it is displayed properly.
$this->drupalGet('no-entity-translation-view');
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->pageTextContains('No Entity Translation View');
$this->assertSession()
->pageTextContains($no_language_entity->uuid());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.