Mercurial > hg > isophonics-drupal-site
comparison core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.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 | 7a779792577d |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
112 public function testFileUpload() { | 112 public function testFileUpload() { |
113 $user1 = $this->drupalCreateUser(['access content', "create $this->referencingType content"]); | 113 $user1 = $this->drupalCreateUser(['access content', "create $this->referencingType content"]); |
114 $this->drupalLogin($user1); | 114 $this->drupalLogin($user1); |
115 | 115 |
116 $test_file = current($this->drupalGetTestFiles('text')); | 116 $test_file = current($this->drupalGetTestFiles('text')); |
117 $edit['files[file_field_0]'] = drupal_realpath($test_file->uri); | 117 $edit['files[file_field_0]'] = \Drupal::service('file_system')->realpath($test_file->uri); |
118 $this->drupalPostForm('node/add/' . $this->referencingType, $edit, 'Upload'); | 118 $this->drupalPostForm('node/add/' . $this->referencingType, $edit, 'Upload'); |
119 $this->assertResponse(200); | 119 $this->assertResponse(200); |
120 $edit = [ | 120 $edit = [ |
121 'title[0][value]' => $this->randomMachineName(), | 121 'title[0][value]' => $this->randomMachineName(), |
122 'test_field[0][target_id]' => $this->nodeId, | 122 'test_field[0][target_id]' => $this->nodeId, |