Procházet zdrojové kódy

Merge remote branch 'bschussek/intl-stub' into intl-stub

Eriksen Costa před 14 roky
rodič
revize
157f001253

+ 18 - 0
src/Symfony/Component/Locale/Resources/stubs/Collator.php

@@ -0,0 +1,18 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * Stub implementation for the Collator class of the intl extension
+ *
+ * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
+ * @see Symfony\Component\Collator\Stub\StubCollator
+ */
+class Collator extends \Symfony\Component\Locale\Stub\StubCollator {}

+ 18 - 0
src/Symfony/Component/Locale/Resources/stubs/IntlDateFormatter.php

@@ -0,0 +1,18 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * Stub implementation for the IntlDateFormatter class of the intl extension
+ *
+ * @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
+ * @see Symfony\Component\IntlDateFormatter\Stub\StubIntlDateFormatter
+ */
+class IntlDateFormatter extends \Symfony\Component\Locale\Stub\StubIntlDateFormatter {}

+ 4 - 0
tests/Symfony/Tests/Component/Locale/TestCase.php

@@ -78,6 +78,10 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
             return self::$icuVersion;
         }
 
+        if (!$this->isIntlExtensionLoaded()) {
+            throw new \RuntimeException('The intl extension is not available');
+        }
+
         ob_start();
         phpinfo(INFO_MODULES);
         $output = ob_get_clean();