class NodeViewsAnalyzeTest
Same name and namespace in other branches
- 11.x core/modules/node/tests/src/Functional/Views/NodeViewsAnalyzeTest.php \Drupal\Tests\node\Functional\Views\NodeViewsAnalyzeTest
Tests node_views_analyze().
@group node
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\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\node\Functional\Views\NodeTestBase implements \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\node\Functional\Views\NodeViewsAnalyzeTest implements \Drupal\Tests\node\Functional\Views\NodeTestBase
- class \Drupal\Tests\node\Functional\Views\NodeTestBase implements \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of NodeViewsAnalyzeTest
File
-
core/
modules/ node/ tests/ src/ Functional/ Views/ NodeViewsAnalyzeTest.php, line 10
Namespace
Drupal\Tests\node\Functional\ViewsView source
class NodeViewsAnalyzeTest extends NodeTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'views_ui',
'node_test_views',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = [
'test_node_views_analyze',
];
/**
* Tests the implementation of node_views_analyze().
*/
public function testNodeViewsAnalyze() {
// Create user with permission to view analyze message on views_ui.
$admin_user = $this->createUser([
'administer views',
]);
$this->drupalLogin($admin_user);
// Access to views analyze page.
$this->drupalGet('admin/structure/views/nojs/analyze/test_node_views_analyze/page_1');
// Should return 200 with correct permission.
$this->assertSession()
->statusCodeEquals(200);
$this->assertSession()
->responseContains('has set node/% as path. This will not produce what you want. If you want to have multiple versions of the node view, use Layout Builder.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.