diff --git a/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php index f666527..e6cb08f 100644 --- a/core/modules/file/src/Tests/FileFieldWidgetTest.php +++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php @@ -429,7 +429,7 @@ public function testWidgetValidation() { $name = 'files[' . $field_name . '_0]'; // Check field is marked with expected attr for client-side validation. - $this->assertFieldByXPath('//input[@type="file" and @data-drupal-validate-extensions="[\"txt\"]"]', null, 'data-drupal-validate-extensions is present with expected value.'); + $this->assertFieldByXPath('//input[@type="file" and @data-drupal-validate-extensions=\'["txt"]\']', NULL, 'data-drupal-validate-extensions is present with expected value.'); // Upload file with incorrect extension, check for validation error. $edit[$name] = drupal_realpath($test_file_image->getFileUri()); diff --git a/core/modules/file/src/Tests/FileManagedFileElementTest.php b/core/modules/file/src/Tests/FileManagedFileElementTest.php index a0c6cf3..b102e47 100644 --- a/core/modules/file/src/Tests/FileManagedFileElementTest.php +++ b/core/modules/file/src/Tests/FileManagedFileElementTest.php @@ -20,7 +20,7 @@ public function testManagedFile() { // Check that relevant data- attributes are present for validations $this->drupalGet('file/test/validation/extension'); - $this->assertFieldByXPath('//input[@name="files[file]" and @data-drupal-validate-extensions="[\"txt\"]"]', NULL, 'The data-drupal-validate-extensions attribute is present with the expected value on the upload element.'); + $this->assertFieldByXPath('//input[@name="files[file]" and @data-drupal-validate-extensions=\'["txt"]\']', NULL, 'The data-drupal-validate-extensions attribute is present with the expected value on the upload element.'); // Perform the tests with all permutations of $form['#tree'], // $element['#extended'], and $element['#multiple']. diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php index 868c586..9b2f873 100644 --- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php @@ -328,10 +328,10 @@ public function testImageFieldSettings() { $this->assertNoFieldByXPath('//input[@id="edit-' . strtr($field_name, '_', '-') . '-2-upload"]', 'Upload field for second file not present after it is uploaded.'); $this->assertTrue($this->cssSelect('input#edit-' . strtr($field_name, '_', '-') . '-3-upload[multiple=multiple]'), 'Third file field presented having multiple attribute'); - $this->assertFieldByName('files[' . $field_name . '_3][]', null, 'Third file field has correct name'); + $this->assertFieldByName('files[' . $field_name . '_3][]', NULL, 'Third file field has correct name'); $this->assertTrue($this->cssSelect('input[id=edit-' . strtr($field_name, '_', '-') . '-3-upload][size=22]'), 'Third file field presented having correct size attribute'); $this->assertTrue($this->cssSelect('input.js-form-file.form-file[id=edit-' . strtr($field_name, '_', '-') . '-3-upload]'), 'Third file field presented having correct css classes'); - $this->assertFieldByXPath('//input[@id="edit-' . strtr($field_name, '_', '-') . '-3-upload"] and @data-drupal-validate-extensions="[\"txt\"]"]', NULL, 'The data-drupal-validate-extensions attribute is present with the expected value on the upload element.'); + $this->assertFieldByXPath('//input[@id="edit-' . strtr($field_name, '_', '-') . '-3-upload"] and @data-drupal-validate-extensions=\'["txt"]\']', NULL, 'The data-drupal-validate-extensions attribute is present with the expected value on the upload element.'); } /**