class AnalyzeTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views_ui/tests/src/Functional/AnalyzeTest.php \Drupal\Tests\views_ui\Functional\AnalyzeTest
- 9 core/modules/views_ui/tests/src/Functional/AnalyzeTest.php \Drupal\Tests\views_ui\Functional\AnalyzeTest
Tests the views analyze system.
@group views_ui
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\views\Functional\ViewTestBase uses ViewResultAssertionTrait
- class \Drupal\Tests\views_ui\Functional\UITestBase
- class \Drupal\Tests\views_ui\Functional\AnalyzeTest
- class \Drupal\Tests\views_ui\Functional\UITestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses ViewResultAssertionTrait
Expanded class hierarchy of AnalyzeTest
File
- core/
modules/ views_ui/ tests/ src/ Functional/ AnalyzeTest.php, line 10
Namespace
Drupal\Tests\views_ui\FunctionalView source
class AnalyzeTest extends UITestBase {
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'views_ui',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Views used by this test.
*
* @var array
*/
public static $testViews = [
'test_view',
];
/**
* Tests that analyze works in general.
*/
public function testAnalyzeBasic() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/structure/views/view/test_view/edit');
$this
->assertSession()
->linkExists('Analyze view');
// This redirects the user to the analyze form.
$this
->clickLink('Analyze view');
$this
->assertSession()
->titleEquals('View analysis | Drupal');
foreach ([
'ok',
'warning',
'error',
] as $type) {
// Check that analyse messages with the expected type found.
$this
->assertSession()
->elementExists('css', 'div.' . $type);
}
// This redirects the user back to the main views edit page.
$this
->submitForm([], 'Ok');
}
}