class AnalyzeTest
Same name and namespace in other branches
- 11.x core/modules/views_ui/tests/src/Functional/AnalyzeTest.php \Drupal\Tests\views_ui\Functional\AnalyzeTest
- 10 core/modules/views_ui/tests/src/Functional/AnalyzeTest.php \Drupal\Tests\views_ui\Functional\AnalyzeTest
- 8.9.x 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 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\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\views_ui\Functional\UITestBase extends \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views_ui\Functional\AnalyzeTest extends \Drupal\Tests\views_ui\Functional\UITestBase
- class \Drupal\Tests\views_ui\Functional\UITestBase extends \Drupal\Tests\views\Functional\ViewTestBase
- class \Drupal\Tests\views\Functional\ViewTestBase uses \Drupal\views\Tests\ViewResultAssertionTrait extends \Drupal\Tests\BrowserTestBase
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');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.