[Locale] changed inequality operator to strict checking and updated some assertions
This commit is contained in:
parent
09d30d3d1e
commit
fab1b5ac8f
@ -33,7 +33,7 @@ class MethodArgumentValueNotImplementedException extends NotImplementedException
|
||||
$methodName,
|
||||
$argName,
|
||||
var_export($argValue, true),
|
||||
$additionalMessage != '' ? ' '.$additionalMessage.'. ' : ''
|
||||
$additionalMessage !== '' ? ' '.$additionalMessage.'. ' : ''
|
||||
);
|
||||
|
||||
parent::__construct($message);
|
||||
|
@ -88,7 +88,7 @@ class TimeZoneTransformer extends Transformer
|
||||
));
|
||||
}
|
||||
|
||||
return 'Etc/GMT'.($hours != 0 ? $signal.$hours : '');
|
||||
return 'Etc/GMT'.($hours !== 0 ? $signal.$hours : '');
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException('The GMT time zone \'%s\' does not match with the supported formats GMT[+-]HH:MM or GMT[+-]HHMM.');
|
||||
|
@ -124,11 +124,11 @@ class StubIntlDateFormatter
|
||||
*/
|
||||
public function __construct($locale, $datetype, $timetype, $timezone = null, $calendar = self::GREGORIAN, $pattern = null)
|
||||
{
|
||||
if ('en' != $locale) {
|
||||
if ('en' !== $locale) {
|
||||
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'locale', $locale, 'Only the \'en\' locale is supported');
|
||||
}
|
||||
|
||||
if (self::GREGORIAN != $calendar) {
|
||||
if (self::GREGORIAN !== $calendar) {
|
||||
throw new MethodArgumentValueNotImplementedException(__METHOD__, 'calendar', $calendar, 'Only the GREGORIAN calendar is supported');
|
||||
}
|
||||
|
||||
|
@ -480,7 +480,7 @@ class StubLocale
|
||||
*/
|
||||
static private function getStubData($locale, $cacheVariable, $stubDataDir)
|
||||
{
|
||||
if ('en' != $locale) {
|
||||
if ('en' !== $locale) {
|
||||
throw new \InvalidArgumentException(sprintf('Only the \'en\' locale is supported. %s', NotImplementedException::INTL_INSTALL_MESSAGE));
|
||||
}
|
||||
|
||||
|
@ -94,10 +94,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertSame($expected, $formatter->format($timestamp));
|
||||
$this->assertSame($errorMessage, StubIntl::getErrorMessage());
|
||||
$this->assertSame($errorCode, StubIntl::getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertFalse(StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode()));
|
||||
$this->assertFalse(StubIntl::isFailure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -115,7 +115,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertSame($expected, $formatter->format($timestamp));
|
||||
$this->assertSame($errorMessage, intl_get_error_message());
|
||||
$this->assertSame($errorCode, intl_get_error_code());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code()));
|
||||
$this->assertFalse(intl_is_failure(intl_get_error_code()));
|
||||
}
|
||||
|
||||
public function formatProvider()
|
||||
@ -323,10 +323,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertFalse($formatter->format($timestamp));
|
||||
$this->assertSame($errorMessage, StubIntl::getErrorMessage());
|
||||
$this->assertSame($errorCode, StubIntl::getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertTrue(StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode()));
|
||||
$this->assertTrue(StubIntl::isFailure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -343,7 +343,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertFalse($formatter->format($timestamp));
|
||||
$this->assertSame($errorMessage, intl_get_error_message());
|
||||
$this->assertSame($errorCode, intl_get_error_code());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code()));
|
||||
$this->assertTrue(intl_is_failure(intl_get_error_code()));
|
||||
}
|
||||
|
||||
public function formatErrorProvider()
|
||||
@ -598,7 +598,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertSame($expected, $formatter->parse($value));
|
||||
$this->assertSame($errorMessage, intl_get_error_message());
|
||||
$this->assertSame($errorCode, intl_get_error_code());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code()));
|
||||
$this->assertFalse(intl_is_failure(intl_get_error_code()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -613,10 +613,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertSame($expected, $formatter->parse($value));
|
||||
$this->assertSame($errorMessage, StubIntl::getErrorMessage());
|
||||
$this->assertSame($errorCode, StubIntl::getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertFalse(StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode()));
|
||||
$this->assertFalse(StubIntl::isFailure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
public function parseProvider()
|
||||
@ -775,7 +775,7 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertFalse($formatter->parse($value));
|
||||
$this->assertSame($errorMessage, intl_get_error_message());
|
||||
$this->assertSame($errorCode, intl_get_error_code());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code()));
|
||||
$this->assertTrue(intl_is_failure(intl_get_error_code()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -790,10 +790,10 @@ class StubIntlDateFormatterTest extends LocaleTestCase
|
||||
$this->assertFalse($formatter->parse($value));
|
||||
$this->assertSame($errorMessage, StubIntl::getErrorMessage());
|
||||
$this->assertSame($errorCode, StubIntl::getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertTrue(StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode()));
|
||||
$this->assertTrue(StubIntl::isFailure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
public function parseErrorProvider()
|
||||
|
@ -233,10 +233,10 @@ class StubNumberFormatterTest extends LocaleTestCase
|
||||
|
||||
$this->assertSame($errorMessage, StubIntl::getErrorMessage());
|
||||
$this->assertSame($errorCode, StubIntl::getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertFalse(StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode()));
|
||||
$this->assertFalse(StubIntl::isFailure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
public function testFormatIntl()
|
||||
@ -251,10 +251,10 @@ class StubNumberFormatterTest extends LocaleTestCase
|
||||
|
||||
$this->assertSame($errorMessage, intl_get_error_message());
|
||||
$this->assertSame($errorCode, intl_get_error_code());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code()));
|
||||
$this->assertFalse(intl_is_failure(intl_get_error_code()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure($formatter->getErrorCode()));
|
||||
$this->assertFalse(intl_is_failure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -699,10 +699,10 @@ class StubNumberFormatterTest extends LocaleTestCase
|
||||
|
||||
$this->assertSame($errorMessage, StubIntl::getErrorMessage());
|
||||
$this->assertSame($errorCode, StubIntl::getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertSame($errorCode !== 0, StubIntl::isFailure(StubIntl::getErrorCode()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, StubIntl::isFailure($formatter->getErrorCode()));
|
||||
$this->assertSame($errorCode !== 0, StubIntl::isFailure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -727,10 +727,10 @@ class StubNumberFormatterTest extends LocaleTestCase
|
||||
|
||||
$this->assertSame($errorMessage, intl_get_error_message());
|
||||
$this->assertSame($errorCode, intl_get_error_code());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure(intl_get_error_code()));
|
||||
$this->assertSame($errorCode > 0, intl_is_failure(intl_get_error_code()));
|
||||
$this->assertSame($errorMessage, $formatter->getErrorMessage());
|
||||
$this->assertSame($errorCode, $formatter->getErrorCode());
|
||||
$this->assertSame($errorCode != 0, intl_is_failure($formatter->getErrorCode()));
|
||||
$this->assertSame($errorCode > 0, intl_is_failure($formatter->getErrorCode()));
|
||||
}
|
||||
|
||||
public function parseProvider()
|
||||
|
Reference in New Issue
Block a user