comparison core/modules/system/src/Tests/System/ThemeTest.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 4c8ae668cc8c
children c2387f117808
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
150 // Relative path to arbitrary non-existing file. 150 // Relative path to arbitrary non-existing file.
151 'core/misc/whatever.png', 151 'core/misc/whatever.png',
152 // Semi-absolute path to arbitrary non-existing file. 152 // Semi-absolute path to arbitrary non-existing file.
153 '/core/misc/whatever.png', 153 '/core/misc/whatever.png',
154 // Absolute paths to any local file (even if it exists). 154 // Absolute paths to any local file (even if it exists).
155 drupal_realpath($file->uri), 155 \Drupal::service('file_system')->realpath($file->uri),
156 ]; 156 ];
157 $this->drupalGet('admin/appearance/settings'); 157 $this->drupalGet('admin/appearance/settings');
158 foreach ($unsupported_paths as $path) { 158 foreach ($unsupported_paths as $path) {
159 $edit = [ 159 $edit = [
160 'default_logo' => FALSE, 160 'default_logo' => FALSE,
166 166
167 // Upload a file to use for the logo. 167 // Upload a file to use for the logo.
168 $edit = [ 168 $edit = [
169 'default_logo' => FALSE, 169 'default_logo' => FALSE,
170 'logo_path' => '', 170 'logo_path' => '',
171 'files[logo_upload]' => drupal_realpath($file->uri), 171 'files[logo_upload]' => \Drupal::service('file_system')->realpath($file->uri),
172 ]; 172 ];
173 $this->drupalPostForm('admin/appearance/settings', $edit, t('Save configuration')); 173 $this->drupalPostForm('admin/appearance/settings', $edit, t('Save configuration'));
174 174
175 $fields = $this->xpath($this->constructFieldXpath('name', 'logo_path')); 175 $fields = $this->xpath($this->constructFieldXpath('name', 'logo_path'));
176 $uploaded_filename = 'public://' . $fields[0]['value']; 176 $uploaded_filename = 'public://' . $fields[0]['value'];
388 $this->clickLink(t('Set as default'), 1); 388 $this->clickLink(t('Set as default'), 1);
389 389
390 // Check that bartik can be uninstalled now. 390 // Check that bartik can be uninstalled now.
391 $this->assertRaw('Uninstall Bartik theme', 'A link to uninstall the Bartik theme does appear on the theme settings page.'); 391 $this->assertRaw('Uninstall Bartik theme', 'A link to uninstall the Bartik theme does appear on the theme settings page.');
392 392
393 // Check that the classy theme still can't be uninstalled as neither of it's 393 // Check that the classy theme still can't be uninstalled as neither of its
394 // base themes have been. 394 // base themes have been.
395 $this->assertNoRaw('Uninstall Classy theme', 'A link to uninstall the Classy theme does not appear on the theme settings page.'); 395 $this->assertNoRaw('Uninstall Classy theme', 'A link to uninstall the Classy theme does not appear on the theme settings page.');
396 396
397 // Uninstall each of the three themes starting with Bartik. 397 // Uninstall each of the three themes starting with Bartik.
398 $this->clickLink(t('Uninstall')); 398 $this->clickLink(t('Uninstall'));