diff --git a/test/AbstractTest.php b/test/AbstractTest.php index 94b146ff9..d8799021e 100644 --- a/test/AbstractTest.php +++ b/test/AbstractTest.php @@ -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%', @@ -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%', @@ -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%', diff --git a/test/EmailAddressTest.php b/test/EmailAddressTest.php index 35b4936b5..ebb501f7e 100644 --- a/test/EmailAddressTest.php +++ b/test/EmailAddressTest.php @@ -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', diff --git a/test/HostnameTest.php b/test/HostnameTest.php index 3a166413d..9da52a7c5 100644 --- a/test/HostnameTest.php +++ b/test/HostnameTest.php @@ -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', ); diff --git a/test/StaticValidatorTest.php b/test/StaticValidatorTest.php index cae634245..a143761eb 100644 --- a/test/StaticValidatorTest.php +++ b/test/StaticValidatorTest.php @@ -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());