comparison core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 4c8ae668cc8c
children af1871eacc83
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
1 <?php 1 <?php
2 2
3 namespace Drupal\Tests\locale\Functional; 3 namespace Drupal\Tests\locale\Functional;
4 4
5 use Drupal\Component\Render\FormattableMarkup; 5 use Drupal\Component\Render\FormattableMarkup;
6 use Drupal\Component\Utility\SafeMarkup;
7 6
8 /** 7 /**
9 * Tests for the user interface of project interface translations. 8 * Tests for the user interface of project interface translations.
10 * 9 *
11 * @group locale 10 * @group locale
84 $this->drupalGet('admin/reports/translations'); 83 $this->drupalGet('admin/reports/translations');
85 $this->assertText(t('Missing translations for one project'), 'No translations found'); 84 $this->assertText(t('Missing translations for one project'), 'No translations found');
86 $release_details = new FormattableMarkup('@module (@version). @info', [ 85 $release_details = new FormattableMarkup('@module (@version). @info', [
87 '@module' => 'Locale test translate', 86 '@module' => 'Locale test translate',
88 '@version' => '1.3-dev', 87 '@version' => '1.3-dev',
89 '@info' => t('File not found at %local_path', ['%local_path' => 'core/modules/locale/tests/test.de.po']) 88 '@info' => t('File not found at %local_path', ['%local_path' => 'core/modules/locale/tests/test.de.po']),
90 ]); 89 ]);
91 $this->assertRaw($release_details->__toString(), 'Release details'); 90 $this->assertRaw($release_details->__toString(), 'Release details');
92 91
93 // Override Drupal core translation status as 'no translations found'. 92 // Override Drupal core translation status as 'no translations found'.
94 $status = locale_translation_get_status(); 93 $status = locale_translation_get_status();
110 \Drupal::keyValue('locale.translation_status')->set('drupal', $status['drupal']); 109 \Drupal::keyValue('locale.translation_status')->set('drupal', $status['drupal']);
111 110
112 // Check if translations are available for Drupal core. 111 // Check if translations are available for Drupal core.
113 $this->drupalGet('admin/reports/translations'); 112 $this->drupalGet('admin/reports/translations');
114 $this->assertText(t('Updates for: @project', ['@project' => t('Drupal core')]), 'Translations found'); 113 $this->assertText(t('Updates for: @project', ['@project' => t('Drupal core')]), 'Translations found');
115 $this->assertText(SafeMarkup::format('@module (@date)', ['@module' => t('Drupal core'), '@date' => format_date(REQUEST_TIME, 'html_date')]), 'Core translation update'); 114 $this->assertText(new FormattableMarkup('@module (@date)', ['@module' => t('Drupal core'), '@date' => format_date(REQUEST_TIME, 'html_date')]), 'Core translation update');
116 $update_button = $this->xpath('//input[@type="submit"][@value="' . t('Update translations') . '"]'); 115 $update_button = $this->xpath('//input[@type="submit"][@value="' . t('Update translations') . '"]');
117 $this->assertTrue($update_button, 'Update translations button'); 116 $this->assertTrue($update_button, 'Update translations button');
118 } 117 }
119 118
120 } 119 }