Browse Source

Merge pull request #4713 from ceeram/3.0-time

Fix tests for 32-bit systems
José Lorenzo Rodríguez 11 years ago
parent
commit
fb96aa7bf4

+ 1 - 3
src/I18n/Formatter/SprintfFormatter.php

@@ -37,11 +37,9 @@ class SprintfFormatter implements FormatterInterface {
  * @return string The formatted message
  */
 	public function format($locale, $message, array $vars) {
-		$isString = is_string($message);
-		if ($isString && isset($vars['_singular'])) {
+		if (is_string($message) && isset($vars['_singular'])) {
 			$message = [$vars['_singular'], $message];
 			unset($vars['_singular']);
-			$isString = false;
 		}
 
 		if (is_string($message)) {

+ 1 - 1
tests/TestCase/Database/TypeTest.php

@@ -206,7 +206,7 @@ class TypeTest extends \Cake\TestSuite\TestCase {
  */
 	public function testBigintegerToPHP() {
 		$this->skipIf(
-			isset($_SERVER['PROCESSOR_ARCHITECTURE']) && $_SERVER['PROCESSOR_ARCHITECTURE'] === 'x86',
+			PHP_INT_SIZE === 4,
 			'This test requires a php version compiled for 64 bits'
 		);
 		$type = Type::build('biginteger');

+ 1 - 0
tests/TestCase/I18n/TimeTest.php

@@ -582,6 +582,7 @@ class TimeTest extends TestCase {
  */
 	public function testToStringInvalidZeros() {
 		$this->skipIf(DS === '\\', 'All zeros are valid on windows.');
+		$this->skipIf(PHP_INT_SIZE === 4, 'IntlDateFormatter throws exceptions on 32-bit systems');
 		$time = new Time('0000-00-00');
 		$this->assertInternalType('string', (string)$time);
 		$this->assertNotEmpty((string)$time);