Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/5111'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/AbstractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public function testGlobalDefaultTranslatorNullByDefault()

public function testErrorMessagesAreTranslatedWhenTranslatorPresent()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}

$loader = new TestAsset\ArrayTranslator();
$loader->translations = array(
'fooMessage' => 'This is the translated message for %value%',
Expand All @@ -88,6 +92,10 @@ public function testErrorMessagesAreTranslatedWhenTranslatorPresent()

public function testCanTranslateMessagesInsteadOfKeys()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}

$loader = new TestAsset\ArrayTranslator();
$loader->translations = array(
'%value% was passed' => 'This is the translated message for %value%',
Expand Down Expand Up @@ -149,6 +157,10 @@ public function testTranslatorEnabledPerDefault()

public function testCanDisableTranslator()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}

$loader = new TestAsset\ArrayTranslator();
$loader->translations = array(
'%value% was passed' => 'This is the translated message for %value%',
Expand Down
4 changes: 4 additions & 0 deletions test/EmailAddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ public function testGetMessages()
*/
public function testHostnameValidatorMessagesShouldBeTranslated()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}

$hostnameValidator = new Hostname();
$translations = array(
'hostnameIpAddressNotAllowed' => 'hostnameIpAddressNotAllowed translation',
Expand Down
4 changes: 4 additions & 0 deletions test/HostnameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ public function testGetAllow()
*/
public function testValidatorMessagesShouldBeTranslated()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}

$translations = array(
'hostnameInvalidLocalName' => 'this is the IP error message',
);
Expand Down
4 changes: 4 additions & 0 deletions test/StaticValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ public function testLocalTranslatorPreferredOverGlobalTranslator()

public function testMaximumErrorMessageLength()
{
if (!extension_loaded('intl')) {
$this->markTestSkipped('ext/intl not enabled');
}

$this->assertEquals(-1, AbstractValidator::getMessageLength());
AbstractValidator::setMessageLength(10);
$this->assertEquals(10, AbstractValidator::getMessageLength());
Expand Down

0 comments on commit 047576f

Please sign in to comment.