function ViewAjaxTest::testAjaxView
Same name in other branches
- 9 core/modules/views/tests/src/Functional/ViewAjaxTest.php \Drupal\Tests\views\Functional\ViewAjaxTest::testAjaxView()
- 8.9.x core/modules/views/tests/src/Functional/ViewAjaxTest.php \Drupal\Tests\views\Functional\ViewAjaxTest::testAjaxView()
- 10 core/modules/views/tests/src/Functional/ViewAjaxTest.php \Drupal\Tests\views\Functional\ViewAjaxTest::testAjaxView()
Tests an ajax view.
File
-
core/
modules/ views/ tests/ src/ Functional/ ViewAjaxTest.php, line 40
Class
- ViewAjaxTest
- Tests the ajax view functionality.
Namespace
Drupal\Tests\views\FunctionalCode
public function testAjaxView() : void {
$this->drupalGet('test_ajax_view');
$drupal_settings = $this->getDrupalSettings();
$this->assertTrue(isset($drupal_settings['views']['ajax_path']), 'The Ajax callback path is set in drupalSettings.');
$this->assertCount(1, $drupal_settings['views']['ajaxViews']);
$view_entry = array_keys($drupal_settings['views']['ajaxViews'])[0];
$this->assertEquals('test_ajax_view', $drupal_settings['views']['ajaxViews'][$view_entry]['view_name'], 'The view\'s ajaxViews array entry has the correct \'view_name\' key.');
$this->assertEquals('page_1', $drupal_settings['views']['ajaxViews'][$view_entry]['view_display_id'], 'The view\'s ajaxViews array entry has the correct \'view_display_id\' key.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.