core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php index 728ec5e..6bc7d27 100644 --- a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php +++ b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php @@ -94,11 +94,13 @@ function testUserWithoutPermission() { // Edit's JavaScript would never hit these endpoints if the metadata was // empty as above, but we need to make sure that malicious users aren't able // to use any of the other endpoints either. - $response = $this->retrieveAttachments(array('form')); + $post = array('editors[0]' => 'form') + $this->getAjaxPageStatePostData(); + $response = $this->drupalPostUrl('edit/attachments', 'application/vnd.drupal-ajax', $post); // @todo Uncomment the below once https://drupal.org/node/2063303 is fixed. // $this->assertIdentical('[]', $response); $this->assertResponse(403); - $response = $this->retrieveFieldForm('node/1/body/und/full'); + $post = array('nocssjs' => 'true') + $this->getAjaxPageStatePostData(); + $response = $this->drupalPostUrl('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post); // @todo Uncomment the below once https://drupal.org/node/2063303 is fixed. // $this->assertIdentical('[]', $response); $this->assertResponse(403); @@ -110,11 +112,12 @@ function testUserWithoutPermission() { $edit['body[und][0][value]'] = '
Malicious content.
'; $edit['body[und][0][format]'] = 'filtered_html'; $edit['op'] = t('Save'); - $response = $this->submitFieldForm('node/1/body/und/full', $edit); + $response = $this->drupalPostUrl('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post); // @todo Uncomment the below once https://drupal.org/node/2063303 is fixed. // $this->assertIdentical('[]', $response); $this->assertResponse(403); - $response = $this->saveEntity('node/1'); + $post = array('nocssjs' => 'true'); + $response = $this->drupalPostUrl('edit/entity/' . 'node/1', 'application/json', $post); // @todo Uncomment the below once https://drupal.org/node/2063303 is fixed. // $this->assertIdentical('[]', $response); $this->assertResponse(403);