Browse Source

Merge branch 'master' into 3.next

mark_story 7 years ago
parent
commit
97bfc6e385
2 changed files with 11 additions and 17 deletions
  1. 0 8
      src/I18n/functions.php
  2. 11 9
      tests/phpunit_aliases.php

+ 0 - 8
src/I18n/functions.php

@@ -21,7 +21,6 @@ if (!function_exists('__')) {
      * @param string $singular Text to translate.
      * @param string $singular Text to translate.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null The translated text, or null if invalid.
      * @return string|null The translated text, or null if invalid.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__
      */
      */
     function __($singular, ...$args)
     function __($singular, ...$args)
@@ -48,7 +47,6 @@ if (!function_exists('__n')) {
      * @param int $count Count.
      * @param int $count Count.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null Plural form of translated string, or null if invalid.
      * @return string|null Plural form of translated string, or null if invalid.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__n
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__n
      */
      */
     function __n($singular, $plural, $count, ...$args)
     function __n($singular, $plural, $count, ...$args)
@@ -76,7 +74,6 @@ if (!function_exists('__d')) {
      * @param string $msg String to translate.
      * @param string $msg String to translate.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null Translated string.
      * @return string|null Translated string.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__d
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__d
      */
      */
     function __d($domain, $msg, ...$args)
     function __d($domain, $msg, ...$args)
@@ -105,7 +102,6 @@ if (!function_exists('__dn')) {
      * @param int $count Count.
      * @param int $count Count.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null Plural form of translated string.
      * @return string|null Plural form of translated string.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dn
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dn
      */
      */
     function __dn($domain, $singular, $plural, $count, ...$args)
     function __dn($domain, $singular, $plural, $count, ...$args)
@@ -135,7 +131,6 @@ if (!function_exists('__x')) {
      * @param string $singular Text to translate.
      * @param string $singular Text to translate.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null Translated string.
      * @return string|null Translated string.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__x
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__x
      */
      */
     function __x($context, $singular, ...$args)
     function __x($context, $singular, ...$args)
@@ -165,7 +160,6 @@ if (!function_exists('__xn')) {
      * @param int $count Count.
      * @param int $count Count.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null Plural form of translated string.
      * @return string|null Plural form of translated string.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__xn
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__xn
      */
      */
     function __xn($context, $singular, $plural, $count, ...$args)
     function __xn($context, $singular, $plural, $count, ...$args)
@@ -196,7 +190,6 @@ if (!function_exists('__dx')) {
      * @param string $msg String to translate.
      * @param string $msg String to translate.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null Translated string.
      * @return string|null Translated string.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dx
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dx
      */
      */
     function __dx($domain, $context, $msg, ...$args)
     function __dx($domain, $context, $msg, ...$args)
@@ -230,7 +223,6 @@ if (!function_exists('__dxn')) {
      * @param int $count Count.
      * @param int $count Count.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @param array ...$args Array with arguments or multiple arguments in function.
      * @return string|null Plural form of translated string.
      * @return string|null Plural form of translated string.
-     * @throws \Aura\Intl\Exception
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dxn
      * @link https://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#__dxn
      */
      */
     function __dxn($domain, $context, $singular, $plural, $count, ...$args)
     function __dxn($domain, $context, $singular, $plural, $count, ...$args)

+ 11 - 9
tests/phpunit_aliases.php

@@ -4,13 +4,15 @@ if (class_exists('PHPUnit_Runner_Version')) {
         trigger_error(sprintf('Your PHPUnit Version must be at least 5.7.0 to use CakePHP Testsuite, found %s', \PHPUnit_Runner_Version::id()), E_USER_ERROR);
         trigger_error(sprintf('Your PHPUnit Version must be at least 5.7.0 to use CakePHP Testsuite, found %s', \PHPUnit_Runner_Version::id()), E_USER_ERROR);
     }
     }
 
 
-    class_alias('PHPUnit_Framework_Constraint', 'PHPUnit\Framework\Constraint\Constraint');
-    class_alias('PHPUnit_Framework_Test', 'PHPUnit\Framework\Test');
-    class_alias('PHPUnit_Framework_AssertionFailedError', 'PHPUnit\Framework\AssertionFailedError');
-    class_alias('PHPUnit_Framework_TestSuite', 'PHPUnit\Framework\TestSuite');
-    class_alias('PHPUnit_Framework_TestResult', 'PHPUnit\Framework\TestResult');
-    class_alias('PHPUnit_Framework_Error', 'PHPUnit\Framework\Error\Error');
-    class_alias('PHPUnit_Framework_Error_Deprecated', 'PHPUnit\Framework\Error\Deprecated');
-    class_alias('PHPUnit_Framework_Error_Warning', 'PHPUnit\Framework\Error\Warning');
-    class_alias('PHPUnit_Framework_ExpectationFailedException', 'PHPUnit\Framework\ExpectationFailedException');
+    if (!class_exists('PHPUnit_Framework_Test') && class_exists('PHPUnit_Framework_TestCase')) {
+        class_alias('PHPUnit_Framework_Constraint', 'PHPUnit\Framework\Constraint\Constraint');
+        class_alias('PHPUnit_Framework_Test', 'PHPUnit\Framework\Test');
+        class_alias('PHPUnit_Framework_AssertionFailedError', 'PHPUnit\Framework\AssertionFailedError');
+        class_alias('PHPUnit_Framework_TestSuite', 'PHPUnit\Framework\TestSuite');
+        class_alias('PHPUnit_Framework_TestResult', 'PHPUnit\Framework\TestResult');
+        class_alias('PHPUnit_Framework_Error', 'PHPUnit\Framework\Error\Error');
+        class_alias('PHPUnit_Framework_Error_Deprecated', 'PHPUnit\Framework\Error\Deprecated');
+        class_alias('PHPUnit_Framework_Error_Warning', 'PHPUnit\Framework\Error\Warning');
+        class_alias('PHPUnit_Framework_ExpectationFailedException', 'PHPUnit\Framework\ExpectationFailedException');
+    }
 }
 }