[PhpUnitBridge] Describe weak_vendors properly

This commit is contained in:
Grégoire Paris 2018-07-23 21:45:44 +02:00 committed by Nicolas Grekas
parent c42cc18492
commit 336008c5d3

View File

@ -29,7 +29,7 @@ class DeprecationErrorHandler
* *
* The following reporting modes are supported: * The following reporting modes are supported:
* - use "weak" to hide the deprecation report but keep a global count; * - use "weak" to hide the deprecation report but keep a global count;
* - use "weak_vendors" to act as "weak" but only for vendors; * - use "weak_vendors" to fail only on deprecations triggered in your own code;
* - use "/some-regexp/" to stop the test suite whenever a deprecation * - use "/some-regexp/" to stop the test suite whenever a deprecation
* message matches the given regular expression; * message matches the given regular expression;
* - use a number to define the upper bound of allowed deprecations, * - use a number to define the upper bound of allowed deprecations,
@ -80,7 +80,7 @@ class DeprecationErrorHandler
return true; return true;
} }
foreach ($vendors as $vendor) { foreach ($vendors as $vendor) {
if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, strlen($vendor), 1), '/'.DIRECTORY_SEPARATOR)) { if (0 === strpos($realPath, $vendor) && false !== strpbrk(substr($realPath, strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
return true; return true;
} }
} }
@ -159,7 +159,7 @@ class DeprecationErrorHandler
echo "\n".ucfirst($group).' deprecation triggered by '.$class.'::'.$method.':'; echo "\n".ucfirst($group).' deprecation triggered by '.$class.'::'.$method.':';
echo "\n".$msg; echo "\n".$msg;
echo "\nStack trace:"; echo "\nStack trace:";
echo "\n".str_replace(' '.getcwd().DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString()); echo "\n".str_replace(' '.getcwd().\DIRECTORY_SEPARATOR, ' ', $e->getTraceAsString());
echo "\n"; echo "\n";
exit(1); exit(1);
@ -315,7 +315,7 @@ class DeprecationErrorHandler
return true; return true;
} }
if (DIRECTORY_SEPARATOR === '\\') { if (\DIRECTORY_SEPARATOR === '\\') {
return (function_exists('sapi_windows_vt100_support') return (function_exists('sapi_windows_vt100_support')
&& sapi_windows_vt100_support(STDOUT)) && sapi_windows_vt100_support(STDOUT))
|| false !== getenv('ANSICON') || false !== getenv('ANSICON')