Commit a34dfb22 authored by catch's avatar catch

Issue #2618886 by alexpott:...

Issue #2618886 by alexpott: LocalePluralFormatTest::testPluralEditDateFormatter() is failing randomly
parent 23fb7c82
......@@ -17,6 +17,13 @@
*/
class LocalePluralFormatTest extends WebTestBase {
/**
* An admin user.
*
* @var \Drupal\user\Entity\User
*/
protected $adminUser;
/**
* Modules to enable.
*
......@@ -30,8 +37,8 @@ class LocalePluralFormatTest extends WebTestBase {
protected function setUp() {
parent::setUp();
$admin_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
$this->drupalLogin($admin_user);
$this->adminUser = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages'));
$this->drupalLogin($this->adminUser);
}
/**
......@@ -158,7 +165,10 @@ public function testPluralEditDateFormatter() {
// Set French as the site default language.
$this->config('system.site')->set('default_langcode', 'fr')->save();
// Visit User Info page before updating translation strings.
// Visit User Info page before updating translation strings. Change the
// created time to ensure that the we're dealing in seconds and it can't be
// exactly 1 minute.
$this->adminUser->set('created', time() - 1)->save();
$this->drupalGet('user');
// Member for time should be translated.
......@@ -199,9 +209,12 @@ public function testPluralEditDateFormatter() {
// User interface input for translating seconds should not be duplicated
$this->assertUniqueText('@count seconds', 'Interface translation input for @count seconds only appears once.');
// Member for time should be translated.
// Member for time should be translated. Change the created time to ensure
// that the we're dealing in multiple seconds and it can't be exactly 1
// second or minute.
$this->adminUser->set('created', time() - 2)->save();
$this->drupalGet('user');
$this->assertText("seconde", "'Member for' text is translated.");
$this->assertText("secondes updated", "'Member for' text is translated.");
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment