comparison core/tests/Drupal/FunctionalJavascriptTests/Ajax/BackwardCompatibilityTest.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
1 <?php
2
3 namespace Drupal\FunctionalJavascriptTests\Ajax;
4
5 use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
6
7 /**
8 * Tests the compatibility of the ajax.es6.js file.
9 *
10 * @group Ajax
11 */
12 class BackwardCompatibilityTest extends JavascriptTestBase {
13
14 /**
15 * {@inheritdoc}
16 */
17 public static $modules = [
18 'js_ajax_test',
19 ];
20
21 /**
22 * Ensures Drupal.Ajax.element_settings BC layer.
23 */
24 public function testAjaxBackwardCompatibility() {
25 $this->drupalGet('/js_ajax_test');
26 $this->click('#edit-test-button');
27
28 $this->assertSession()
29 ->waitForElement('css', '#js_ajax_test_form_element');
30 $elements = $this->cssSelect('#js_ajax_test_form_element');
31 $this->assertCount(1, $elements);
32 $json = $elements[0]->getText();
33 $data = json_decode($json, TRUE);
34 $this->assertEquals([
35 'element_settings' => 'catbro',
36 'elementSettings' => 'catbro',
37 ], $data);
38 }
39
40 }