Merge branch '4.3' into 4.4
* 4.3: Fix inconsistent return points. pass translation parameters to the trans filter [Mime] fixed wrong mimetype [ProxyManagerBridge] Polyfill for unmaintained version [HttpClient] Declare `$active` first to prevent weird issue Remove deprecated assertContains [HttpClient] fix tests SCA: dropped unused mocks, duplicate import and a function alias usage Added correct plural for box -> boxes [Config] fix test Fix remaining tests Improve fa (persian) translation
This commit is contained in:
commit
a0c2aa8302
|
@ -139,7 +139,8 @@
|
||||||
"Symfony\\Component\\": "src/Symfony/Component/"
|
"Symfony\\Component\\": "src/Symfony/Component/"
|
||||||
},
|
},
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"src/Symfony/Component/Intl/Resources/stubs"
|
"src/Symfony/Component/Intl/Resources/stubs",
|
||||||
|
"src/Symfony/Bridge/ProxyManager/Legacy/ProxiedMethodReturnExpression.php"
|
||||||
],
|
],
|
||||||
"exclude-from-classmap": [
|
"exclude-from-classmap": [
|
||||||
"**/Tests/"
|
"**/Tests/"
|
||||||
|
|
|
@ -113,5 +113,7 @@ class Logger extends BaseLogger implements DebugLoggerInterface, ResetInterface
|
||||||
return $handler;
|
return $handler;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ class DeprecationTest extends TestCase
|
||||||
public function testItCanBeConvertedToAString()
|
public function testItCanBeConvertedToAString()
|
||||||
{
|
{
|
||||||
$deprecation = new Deprecation('💩', $this->debugBacktrace(), __FILE__);
|
$deprecation = new Deprecation('💩', $this->debugBacktrace(), __FILE__);
|
||||||
$this->assertContains('💩', $deprecation->toString());
|
$this->assertStringContainsString('💩', $deprecation->toString());
|
||||||
$this->assertContains(__FUNCTION__, $deprecation->toString());
|
$this->assertStringContainsString(__FUNCTION__, $deprecation->toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItRulesOutFilesOutsideVendorsAsIndirect()
|
public function testItRulesOutFilesOutsideVendorsAsIndirect()
|
||||||
|
|
|
@ -94,6 +94,10 @@ EOF;
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version_compare(self::getProxyManagerVersion(), '2.5', '<')) {
|
||||||
|
$code = str_replace(' \Closure::bind(function ', ' \Closure::bind(static function ', $code);
|
||||||
|
}
|
||||||
|
|
||||||
return $code;
|
return $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,73 @@
|
||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ProxyManager\Generator\Util;
|
||||||
|
|
||||||
|
use Composer\Autoload\ClassLoader;
|
||||||
|
use ProxyManager\Version;
|
||||||
|
|
||||||
|
if (class_exists(Version::class) && version_compare(\defined(Version::class.'::VERSION') ? Version::VERSION : Version::getVersion(), '2.5', '<')) {
|
||||||
|
/**
|
||||||
|
* Utility class to generate return expressions in method, given a method signature.
|
||||||
|
*
|
||||||
|
* This is required since return expressions may be forbidden by the method signature (void).
|
||||||
|
*
|
||||||
|
* @author Marco Pivetta <ocramius@gmail.com>
|
||||||
|
* @license MIT
|
||||||
|
*
|
||||||
|
* @see https://github.com/Ocramius/ProxyManager
|
||||||
|
*/
|
||||||
|
final class ProxiedMethodReturnExpression
|
||||||
|
{
|
||||||
|
public static function generate(string $returnedValueExpression, ?\ReflectionMethod $originalMethod): string
|
||||||
|
{
|
||||||
|
$originalReturnType = null === $originalMethod ? null : $originalMethod->getReturnType();
|
||||||
|
|
||||||
|
$originalReturnTypeName = null === $originalReturnType ? null : $originalReturnType->getName();
|
||||||
|
|
||||||
|
if ('void' === $originalReturnTypeName) {
|
||||||
|
return $returnedValueExpression.";\nreturn;";
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'return '.$returnedValueExpression.';';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Fallback to the original class by unregistering this file from composer class loader
|
||||||
|
$getComposerClassLoader = static function ($functionLoader) use (&$getComposerClassLoader) {
|
||||||
|
if (\is_array($functionLoader)) {
|
||||||
|
$functionLoader = $functionLoader[0];
|
||||||
|
}
|
||||||
|
if (!\is_object($functionLoader)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($functionLoader instanceof ClassLoader) {
|
||||||
|
return $functionLoader;
|
||||||
|
}
|
||||||
|
if ($functionLoader instanceof \Symfony\Component\Debug\DebugClassLoader) {
|
||||||
|
return $getComposerClassLoader($functionLoader->getClassLoader());
|
||||||
|
}
|
||||||
|
if ($functionLoader instanceof \Symfony\Component\ErrorHandler\DebugClassLoader) {
|
||||||
|
return $getComposerClassLoader($functionLoader->getClassLoader());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$classLoader = null;
|
||||||
|
$functions = spl_autoload_functions();
|
||||||
|
while (null === $classLoader && $functions) {
|
||||||
|
$classLoader = $getComposerClassLoader(array_shift($functions));
|
||||||
|
}
|
||||||
|
$getComposerClassLoader = null;
|
||||||
|
|
||||||
|
if (null !== $classLoader) {
|
||||||
|
$classLoader->addClassMap([ProxiedMethodReturnExpression::class => null]);
|
||||||
|
$classLoader->loadClass(ProxiedMethodReturnExpression::class);
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,6 +12,7 @@
|
||||||
namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper;
|
namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper;
|
||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
use ProxyManager\Version;
|
||||||
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
|
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
|
||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;
|
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;
|
||||||
|
@ -59,6 +60,20 @@ class ProxyDumperTest extends TestCase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testStaticBinding()
|
||||||
|
{
|
||||||
|
if (!class_exists(Version::class) || version_compare(\defined(Version::class.'::VERSION') ? Version::VERSION : Version::getVersion(), '2.1', '<')) {
|
||||||
|
$this->markTestSkipped('ProxyManager prior to version 2.1 does not support static binding');
|
||||||
|
}
|
||||||
|
|
||||||
|
$definition = new Definition(__CLASS__);
|
||||||
|
$definition->setLazy(true);
|
||||||
|
|
||||||
|
$code = $this->dumper->getProxyCode($definition);
|
||||||
|
|
||||||
|
$this->assertStringContainsString('\Closure::bind(static function (\PHPUnit\Framework\TestCase $instance) {', $code);
|
||||||
|
}
|
||||||
|
|
||||||
public function testDeterministicProxyCode()
|
public function testDeterministicProxyCode()
|
||||||
{
|
{
|
||||||
$definition = new Definition(__CLASS__);
|
$definition = new Definition(__CLASS__);
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Symfony\\Bridge\\ProxyManager\\": "" },
|
"psr-4": { "Symfony\\Bridge\\ProxyManager\\": "" },
|
||||||
|
"classmap": [ "Legacy/ProxiedMethodReturnExpression.php" ],
|
||||||
"exclude-from-classmap": [
|
"exclude-from-classmap": [
|
||||||
"/Tests/"
|
"/Tests/"
|
||||||
]
|
]
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
|
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
|
||||||
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
|
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain)) -}}
|
||||||
</label>
|
</label>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endblock checkbox_radio_label %}
|
{%- endblock checkbox_radio_label %}
|
||||||
|
|
|
@ -266,7 +266,7 @@
|
||||||
|
|
||||||
{{ widget|raw }}
|
{{ widget|raw }}
|
||||||
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
|
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
|
||||||
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
|
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain)) -}}
|
||||||
{{- form_errors(form) -}}
|
{{- form_errors(form) -}}
|
||||||
</label>
|
</label>
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
|
@ -266,7 +266,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
|
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
|
||||||
{{ widget|raw }}
|
{{ widget|raw }}
|
||||||
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
|
{{ translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain) }}
|
||||||
</label>
|
</label>
|
||||||
{%- endblock checkbox_radio_label %}
|
{%- endblock checkbox_radio_label %}
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ class Configuration implements ConfigurationInterface
|
||||||
->canBeEnabled()
|
->canBeEnabled()
|
||||||
->beforeNormalization()
|
->beforeNormalization()
|
||||||
->always(function ($v) {
|
->always(function ($v) {
|
||||||
if (true === $v['enabled']) {
|
if (\is_array($v) && true === $v['enabled']) {
|
||||||
$workflows = $v;
|
$workflows = $v;
|
||||||
unset($workflows['enabled']);
|
unset($workflows['enabled']);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ class CachePoolDeleteCommandTest extends TestCase
|
||||||
$tester = $this->getCommandTester($this->getKernel());
|
$tester = $this->getCommandTester($this->getKernel());
|
||||||
$tester->execute(['pool' => 'foo', 'key' => 'bar']);
|
$tester->execute(['pool' => 'foo', 'key' => 'bar']);
|
||||||
|
|
||||||
$this->assertContains('[OK] Cache item "bar" was successfully deleted.', $tester->getDisplay());
|
$this->assertStringContainsString('[OK] Cache item "bar" was successfully deleted.', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCommandWithInValidKey()
|
public function testCommandWithInValidKey()
|
||||||
|
@ -62,7 +62,7 @@ class CachePoolDeleteCommandTest extends TestCase
|
||||||
$tester = $this->getCommandTester($this->getKernel());
|
$tester = $this->getCommandTester($this->getKernel());
|
||||||
$tester->execute(['pool' => 'foo', 'key' => 'bar']);
|
$tester->execute(['pool' => 'foo', 'key' => 'bar']);
|
||||||
|
|
||||||
$this->assertContains('[NOTE] Cache item "bar" does not exist in cache pool "foo".', $tester->getDisplay());
|
$this->assertStringContainsString('[NOTE] Cache item "bar" does not exist in cache pool "foo".', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testCommandDeleteFailed()
|
public function testCommandDeleteFailed()
|
||||||
|
|
|
@ -69,7 +69,7 @@ EOF;
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
||||||
$this->assertContains('[OK] All 0 XLIFF files contain valid syntax', trim($tester->getDisplay()));
|
$this->assertStringContainsString('[OK] All 0 XLIFF files contain valid syntax', trim($tester->getDisplay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -226,7 +226,7 @@ class ApplicationTest extends TestCase
|
||||||
$this->assertSame(0, $tester->getStatusCode());
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
$display = explode('Lists commands', $tester->getDisplay());
|
$display = explode('Lists commands', $tester->getDisplay());
|
||||||
|
|
||||||
$this->assertContains(trim('[WARNING] Some commands could not be registered:'), trim($display[1]));
|
$this->assertStringContainsString(trim('[WARNING] Some commands could not be registered:'), trim($display[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSuggestingPackagesWithExactMatch()
|
public function testSuggestingPackagesWithExactMatch()
|
||||||
|
|
|
@ -31,8 +31,8 @@ class CachePoolListCommandTest extends AbstractWebTestCase
|
||||||
$tester->execute([]);
|
$tester->execute([]);
|
||||||
|
|
||||||
$this->assertSame(0, $tester->getStatusCode(), 'cache:pool:list exits with 0 in case of success');
|
$this->assertSame(0, $tester->getStatusCode(), 'cache:pool:list exits with 0 in case of success');
|
||||||
$this->assertContains('cache.app', $tester->getDisplay());
|
$this->assertStringContainsString('cache.app', $tester->getDisplay());
|
||||||
$this->assertContains('cache.system', $tester->getDisplay());
|
$this->assertStringContainsString('cache.system', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testEmptyList()
|
public function testEmptyList()
|
||||||
|
|
|
@ -71,7 +71,7 @@ class ConfigDebugCommandTest extends AbstractWebTestCase
|
||||||
$tester = $this->createCommandTester();
|
$tester = $this->createCommandTester();
|
||||||
$tester->execute(['name' => 'FrameworkBundle']);
|
$tester->execute(['name' => 'FrameworkBundle']);
|
||||||
|
|
||||||
$this->assertContains("cookie_httponly: '%env(bool:COOKIE_HTTPONLY)%'", $tester->getDisplay());
|
$this->assertStringContainsString("cookie_httponly: '%env(bool:COOKIE_HTTPONLY)%'", $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -57,15 +57,15 @@ class ContainerDebugCommandTest extends AbstractWebTestCase
|
||||||
|
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
$tester->run(['command' => 'debug:container', '--show-hidden' => true]);
|
$tester->run(['command' => 'debug:container', '--show-hidden' => true]);
|
||||||
$this->assertNotContains('public', $tester->getDisplay());
|
$this->assertStringNotContainsString('public', $tester->getDisplay());
|
||||||
$this->assertNotContains('private_alias', $tester->getDisplay());
|
$this->assertStringNotContainsString('private_alias', $tester->getDisplay());
|
||||||
|
|
||||||
$tester->run(['command' => 'debug:container']);
|
$tester->run(['command' => 'debug:container']);
|
||||||
$this->assertContains('public', $tester->getDisplay());
|
$this->assertStringContainsString('public', $tester->getDisplay());
|
||||||
$this->assertContains('private_alias', $tester->getDisplay());
|
$this->assertStringContainsString('private_alias', $tester->getDisplay());
|
||||||
|
|
||||||
$tester->run(['command' => 'debug:container', 'name' => 'private_alias']);
|
$tester->run(['command' => 'debug:container', 'name' => 'private_alias']);
|
||||||
$this->assertContains('The "private_alias" service or alias has been removed', $tester->getDisplay());
|
$this->assertStringContainsString('The "private_alias" service or alias has been removed', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,7 +133,7 @@ TXT
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
$tester->run(['command' => 'debug:container', '--env-var' => 'js'], ['decorated' => false]);
|
$tester->run(['command' => 'debug:container', '--env-var' => 'js'], ['decorated' => false]);
|
||||||
|
|
||||||
$this->assertContains(file_get_contents(__DIR__.'/Fixtures/describe_env_vars.txt'), $tester->getDisplay(true));
|
$this->assertStringContainsString(file_get_contents(__DIR__.'/Fixtures/describe_env_vars.txt'), $tester->getDisplay(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideIgnoreBackslashWhenFindingService()
|
public function provideIgnoreBackslashWhenFindingService()
|
||||||
|
|
|
@ -56,7 +56,7 @@ class DebugAutowiringCommandTest extends AbstractWebTestCase
|
||||||
|
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
$tester->run(['command' => 'debug:autowiring', 'search' => 'HttpKernelHttpKernelInterface']);
|
$tester->run(['command' => 'debug:autowiring', 'search' => 'HttpKernelHttpKernelInterface']);
|
||||||
$this->assertContains('Symfony\Component\HttpKernel\HttpKernelInterface', $tester->getDisplay());
|
$this->assertStringContainsString('Symfony\Component\HttpKernel\HttpKernelInterface', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchNoResults()
|
public function testSearchNoResults()
|
||||||
|
@ -83,7 +83,7 @@ class DebugAutowiringCommandTest extends AbstractWebTestCase
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
$tester->run(['command' => 'debug:autowiring', 'search' => 'redirect']);
|
$tester->run(['command' => 'debug:autowiring', 'search' => 'redirect']);
|
||||||
|
|
||||||
$this->assertContains(' more concrete service would be displayed when adding the "--all" option.', $tester->getDisplay());
|
$this->assertStringContainsString(' more concrete service would be displayed when adding the "--all" option.', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchNotAliasedServiceWithAll()
|
public function testSearchNotAliasedServiceWithAll()
|
||||||
|
@ -95,6 +95,6 @@ class DebugAutowiringCommandTest extends AbstractWebTestCase
|
||||||
|
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
$tester->run(['command' => 'debug:autowiring', 'search' => 'redirect', '--all' => true]);
|
$tester->run(['command' => 'debug:autowiring', 'search' => 'redirect', '--all' => true]);
|
||||||
$this->assertContains('Pro-tip: use interfaces in your type-hints instead of classes to benefit from the dependency inversion principle.', $tester->getDisplay());
|
$this->assertStringContainsString('Pro-tip: use interfaces in your type-hints instead of classes to benefit from the dependency inversion principle.', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ class RouterDebugCommandTest extends AbstractWebTestCase
|
||||||
$display = $tester->getDisplay();
|
$display = $tester->getDisplay();
|
||||||
|
|
||||||
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
||||||
$this->assertContains('routerdebug_test', $display);
|
$this->assertStringContainsString('routerdebug_test', $display);
|
||||||
$this->assertContains('/test', $display);
|
$this->assertStringContainsString('/test', $display);
|
||||||
$this->assertContains('/session', $display);
|
$this->assertStringContainsString('/session', $display);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDumpOneRoute()
|
public function testDumpOneRoute()
|
||||||
|
@ -45,8 +45,8 @@ class RouterDebugCommandTest extends AbstractWebTestCase
|
||||||
$ret = $tester->execute(['name' => 'routerdebug_session_welcome']);
|
$ret = $tester->execute(['name' => 'routerdebug_session_welcome']);
|
||||||
|
|
||||||
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
||||||
$this->assertContains('routerdebug_session_welcome', $tester->getDisplay());
|
$this->assertStringContainsString('routerdebug_session_welcome', $tester->getDisplay());
|
||||||
$this->assertContains('/session', $tester->getDisplay());
|
$this->assertStringContainsString('/session', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchMultipleRoutes()
|
public function testSearchMultipleRoutes()
|
||||||
|
@ -56,9 +56,9 @@ class RouterDebugCommandTest extends AbstractWebTestCase
|
||||||
$ret = $tester->execute(['name' => 'routerdebug'], ['interactive' => true]);
|
$ret = $tester->execute(['name' => 'routerdebug'], ['interactive' => true]);
|
||||||
|
|
||||||
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
||||||
$this->assertContains('Select one of the matching routes:', $tester->getDisplay());
|
$this->assertStringContainsString('Select one of the matching routes:', $tester->getDisplay());
|
||||||
$this->assertContains('routerdebug_test', $tester->getDisplay());
|
$this->assertStringContainsString('routerdebug_test', $tester->getDisplay());
|
||||||
$this->assertContains('/test', $tester->getDisplay());
|
$this->assertStringContainsString('/test', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testSearchWithThrow()
|
public function testSearchWithThrow()
|
||||||
|
|
|
@ -33,13 +33,13 @@ class TranslationDebugCommandTest extends AbstractWebTestCase
|
||||||
$ret = $tester->execute(['locale' => 'en']);
|
$ret = $tester->execute(['locale' => 'en']);
|
||||||
|
|
||||||
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
$this->assertSame(0, $ret, 'Returns 0 in case of success');
|
||||||
$this->assertContains('missing messages hello_from_construct_arg_service', $tester->getDisplay());
|
$this->assertStringContainsString('missing messages hello_from_construct_arg_service', $tester->getDisplay());
|
||||||
$this->assertContains('missing messages hello_from_subscriber_service', $tester->getDisplay());
|
$this->assertStringContainsString('missing messages hello_from_subscriber_service', $tester->getDisplay());
|
||||||
$this->assertContains('missing messages hello_from_property_service', $tester->getDisplay());
|
$this->assertStringContainsString('missing messages hello_from_property_service', $tester->getDisplay());
|
||||||
$this->assertContains('missing messages hello_from_method_calls_service', $tester->getDisplay());
|
$this->assertStringContainsString('missing messages hello_from_method_calls_service', $tester->getDisplay());
|
||||||
$this->assertContains('missing messages hello_from_controller', $tester->getDisplay());
|
$this->assertStringContainsString('missing messages hello_from_controller', $tester->getDisplay());
|
||||||
$this->assertContains('unused validators This value should be blank.', $tester->getDisplay());
|
$this->assertStringContainsString('unused validators This value should be blank.', $tester->getDisplay());
|
||||||
$this->assertContains('unused security Invalid CSRF token.', $tester->getDisplay());
|
$this->assertStringContainsString('unused security Invalid CSRF token.', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createCommandTester(): CommandTester
|
private function createCommandTester(): CommandTester
|
||||||
|
|
|
@ -54,14 +54,14 @@ class FirewallMap implements FirewallMapInterface
|
||||||
$context = $this->getFirewallContext($request);
|
$context = $this->getFirewallContext($request);
|
||||||
|
|
||||||
if (null === $context) {
|
if (null === $context) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $context->getConfig();
|
return $context->getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return FirewallContext
|
* @return FirewallContext|null
|
||||||
*/
|
*/
|
||||||
private function getFirewallContext(Request $request)
|
private function getFirewallContext(Request $request)
|
||||||
{
|
{
|
||||||
|
@ -83,5 +83,7 @@ class FirewallMap implements FirewallMapInterface
|
||||||
return $this->container->get($contextId);
|
return $this->container->get($contextId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ class UserPasswordEncoderCommandTest extends AbstractWebTestCase
|
||||||
], ['interactive' => false]);
|
], ['interactive' => false]);
|
||||||
|
|
||||||
$output = $this->passwordEncoderCommandTester->getDisplay();
|
$output = $this->passwordEncoderCommandTester->getDisplay();
|
||||||
$this->assertContains('Password encoding succeeded', $output);
|
$this->assertStringContainsString('Password encoding succeeded', $output);
|
||||||
|
|
||||||
$encoder = new NativePasswordEncoder();
|
$encoder = new NativePasswordEncoder();
|
||||||
preg_match('# Encoded password\s{1,}([\w+\/$.,=]+={0,2})\s+#', $output, $matches);
|
preg_match('# Encoded password\s{1,}([\w+\/$.,=]+={0,2})\s+#', $output, $matches);
|
||||||
|
@ -130,7 +130,7 @@ class UserPasswordEncoderCommandTest extends AbstractWebTestCase
|
||||||
], ['interactive' => false]);
|
], ['interactive' => false]);
|
||||||
|
|
||||||
$output = $this->passwordEncoderCommandTester->getDisplay();
|
$output = $this->passwordEncoderCommandTester->getDisplay();
|
||||||
$this->assertContains('Password encoding succeeded', $output);
|
$this->assertStringContainsString('Password encoding succeeded', $output);
|
||||||
|
|
||||||
preg_match('# Encoded password\s+(\$?\$[\w,=\$+\/]+={0,2})\s+#', $output, $matches);
|
preg_match('# Encoded password\s+(\$?\$[\w,=\$+\/]+={0,2})\s+#', $output, $matches);
|
||||||
$hash = $matches[1];
|
$hash = $matches[1];
|
||||||
|
|
|
@ -159,9 +159,9 @@ class HttpBrowserTest extends AbstractBrowserTest
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
->method('request')
|
->method('request')
|
||||||
->with('POST', 'http://example.com/', $this->callback(function ($options) {
|
->with('POST', 'http://example.com/', $this->callback(function ($options) {
|
||||||
$this->assertContains('Content-Type: multipart/form-data', implode('', $options['headers']));
|
$this->assertStringContainsString('Content-Type: multipart/form-data', implode('', $options['headers']));
|
||||||
$this->assertInstanceOf('\Generator', $options['body']);
|
$this->assertInstanceOf('\Generator', $options['body']);
|
||||||
$this->assertContains('my_file', implode('', iterator_to_array($options['body'])));
|
$this->assertStringContainsString('my_file', implode('', iterator_to_array($options['body'])));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -14,7 +14,6 @@ namespace Symfony\Component\Config\Tests\Definition\Builder;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Symfony\Component\Config\Definition\Builder\FloatNodeDefinition;
|
use Symfony\Component\Config\Definition\Builder\FloatNodeDefinition;
|
||||||
use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition;
|
use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition;
|
||||||
use Symfony\Component\Config\Definition\Builder\IntegerNodeDefinition as NumericNodeDefinition;
|
|
||||||
|
|
||||||
class NumericNodeDefinitionTest extends TestCase
|
class NumericNodeDefinitionTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@ -22,7 +21,7 @@ class NumericNodeDefinitionTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessage('You cannot define a min(4) as you already have a max(3)');
|
$this->expectExceptionMessage('You cannot define a min(4) as you already have a max(3)');
|
||||||
$def = new NumericNodeDefinition('foo');
|
$def = new IntegerNodeDefinition('foo');
|
||||||
$def->max(3)->min(4);
|
$def->max(3)->min(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +29,7 @@ class NumericNodeDefinitionTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->expectException('InvalidArgumentException');
|
$this->expectException('InvalidArgumentException');
|
||||||
$this->expectExceptionMessage('You cannot define a max(2) as you already have a min(3)');
|
$this->expectExceptionMessage('You cannot define a max(2) as you already have a min(3)');
|
||||||
$node = new NumericNodeDefinition('foo');
|
$node = new IntegerNodeDefinition('foo');
|
||||||
$node->min(3)->max(2);
|
$node->min(3)->max(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +83,7 @@ class NumericNodeDefinitionTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidDefinitionException');
|
$this->expectException('Symfony\Component\Config\Definition\Exception\InvalidDefinitionException');
|
||||||
$this->expectExceptionMessage('->cannotBeEmpty() is not applicable to NumericNodeDefinition.');
|
$this->expectExceptionMessage('->cannotBeEmpty() is not applicable to NumericNodeDefinition.');
|
||||||
$def = new NumericNodeDefinition('foo');
|
$def = new IntegerNodeDefinition('foo');
|
||||||
$def->cannotBeEmpty();
|
$def->cannotBeEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,7 @@ class XmlUtils
|
||||||
return true;
|
return true;
|
||||||
case 'false' === $lowercaseValue:
|
case 'false' === $lowercaseValue:
|
||||||
return false;
|
return false;
|
||||||
case isset($value[1]) && '0b' == $value[0].$value[1]:
|
case isset($value[1]) && '0b' == $value[0].$value[1] && preg_match('/^0b[01]*$/', $value):
|
||||||
return bindec($value);
|
return bindec($value);
|
||||||
case is_numeric($value):
|
case is_numeric($value):
|
||||||
return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
|
return '0x' === $value[0].$value[1] ? hexdec($value) : (float) $value;
|
||||||
|
|
|
@ -87,26 +87,14 @@ class Terminal
|
||||||
*/
|
*/
|
||||||
private static function getConsoleMode()
|
private static function getConsoleMode()
|
||||||
{
|
{
|
||||||
if (!\function_exists('proc_open')) {
|
$info = self::readFromProcess('mode CON');
|
||||||
return;
|
|
||||||
|
if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$descriptorspec = [
|
|
||||||
1 => ['pipe', 'w'],
|
|
||||||
2 => ['pipe', 'w'],
|
|
||||||
];
|
|
||||||
$process = proc_open('mode CON', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
|
|
||||||
if (\is_resource($process)) {
|
|
||||||
$info = stream_get_contents($pipes[1]);
|
|
||||||
fclose($pipes[1]);
|
|
||||||
fclose($pipes[2]);
|
|
||||||
proc_close($process);
|
|
||||||
|
|
||||||
if (preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) {
|
|
||||||
return [(int) $matches[2], (int) $matches[1]];
|
return [(int) $matches[2], (int) $matches[1]];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs and parses stty -a if it's available, suppressing any error output.
|
* Runs and parses stty -a if it's available, suppressing any error output.
|
||||||
|
@ -114,9 +102,19 @@ class Terminal
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
private static function getSttyColumns()
|
private static function getSttyColumns()
|
||||||
|
{
|
||||||
|
return self::readFromProcess('stty -a | grep columns');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $command
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
private static function readFromProcess($command)
|
||||||
{
|
{
|
||||||
if (!\function_exists('proc_open')) {
|
if (!\function_exists('proc_open')) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$descriptorspec = [
|
$descriptorspec = [
|
||||||
|
@ -124,8 +122,11 @@ class Terminal
|
||||||
2 => ['pipe', 'w'],
|
2 => ['pipe', 'w'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$process = proc_open('stty -a | grep columns', $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
|
$process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
|
||||||
if (\is_resource($process)) {
|
if (!\is_resource($process)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$info = stream_get_contents($pipes[1]);
|
$info = stream_get_contents($pipes[1]);
|
||||||
fclose($pipes[1]);
|
fclose($pipes[1]);
|
||||||
fclose($pipes[2]);
|
fclose($pipes[2]);
|
||||||
|
@ -133,5 +134,4 @@ class Terminal
|
||||||
|
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -506,9 +506,9 @@ class ApplicationTest extends TestCase
|
||||||
$tester->setInputs(['y']);
|
$tester->setInputs(['y']);
|
||||||
$tester->run(['command' => 'foos'], ['decorated' => false]);
|
$tester->run(['command' => 'foos'], ['decorated' => false]);
|
||||||
$display = trim($tester->getDisplay(true));
|
$display = trim($tester->getDisplay(true));
|
||||||
$this->assertContains('Command "foos" is not defined', $display);
|
$this->assertStringContainsString('Command "foos" is not defined', $display);
|
||||||
$this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display);
|
$this->assertStringContainsString('Do you want to run "foo" instead? (yes/no) [no]:', $display);
|
||||||
$this->assertContains('called', $display);
|
$this->assertStringContainsString('called', $display);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDontRunAlternativeCommandName()
|
public function testDontRunAlternativeCommandName()
|
||||||
|
@ -521,8 +521,8 @@ class ApplicationTest extends TestCase
|
||||||
$exitCode = $tester->run(['command' => 'foos'], ['decorated' => false]);
|
$exitCode = $tester->run(['command' => 'foos'], ['decorated' => false]);
|
||||||
$this->assertSame(1, $exitCode);
|
$this->assertSame(1, $exitCode);
|
||||||
$display = trim($tester->getDisplay(true));
|
$display = trim($tester->getDisplay(true));
|
||||||
$this->assertContains('Command "foos" is not defined', $display);
|
$this->assertStringContainsString('Command "foos" is not defined', $display);
|
||||||
$this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display);
|
$this->assertStringContainsString('Do you want to run "foo" instead? (yes/no) [no]:', $display);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provideInvalidCommandNamesSingle()
|
public function provideInvalidCommandNamesSingle()
|
||||||
|
@ -854,7 +854,7 @@ class ApplicationTest extends TestCase
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
|
|
||||||
$tester->run(['command' => 'foo'], ['decorated' => false]);
|
$tester->run(['command' => 'foo'], ['decorated' => false]);
|
||||||
$this->assertContains('[InvalidArgumentException@anonymous]', $tester->getDisplay(true));
|
$this->assertStringContainsString('[InvalidArgumentException@anonymous]', $tester->getDisplay(true));
|
||||||
|
|
||||||
$application = new Application();
|
$application = new Application();
|
||||||
$application->setAutoExit(false);
|
$application->setAutoExit(false);
|
||||||
|
@ -865,7 +865,7 @@ class ApplicationTest extends TestCase
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
|
|
||||||
$tester->run(['command' => 'foo'], ['decorated' => false]);
|
$tester->run(['command' => 'foo'], ['decorated' => false]);
|
||||||
$this->assertContains('Dummy type "@anonymous" is invalid.', $tester->getDisplay(true));
|
$this->assertStringContainsString('Dummy type "@anonymous" is invalid.', $tester->getDisplay(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRenderExceptionStackTraceContainsRootException()
|
public function testRenderExceptionStackTraceContainsRootException()
|
||||||
|
@ -879,7 +879,7 @@ class ApplicationTest extends TestCase
|
||||||
$tester = new ApplicationTester($application);
|
$tester = new ApplicationTester($application);
|
||||||
|
|
||||||
$tester->run(['command' => 'foo'], ['decorated' => false]);
|
$tester->run(['command' => 'foo'], ['decorated' => false]);
|
||||||
$this->assertContains('[InvalidArgumentException@anonymous]', $tester->getDisplay(true));
|
$this->assertStringContainsString('[InvalidArgumentException@anonymous]', $tester->getDisplay(true));
|
||||||
|
|
||||||
$application = new Application();
|
$application = new Application();
|
||||||
$application->setAutoExit(false);
|
$application->setAutoExit(false);
|
||||||
|
|
|
@ -463,7 +463,7 @@ class ErrorHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($throw) {
|
if ($throw) {
|
||||||
if (E_USER_ERROR & $type) {
|
if (\PHP_VERSION_ID < 70400 && E_USER_ERROR & $type) {
|
||||||
for ($i = 1; isset($backtrace[$i]); ++$i) {
|
for ($i = 1; isset($backtrace[$i]); ++$i) {
|
||||||
if (isset($backtrace[$i]['function'], $backtrace[$i]['type'], $backtrace[$i - 1]['function'])
|
if (isset($backtrace[$i]['function'], $backtrace[$i]['type'], $backtrace[$i - 1]['function'])
|
||||||
&& '__toString' === $backtrace[$i]['function']
|
&& '__toString' === $backtrace[$i]['function']
|
||||||
|
|
|
@ -285,6 +285,10 @@ class ErrorHandlerTest extends TestCase
|
||||||
|
|
||||||
public function testHandleUserError()
|
public function testHandleUserError()
|
||||||
{
|
{
|
||||||
|
if (\PHP_VERSION_ID >= 70400) {
|
||||||
|
$this->markTestSkipped('PHP 7.4 allows __toString to throw exceptions');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$handler = ErrorHandler::register();
|
$handler = ErrorHandler::register();
|
||||||
$handler->throwAt(0, true);
|
$handler->throwAt(0, true);
|
||||||
|
|
|
@ -64,7 +64,7 @@ content="0;url=data:text/html;base64,PHNjcmlwdD5hbGVydCgndGVzdDMnKTwvc2NyaXB0Pg"
|
||||||
$handler->sendPhpResponse(new \RuntimeException($htmlWithXss));
|
$handler->sendPhpResponse(new \RuntimeException($htmlWithXss));
|
||||||
$response = ob_get_clean();
|
$response = ob_get_clean();
|
||||||
|
|
||||||
$this->assertContains(sprintf('<h1 class="break-long-words exception-message">%s</h1>', htmlspecialchars($htmlWithXss, ENT_COMPAT | ENT_SUBSTITUTE, 'UTF-8')), $response);
|
$this->assertStringContainsString(sprintf('<h1 class="break-long-words exception-message">%s</h1>', htmlspecialchars($htmlWithXss, ENT_COMPAT | ENT_SUBSTITUTE, 'UTF-8')), $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testStatusCode()
|
public function testStatusCode()
|
||||||
|
|
|
@ -309,6 +309,8 @@ class AutowirePass extends AbstractRecursivePass
|
||||||
if ($this->container->has($type) && !$this->container->findDefinition($type)->isAbstract()) {
|
if ($this->container->has($type) && !$this->container->findDefinition($type)->isAbstract()) {
|
||||||
return new TypedReference($type, $type, $reference->getInvalidBehavior());
|
return new TypedReference($type, $type, $reference->getInvalidBehavior());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -441,7 +443,7 @@ class AutowirePass extends AbstractRecursivePass
|
||||||
} elseif (isset($this->types[$type])) {
|
} elseif (isset($this->types[$type])) {
|
||||||
$message = sprintf('the existing "%s" service', $this->types[$type]);
|
$message = sprintf('the existing "%s" service', $this->types[$type]);
|
||||||
} else {
|
} else {
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return sprintf(' You should maybe alias this %s to %s.', class_exists($type, false) ? 'class' : 'interface', $message);
|
return sprintf(' You should maybe alias this %s to %s.', class_exists($type, false) ? 'class' : 'interface', $message);
|
||||||
|
@ -469,5 +471,7 @@ class AutowirePass extends AbstractRecursivePass
|
||||||
if ($aliases) {
|
if ($aliases) {
|
||||||
return sprintf('Try changing the type-hint to "%s" instead.', $aliases[0]);
|
return sprintf('Try changing the type-hint to "%s" instead.', $aliases[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@ class XmlFileLoader extends FileLoader
|
||||||
$alias->setDeprecated(true, $deprecated[0]->nodeValue ?: null);
|
$alias->setDeprecated(true, $deprecated[0]->nodeValue ?: null);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isLoadingInstanceof) {
|
if ($this->isLoadingInstanceof) {
|
||||||
|
|
|
@ -31,6 +31,6 @@ class CustomExpressionLanguageFunctionTest extends TestCase
|
||||||
$dump = new PhpDumper($container);
|
$dump = new PhpDumper($container);
|
||||||
$dumped = $dump->dump();
|
$dumped = $dump->dump();
|
||||||
|
|
||||||
$this->assertContains('strtolower("foobar")', $dumped);
|
$this->assertStringContainsString('strtolower("foobar")', $dumped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ class FormFieldRegistry
|
||||||
$target = &$this->fields;
|
$target = &$this->fields;
|
||||||
while (\count($segments) > 1) {
|
while (\count($segments) > 1) {
|
||||||
$path = array_shift($segments);
|
$path = array_shift($segments);
|
||||||
if (!\array_key_exists($path, $target)) {
|
if (!\is_array($target) || !\array_key_exists($path, $target)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$target = &$target[$path];
|
$target = &$target[$path];
|
||||||
|
@ -80,7 +80,7 @@ class FormFieldRegistry
|
||||||
$target = &$this->fields;
|
$target = &$this->fields;
|
||||||
while ($segments) {
|
while ($segments) {
|
||||||
$path = array_shift($segments);
|
$path = array_shift($segments);
|
||||||
if (!\array_key_exists($path, $target)) {
|
if (!\is_array($target) || !\array_key_exists($path, $target)) {
|
||||||
throw new \InvalidArgumentException(sprintf('Unreachable field "%s"', $path));
|
throw new \InvalidArgumentException(sprintf('Unreachable field "%s"', $path));
|
||||||
}
|
}
|
||||||
$target = &$target[$path];
|
$target = &$target[$path];
|
||||||
|
|
|
@ -33,11 +33,7 @@ class SortableIteratorTest extends RealIteratorTestCase
|
||||||
if (!\is_callable($mode)) {
|
if (!\is_callable($mode)) {
|
||||||
switch ($mode) {
|
switch ($mode) {
|
||||||
case SortableIterator::SORT_BY_ACCESSED_TIME:
|
case SortableIterator::SORT_BY_ACCESSED_TIME:
|
||||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
|
||||||
touch(self::toAbsolute('.git'));
|
touch(self::toAbsolute('.git'));
|
||||||
} else {
|
|
||||||
file_get_contents(self::toAbsolute('.git'));
|
|
||||||
}
|
|
||||||
sleep(1);
|
sleep(1);
|
||||||
file_get_contents(self::toAbsolute('.bar'));
|
file_get_contents(self::toAbsolute('.bar'));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -73,7 +73,7 @@ TXT
|
||||||
$tester->execute(['class' => 'DateTime'], ['decorated' => false, 'interactive' => false]);
|
$tester->execute(['class' => 'DateTime'], ['decorated' => false, 'interactive' => false]);
|
||||||
|
|
||||||
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
||||||
$this->assertContains('Symfony\Component\Form\Extension\Core\Type\DateTimeType (Block prefix: "datetime")', $tester->getDisplay());
|
$this->assertStringContainsString('Symfony\Component\Form\Extension\Core\Type\DateTimeType (Block prefix: "datetime")', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDebugFormTypeOption()
|
public function testDebugFormTypeOption()
|
||||||
|
|
|
@ -507,6 +507,7 @@ class DateTypeTest extends BaseTypeTest
|
||||||
|
|
||||||
public function testMonthsOption()
|
public function testMonthsOption()
|
||||||
{
|
{
|
||||||
|
\Locale::setDefault('en');
|
||||||
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
$form = $this->factory->create(static::TESTED_TYPE, null, [
|
||||||
'months' => [6, 7],
|
'months' => [6, 7],
|
||||||
'format' => \IntlDateFormatter::SHORT,
|
'format' => \IntlDateFormatter::SHORT,
|
||||||
|
@ -515,8 +516,8 @@ class DateTypeTest extends BaseTypeTest
|
||||||
$view = $form->createView();
|
$view = $form->createView();
|
||||||
|
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
new ChoiceView(6, '6', '06'),
|
new ChoiceView(6, '6', '6'),
|
||||||
new ChoiceView(7, '7', '07'),
|
new ChoiceView(7, '7', '7'),
|
||||||
], $view['month']->vars['choices']);
|
], $view['month']->vars['choices']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,14 +581,15 @@ class DateTypeTest extends BaseTypeTest
|
||||||
|
|
||||||
public function testIsDayWithinRangeReturnsTrueIfWithin()
|
public function testIsDayWithinRangeReturnsTrueIfWithin()
|
||||||
{
|
{
|
||||||
|
\Locale::setDefault('en');
|
||||||
$view = $this->factory->create(static::TESTED_TYPE, null, [
|
$view = $this->factory->create(static::TESTED_TYPE, null, [
|
||||||
'days' => [6, 7],
|
'days' => [6, 7],
|
||||||
])
|
])
|
||||||
->createView();
|
->createView();
|
||||||
|
|
||||||
$this->assertEquals([
|
$this->assertEquals([
|
||||||
new ChoiceView(6, '6', '06'),
|
new ChoiceView(6, '6', '6'),
|
||||||
new ChoiceView(7, '7', '07'),
|
new ChoiceView(7, '7', '7'),
|
||||||
], $view['day']->vars['choices']);
|
], $view['day']->vars['choices']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,6 +314,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface
|
||||||
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of CurlResponse objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
|
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of CurlResponse objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$active = 0;
|
||||||
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
||||||
|
|
||||||
return new ResponseStream(CurlResponse::stream($responses, $timeout));
|
return new ResponseStream(CurlResponse::stream($responses, $timeout));
|
||||||
|
@ -326,6 +327,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface
|
||||||
curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null);
|
curl_multi_setopt($this->multi->handle, CURLMOPT_PUSHFUNCTION, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$active = 0;
|
||||||
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($this->multi->handle, $active));
|
||||||
|
|
||||||
foreach ($this->multi->openHandles as $ch) {
|
foreach ($this->multi->openHandles as $ch) {
|
||||||
|
|
|
@ -255,6 +255,7 @@ final class CurlResponse implements ResponseInterface
|
||||||
|
|
||||||
try {
|
try {
|
||||||
self::$performing = true;
|
self::$performing = true;
|
||||||
|
$active = 0;
|
||||||
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($multi->handle, $active));
|
while (CURLM_CALL_MULTI_PERFORM === curl_multi_exec($multi->handle, $active));
|
||||||
|
|
||||||
while ($info = curl_multi_info_read($multi->handle)) {
|
while ($info = curl_multi_info_read($multi->handle)) {
|
||||||
|
|
|
@ -15,6 +15,11 @@ use Symfony\Contracts\HttpClient\Test\HttpClientTestCase as BaseHttpClientTestCa
|
||||||
|
|
||||||
abstract class HttpClientTestCase extends BaseHttpClientTestCase
|
abstract class HttpClientTestCase extends BaseHttpClientTestCase
|
||||||
{
|
{
|
||||||
|
public function testMaxDuration()
|
||||||
|
{
|
||||||
|
$this->markTestSkipped('Implemented as of version 4.4');
|
||||||
|
}
|
||||||
|
|
||||||
public function testToStream()
|
public function testToStream()
|
||||||
{
|
{
|
||||||
$client = $this->getHttpClient(__FUNCTION__);
|
$client = $this->getHttpClient(__FUNCTION__);
|
||||||
|
|
|
@ -29,7 +29,7 @@ class ResponseIsRedirectedTest extends TestCase
|
||||||
try {
|
try {
|
||||||
$constraint->evaluate(new Response());
|
$constraint->evaluate(new Response());
|
||||||
} catch (ExpectationFailedException $e) {
|
} catch (ExpectationFailedException $e) {
|
||||||
$this->assertContains("Failed asserting that the Response is redirected.\nHTTP/1.0 200 OK", TestFailure::exceptionToString($e));
|
$this->assertStringContainsString("Failed asserting that the Response is redirected.\nHTTP/1.0 200 OK", TestFailure::exceptionToString($e));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ class ResponseIsSuccessfulTest extends TestCase
|
||||||
try {
|
try {
|
||||||
$constraint->evaluate(new Response('', 404));
|
$constraint->evaluate(new Response('', 404));
|
||||||
} catch (ExpectationFailedException $e) {
|
} catch (ExpectationFailedException $e) {
|
||||||
$this->assertContains("Failed asserting that the Response is successful.\nHTTP/1.0 404 Not Found", TestFailure::exceptionToString($e));
|
$this->assertStringContainsString("Failed asserting that the Response is successful.\nHTTP/1.0 404 Not Found", TestFailure::exceptionToString($e));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ class ResponseStatusCodeSameTest extends TestCase
|
||||||
try {
|
try {
|
||||||
$constraint->evaluate(new Response('', 404));
|
$constraint->evaluate(new Response('', 404));
|
||||||
} catch (ExpectationFailedException $e) {
|
} catch (ExpectationFailedException $e) {
|
||||||
$this->assertContains("Failed asserting that the Response status code is 200.\nHTTP/1.0 404 Not Found", TestFailure::exceptionToString($e));
|
$this->assertStringContainsString("Failed asserting that the Response status code is 200.\nHTTP/1.0 404 Not Found", TestFailure::exceptionToString($e));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ class Store implements StoreInterface
|
||||||
$key = $this->getCacheKey($request);
|
$key = $this->getCacheKey($request);
|
||||||
|
|
||||||
if (!$entries = $this->getMetadata($key)) {
|
if (!$entries = $this->getMetadata($key)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find a cached entry that matches the request.
|
// find a cached entry that matches the request.
|
||||||
|
@ -146,7 +146,7 @@ class Store implements StoreInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $match) {
|
if (null === $match) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$headers = $match[1];
|
$headers = $match[1];
|
||||||
|
@ -157,6 +157,7 @@ class Store implements StoreInterface
|
||||||
// TODO the metaStore referenced an entity that doesn't exist in
|
// TODO the metaStore referenced an entity that doesn't exist in
|
||||||
// the entityStore. We definitely want to return nil but we should
|
// the entityStore. We definitely want to return nil but we should
|
||||||
// also purge the entry from the meta-store when this is detected.
|
// also purge the entry from the meta-store when this is detected.
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -178,7 +179,7 @@ class Store implements StoreInterface
|
||||||
if (!$response->headers->has('X-Content-Digest')) {
|
if (!$response->headers->has('X-Content-Digest')) {
|
||||||
$digest = $this->generateContentDigest($response);
|
$digest = $this->generateContentDigest($response);
|
||||||
|
|
||||||
if (false === $this->save($digest, $response->getContent())) {
|
if (!$this->save($digest, $response->getContent())) {
|
||||||
throw new \RuntimeException('Unable to store the entity.');
|
throw new \RuntimeException('Unable to store the entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +208,7 @@ class Store implements StoreInterface
|
||||||
|
|
||||||
array_unshift($entries, [$storedEnv, $headers]);
|
array_unshift($entries, [$storedEnv, $headers]);
|
||||||
|
|
||||||
if (false === $this->save($key, serialize($entries))) {
|
if (!$this->save($key, serialize($entries))) {
|
||||||
throw new \RuntimeException('Unable to store the metadata.');
|
throw new \RuntimeException('Unable to store the metadata.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +247,7 @@ class Store implements StoreInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($modified && false === $this->save($key, serialize($entries))) {
|
if ($modified && !$this->save($key, serialize($entries))) {
|
||||||
throw new \RuntimeException('Unable to store the metadata.');
|
throw new \RuntimeException('Unable to store the metadata.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,6 +398,8 @@ class Store implements StoreInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
@chmod($path, 0666 & ~umask());
|
@chmod($path, 0666 & ~umask());
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPath($key)
|
public function getPath($key)
|
||||||
|
|
|
@ -218,7 +218,7 @@ class HttpKernelTest extends TestCase
|
||||||
|
|
||||||
// `file` index the array starting at 0, and __FILE__ starts at 1
|
// `file` index the array starting at 0, and __FILE__ starts at 1
|
||||||
$line = file($first['file'])[$first['line'] - 2];
|
$line = file($first['file'])[$first['line'] - 2];
|
||||||
$this->assertContains('// call controller', $line);
|
$this->assertStringContainsString('// call controller', $line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,9 @@ final class Inflector
|
||||||
// indices (index)
|
// indices (index)
|
||||||
['xedni', 5, false, true, ['indicies', 'indexes']],
|
['xedni', 5, false, true, ['indicies', 'indexes']],
|
||||||
|
|
||||||
|
// boxes (box)
|
||||||
|
['xo', 2, false, true, 'oxes'],
|
||||||
|
|
||||||
// indexes (index), matrixes (matrix)
|
// indexes (index), matrixes (matrix)
|
||||||
['x', 1, true, false, ['cies', 'xes']],
|
['x', 1, true, false, ['cies', 'xes']],
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ class InflectorTest extends TestCase
|
||||||
['batch', 'batches'],
|
['batch', 'batches'],
|
||||||
['beau', ['beaus', 'beaux']],
|
['beau', ['beaus', 'beaux']],
|
||||||
['bee', 'bees'],
|
['bee', 'bees'],
|
||||||
['box', ['bocies', 'boxes']],
|
['box', 'boxes'],
|
||||||
['boy', 'boys'],
|
['boy', 'boys'],
|
||||||
['bureau', ['bureaus', 'bureaux']],
|
['bureau', ['bureaus', 'bureaux']],
|
||||||
['bus', 'buses'],
|
['bus', 'buses'],
|
||||||
|
|
|
@ -591,6 +591,7 @@ abstract class AbstractCurrencyDataProviderTest extends AbstractDataProviderTest
|
||||||
* @var CurrencyDataProvider
|
* @var CurrencyDataProvider
|
||||||
*/
|
*/
|
||||||
protected $dataProvider;
|
protected $dataProvider;
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
@ -600,6 +601,15 @@ abstract class AbstractCurrencyDataProviderTest extends AbstractDataProviderTest
|
||||||
$this->getDataDirectory().'/'.Intl::CURRENCY_DIR,
|
$this->getDataDirectory().'/'.Intl::CURRENCY_DIR,
|
||||||
$this->createEntryReader()
|
$this->createEntryReader()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function getDataDirectory();
|
abstract protected function getDataDirectory();
|
||||||
|
|
|
@ -829,6 +829,7 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest
|
||||||
* @var LanguageDataProvider
|
* @var LanguageDataProvider
|
||||||
*/
|
*/
|
||||||
protected $dataProvider;
|
protected $dataProvider;
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
@ -838,6 +839,15 @@ abstract class AbstractLanguageDataProviderTest extends AbstractDataProviderTest
|
||||||
$this->getDataDirectory().'/'.Intl::LANGUAGE_DIR,
|
$this->getDataDirectory().'/'.Intl::LANGUAGE_DIR,
|
||||||
$this->createEntryReader()
|
$this->createEntryReader()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function getDataDirectory();
|
abstract protected function getDataDirectory();
|
||||||
|
|
|
@ -25,6 +25,7 @@ abstract class AbstractLocaleDataProviderTest extends AbstractDataProviderTest
|
||||||
* @var LocaleDataProvider
|
* @var LocaleDataProvider
|
||||||
*/
|
*/
|
||||||
protected $dataProvider;
|
protected $dataProvider;
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
@ -34,6 +35,13 @@ abstract class AbstractLocaleDataProviderTest extends AbstractDataProviderTest
|
||||||
$this->getDataDirectory().'/'.Intl::LOCALE_DIR,
|
$this->getDataDirectory().'/'.Intl::LOCALE_DIR,
|
||||||
$this->createEntryReader()
|
$this->createEntryReader()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function getDataDirectory();
|
abstract protected function getDataDirectory();
|
||||||
|
|
|
@ -279,6 +279,7 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest
|
||||||
* @var RegionDataProvider
|
* @var RegionDataProvider
|
||||||
*/
|
*/
|
||||||
protected $dataProvider;
|
protected $dataProvider;
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
@ -288,6 +289,15 @@ abstract class AbstractRegionDataProviderTest extends AbstractDataProviderTest
|
||||||
$this->getDataDirectory().'/'.Intl::REGION_DIR,
|
$this->getDataDirectory().'/'.Intl::REGION_DIR,
|
||||||
$this->createEntryReader()
|
$this->createEntryReader()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function getDataDirectory();
|
abstract protected function getDataDirectory();
|
||||||
|
|
|
@ -219,6 +219,7 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest
|
||||||
* @var ScriptDataProvider
|
* @var ScriptDataProvider
|
||||||
*/
|
*/
|
||||||
protected $dataProvider;
|
protected $dataProvider;
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
@ -228,6 +229,15 @@ abstract class AbstractScriptDataProviderTest extends AbstractDataProviderTest
|
||||||
$this->getDataDirectory().'/'.Intl::SCRIPT_DIR,
|
$this->getDataDirectory().'/'.Intl::SCRIPT_DIR,
|
||||||
$this->createEntryReader()
|
$this->createEntryReader()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function getDataDirectory();
|
abstract protected function getDataDirectory();
|
||||||
|
|
|
@ -24,11 +24,23 @@ use Symfony\Component\Intl\Util\IcuVersion;
|
||||||
*/
|
*/
|
||||||
abstract class AbstractIntlDateFormatterTest extends TestCase
|
abstract class AbstractIntlDateFormatterTest extends TestCase
|
||||||
{
|
{
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
\Locale::setDefault('en');
|
\Locale::setDefault('en');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When a time zone is not specified, it uses the system default however it returns null in the getter method.
|
* When a time zone is not specified, it uses the system default however it returns null in the getter method.
|
||||||
*
|
*
|
||||||
|
|
|
@ -16,6 +16,22 @@ use Symfony\Component\Intl\Intl;
|
||||||
|
|
||||||
class IntlTest extends TestCase
|
class IntlTest extends TestCase
|
||||||
{
|
{
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires extension intl
|
* @requires extension intl
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@ abstract class AbstractNumberFormatterTest extends TestCase
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[100, 'ALL', '100'],
|
[100, 'ALL', '100'],
|
||||||
[100, 'BRL', '100.00'],
|
[100, 'BRL', '100'],
|
||||||
[100, 'CRC', '100'],
|
[100, 'CRC', '100'],
|
||||||
[100, 'JPY', '100'],
|
[100, 'JPY', '100'],
|
||||||
[100, 'CHF', '100'],
|
[100, 'CHF', '100'],
|
||||||
|
|
|
@ -209,7 +209,7 @@ class LdapManagerTest extends LdapTestCase
|
||||||
$newEntry = $result[0];
|
$newEntry = $result[0];
|
||||||
$originalCN = $entry->getAttribute('cn')[0];
|
$originalCN = $entry->getAttribute('cn')[0];
|
||||||
|
|
||||||
$this->assertContains($originalCN, $newEntry->getAttribute('cn'));
|
$this->assertStringContainsString($originalCN, $newEntry->getAttribute('cn'));
|
||||||
|
|
||||||
$entryManager->rename($newEntry, 'cn='.$originalCN);
|
$entryManager->rename($newEntry, 'cn='.$originalCN);
|
||||||
|
|
||||||
|
@ -378,6 +378,6 @@ class LdapManagerTest extends LdapTestCase
|
||||||
|
|
||||||
$result = $this->executeSearchQuery(1);
|
$result = $this->executeSearchQuery(1);
|
||||||
$movedEntry = $result[0];
|
$movedEntry = $result[0];
|
||||||
$this->assertContains('ou=Ldap', $movedEntry->getDn());
|
$this->assertStringContainsString('ou=Ldap', $movedEntry->getDn());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class LdapTestCase extends TestCase
|
||||||
$this->markTestSkipped('No server is listening on LDAP_HOST:LDAP_PORT');
|
$this->markTestSkipped('No server is listening on LDAP_HOST:LDAP_PORT');
|
||||||
}
|
}
|
||||||
|
|
||||||
ldap_close($h);
|
ldap_unbind($h);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'host' => getenv('LDAP_HOST'),
|
'host' => getenv('LDAP_HOST'),
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ConsumeMessagesCommandTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertSame(0, $tester->getStatusCode());
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
$this->assertContains('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRunWithBusOption()
|
public function testRunWithBusOption()
|
||||||
|
@ -95,7 +95,7 @@ class ConsumeMessagesCommandTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertSame(0, $tester->getStatusCode());
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
$this->assertContains('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -131,7 +131,7 @@ class ConsumeMessagesCommandTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertSame(0, $tester->getStatusCode());
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
$this->assertContains('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,6 +168,6 @@ class ConsumeMessagesCommandTest extends TestCase
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertSame(0, $tester->getStatusCode());
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
$this->assertContains('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
$this->assertStringContainsString('[OK] Consuming messages from transports "dummy-receiver"', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,6 @@ class FailedMessagesRemoveCommandTest extends TestCase
|
||||||
$tester = new CommandTester($command);
|
$tester = new CommandTester($command);
|
||||||
$tester->execute(['id' => 20, '--force' => true]);
|
$tester->execute(['id' => 20, '--force' => true]);
|
||||||
|
|
||||||
$this->assertContains('Message removed.', $tester->getDisplay());
|
$this->assertStringContainsString('Message removed.', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,6 @@ class FailedMessagesRetryCommandTest extends TestCase
|
||||||
$tester = new CommandTester($command);
|
$tester = new CommandTester($command);
|
||||||
$tester->execute(['id' => [10, 12]]);
|
$tester->execute(['id' => [10, 12]]);
|
||||||
|
|
||||||
$this->assertContains('[OK]', $tester->getDisplay());
|
$this->assertStringContainsString('[OK]', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ class FailedMessagesShowCommandTest extends TestCase
|
||||||
$tester = new CommandTester($command);
|
$tester = new CommandTester($command);
|
||||||
$tester->execute(['id' => 15]);
|
$tester->execute(['id' => 15]);
|
||||||
|
|
||||||
$this->assertContains(sprintf(<<<EOF
|
$this->assertStringContainsString(sprintf(<<<EOF
|
||||||
------------- ---------------------
|
------------- ---------------------
|
||||||
Class stdClass
|
Class stdClass
|
||||||
Message Id 15
|
Message Id 15
|
||||||
|
|
|
@ -42,8 +42,8 @@ class SetupTransportsCommandTest extends TestCase
|
||||||
$tester->execute([]);
|
$tester->execute([]);
|
||||||
$display = $tester->getDisplay();
|
$display = $tester->getDisplay();
|
||||||
|
|
||||||
$this->assertContains('The "amqp" transport was setup successfully.', $display);
|
$this->assertStringContainsString('The "amqp" transport was setup successfully.', $display);
|
||||||
$this->assertContains('The "other_transport" transport does not support setup.', $display);
|
$this->assertStringContainsString('The "other_transport" transport does not support setup.', $display);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testReceiverNameArgument()
|
public function testReceiverNameArgument()
|
||||||
|
@ -66,7 +66,7 @@ class SetupTransportsCommandTest extends TestCase
|
||||||
$tester->execute(['transport' => 'amqp']);
|
$tester->execute(['transport' => 'amqp']);
|
||||||
$display = $tester->getDisplay();
|
$display = $tester->getDisplay();
|
||||||
|
|
||||||
$this->assertContains('The "amqp" transport was setup successfully.', $display);
|
$this->assertStringContainsString('The "amqp" transport was setup successfully.', $display);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testReceiverNameArgumentNotFound()
|
public function testReceiverNameArgumentNotFound()
|
||||||
|
|
|
@ -2431,12 +2431,12 @@ final class MimeTypes implements MimeTypesInterface
|
||||||
'odc' => ['application/vnd.oasis.opendocument.chart'],
|
'odc' => ['application/vnd.oasis.opendocument.chart'],
|
||||||
'odf' => ['application/vnd.oasis.opendocument.formula'],
|
'odf' => ['application/vnd.oasis.opendocument.formula'],
|
||||||
'odft' => ['application/vnd.oasis.opendocument.formula-template'],
|
'odft' => ['application/vnd.oasis.opendocument.formula-template'],
|
||||||
'odg' => ['vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics'],
|
'odg' => ['application/vnd.oasis.opendocument.graphics'],
|
||||||
'odi' => ['application/vnd.oasis.opendocument.image'],
|
'odi' => ['application/vnd.oasis.opendocument.image'],
|
||||||
'odm' => ['application/vnd.oasis.opendocument.text-master'],
|
'odm' => ['application/vnd.oasis.opendocument.text-master'],
|
||||||
'odp' => ['vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation'],
|
'odp' => ['application/vnd.oasis.opendocument.presentation'],
|
||||||
'ods' => ['vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet'],
|
'ods' => ['application/vnd.oasis.opendocument.spreadsheet'],
|
||||||
'odt' => ['vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text'],
|
'odt' => ['application/vnd.oasis.opendocument.text'],
|
||||||
'oga' => ['audio/ogg', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg'],
|
'oga' => ['audio/ogg', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg'],
|
||||||
'ogg' => ['audio/ogg', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg', 'video/ogg', 'video/x-ogg', 'video/x-theora', 'video/x-theora+ogg'],
|
'ogg' => ['audio/ogg', 'audio/vorbis', 'audio/x-flac+ogg', 'audio/x-ogg', 'audio/x-oggflac', 'audio/x-speex+ogg', 'audio/x-vorbis', 'audio/x-vorbis+ogg', 'video/ogg', 'video/x-ogg', 'video/x-theora', 'video/x-theora+ogg'],
|
||||||
'ogm' => ['video/x-ogm', 'video/x-ogm+ogg'],
|
'ogm' => ['video/x-ogm', 'video/x-ogm+ogg'],
|
||||||
|
|
|
@ -108,10 +108,6 @@ $exts = [
|
||||||
'mp4' => ['video/mp4'],
|
'mp4' => ['video/mp4'],
|
||||||
'mpeg' => ['video/mpeg'],
|
'mpeg' => ['video/mpeg'],
|
||||||
'mpg' => ['video/mpeg'],
|
'mpg' => ['video/mpeg'],
|
||||||
'odg' => ['vnd.oasis.opendocument.graphics'],
|
|
||||||
'odp' => ['vnd.oasis.opendocument.presentation'],
|
|
||||||
'ods' => ['vnd.oasis.opendocument.spreadsheet'],
|
|
||||||
'odt' => ['vnd.oasis.opendocument.text'],
|
|
||||||
'ogg' => ['audio/ogg'],
|
'ogg' => ['audio/ogg'],
|
||||||
'pdf' => ['application/pdf'],
|
'pdf' => ['application/pdf'],
|
||||||
'php' => ['application/x-php'],
|
'php' => ['application/x-php'],
|
||||||
|
|
|
@ -330,7 +330,7 @@ class EmailTest extends TestCase
|
||||||
$this->assertCount(2, $parts = $related[0]->getParts());
|
$this->assertCount(2, $parts = $related[0]->getParts());
|
||||||
$this->assertInstanceOf(AlternativePart::class, $parts[0]);
|
$this->assertInstanceOf(AlternativePart::class, $parts[0]);
|
||||||
$generatedHtml = $parts[0]->getParts()[1];
|
$generatedHtml = $parts[0]->getParts()[1];
|
||||||
$this->assertContains('cid:'.$parts[1]->getContentId(), $generatedHtml->getBody());
|
$this->assertStringContainsString('cid:'.$parts[1]->getContentId(), $generatedHtml->getBody());
|
||||||
|
|
||||||
$content = 'html content <img src="cid:test.gif">';
|
$content = 'html content <img src="cid:test.gif">';
|
||||||
$r = fopen('php://memory', 'r+', false);
|
$r = fopen('php://memory', 'r+', false);
|
||||||
|
|
|
@ -23,9 +23,9 @@ class MessagePartTest extends TestCase
|
||||||
public function testConstructor()
|
public function testConstructor()
|
||||||
{
|
{
|
||||||
$p = new MessagePart((new Email())->from('fabien@symfony.com')->text('content'));
|
$p = new MessagePart((new Email())->from('fabien@symfony.com')->text('content'));
|
||||||
$this->assertContains('content', $p->getBody());
|
$this->assertStringContainsString('content', $p->getBody());
|
||||||
$this->assertContains('content', $p->bodyToString());
|
$this->assertStringContainsString('content', $p->bodyToString());
|
||||||
$this->assertContains('content', implode('', iterator_to_array($p->bodyToIterable())));
|
$this->assertStringContainsString('content', implode('', iterator_to_array($p->bodyToIterable())));
|
||||||
$this->assertEquals('message', $p->getMediaType());
|
$this->assertEquals('message', $p->getMediaType());
|
||||||
$this->assertEquals('rfc822', $p->getMediaSubType());
|
$this->assertEquals('rfc822', $p->getMediaSubType());
|
||||||
}
|
}
|
||||||
|
|
|
@ -797,6 +797,8 @@ class PropertyAccessor implements PropertyAccessorInterface
|
||||||
|
|
||||||
yield $result;
|
yield $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -331,7 +331,7 @@ class XmlFileLoader extends FileLoader
|
||||||
private function parseDefaultsConfig(\DOMElement $element, string $path)
|
private function parseDefaultsConfig(\DOMElement $element, string $path)
|
||||||
{
|
{
|
||||||
if ($this->isElementValueNull($element)) {
|
if ($this->isElementValueNull($element)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for existing element nodes in the default element. There can
|
// Check for existing element nodes in the default element. There can
|
||||||
|
@ -365,7 +365,7 @@ class XmlFileLoader extends FileLoader
|
||||||
private function parseDefaultNode(\DOMElement $node, string $path)
|
private function parseDefaultNode(\DOMElement $node, string $path)
|
||||||
{
|
{
|
||||||
if ($this->isElementValueNull($node)) {
|
if ($this->isElementValueNull($node)) {
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($node->localName) {
|
switch ($node->localName) {
|
||||||
|
|
|
@ -4,39 +4,43 @@
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="1">
|
<trans-unit id="1">
|
||||||
<source>An authentication exception occurred.</source>
|
<source>An authentication exception occurred.</source>
|
||||||
<target>خطایی هنگام تعیین اعتبار اتفاق افتاد.</target>
|
<target>خطایی هنگام احراز هویت رخ داده است.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="2">
|
<trans-unit id="2">
|
||||||
<source>Authentication credentials could not be found.</source>
|
<source>Authentication credentials could not be found.</source>
|
||||||
<target>شرایط تعیین اعتبار پیدا نشد.</target>
|
<target>شرایط احراز هویت یافت نشد.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="3">
|
<trans-unit id="3">
|
||||||
<source>Authentication request could not be processed due to a system problem.</source>
|
<source>Authentication request could not be processed due to a system problem.</source>
|
||||||
<target>درخواست تعیین اعتبار به دلیل مشکل سیستم قابل بررسی نیست.</target>
|
<target>درخواست احراز هویت به دلیل وجود مشکل در سیستم قابل پردازش نمی باشد.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="4">
|
<trans-unit id="4">
|
||||||
<source>Invalid credentials.</source>
|
<source>Invalid credentials.</source>
|
||||||
<target>شرایط نامعتبر.</target>
|
<target>احراز هویت نامعتبر می باشد.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="5">
|
<trans-unit id="5">
|
||||||
<source>Cookie has already been used by someone else.</source>
|
<source>Cookie has already been used by someone else.</source>
|
||||||
<target>کوکی قبلا برای شخص دیگری استفاده شده است.</target>
|
<target>Cookie قبلا توسط شخص دیگری استفاده گردیده است.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="6">
|
<trans-unit id="6">
|
||||||
<source>Not privileged to request the resource.</source>
|
<source>Not privileged to request the resource.</source>
|
||||||
<target>دسترسی لازم برای درخواست این منبع را ندارید.</target>
|
<target>دسترسی لازم برای درخواست از این منبع را دارا نمی باشید.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="7">
|
<trans-unit id="7">
|
||||||
<source>Invalid CSRF token.</source>
|
<source>Invalid CSRF token.</source>
|
||||||
<target>توکن CSRF معتبر نیست.</target>
|
<target>توکن CSRF معتبر نمی باشد.</target>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="8">
|
||||||
|
<source>Digest nonce has expired.</source>
|
||||||
|
<target>Digest nonce منقضی گردیده است.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="9">
|
<trans-unit id="9">
|
||||||
<source>No authentication provider found to support the authentication token.</source>
|
<source>No authentication provider found to support the authentication token.</source>
|
||||||
<target>هیچ ارایه کننده تعیین اعتباری برای ساپورت توکن تعیین اعتبار پیدا نشد.</target>
|
<target>هیچ ارایه دهنده احراز هویتی برای پشتیبانی از توکن احراز هویت پیدا نشد.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="10">
|
<trans-unit id="10">
|
||||||
<source>No session available, it either timed out or cookies are not enabled.</source>
|
<source>No session available, it either timed out or cookies are not enabled.</source>
|
||||||
<target>جلسهای در دسترس نیست. این میتواند یا به دلیل پایان یافتن زمان باشد یا اینکه کوکی ها فعال نیستند.</target>
|
<target>هیچ جلسهای در دسترس نمی باشد. این میتواند به دلیل پایان یافتن زمان و یا فعال نبودن کوکی ها باشد.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="11">
|
<trans-unit id="11">
|
||||||
<source>No token could be found.</source>
|
<source>No token could be found.</source>
|
||||||
|
@ -48,19 +52,19 @@
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="13">
|
<trans-unit id="13">
|
||||||
<source>Account has expired.</source>
|
<source>Account has expired.</source>
|
||||||
<target>حساب کاربری منقضی شده است.</target>
|
<target>حساب کاربری منقضی گردیده است.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="14">
|
<trans-unit id="14">
|
||||||
<source>Credentials have expired.</source>
|
<source>Credentials have expired.</source>
|
||||||
<target>پارامترهای تعیین اعتبار منقضی شدهاند.</target>
|
<target>مجوزهای احراز هویت منقضی گردیدهاند.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="15">
|
<trans-unit id="15">
|
||||||
<source>Account is disabled.</source>
|
<source>Account is disabled.</source>
|
||||||
<target>حساب کاربری غیرفعال است.</target>
|
<target>حساب کاربری غیرفعال می باشد.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="16">
|
<trans-unit id="16">
|
||||||
<source>Account is locked.</source>
|
<source>Account is locked.</source>
|
||||||
<target>حساب کاربری قفل شده است.</target>
|
<target>حساب کاربری قفل گردیده است.</target>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
|
|
|
@ -89,13 +89,6 @@ class GuardAuthenticatorHandlerTest extends TestCase
|
||||||
*/
|
*/
|
||||||
public function testHandleAuthenticationClearsToken($tokenClass, $tokenProviderKey, $actualProviderKey)
|
public function testHandleAuthenticationClearsToken($tokenClass, $tokenProviderKey, $actualProviderKey)
|
||||||
{
|
{
|
||||||
$token = $this->getMockBuilder($tokenClass)
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
$token->expects($this->any())
|
|
||||||
->method('getProviderKey')
|
|
||||||
->willReturn($tokenProviderKey);
|
|
||||||
|
|
||||||
$this->tokenStorage->expects($this->never())
|
$this->tokenStorage->expects($this->never())
|
||||||
->method('setToken')
|
->method('setToken')
|
||||||
->with(null);
|
->with(null);
|
||||||
|
|
|
@ -75,8 +75,6 @@ class BasicAuthenticationListenerTest extends TestCase
|
||||||
'PHP_AUTH_PW' => 'ThePassword',
|
'PHP_AUTH_PW' => 'ThePassword',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
|
|
||||||
|
|
||||||
$tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
|
$tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
|
||||||
$tokenStorage
|
$tokenStorage
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
|
|
|
@ -124,7 +124,6 @@ class AbstractRememberMeServicesTest extends TestCase
|
||||||
$service = $this->getService(null, ['name' => 'foo', 'always_remember_me' => true, 'path' => null, 'domain' => null]);
|
$service = $this->getService(null, ['name' => 'foo', 'always_remember_me' => true, 'path' => null, 'domain' => null]);
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
$response = new Response();
|
$response = new Response();
|
||||||
$account = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
|
|
||||||
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
|
$token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
|
||||||
$token
|
$token
|
||||||
->expects($this->once())
|
->expects($this->once())
|
||||||
|
|
|
@ -250,6 +250,8 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
|
||||||
return $normalizer;
|
return $normalizer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -291,6 +293,8 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
|
||||||
return $normalizer;
|
return $normalizer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -87,7 +87,7 @@ class StopwatchTest extends TestCase
|
||||||
$event = $stopwatch->stop('foo');
|
$event = $stopwatch->stop('foo');
|
||||||
|
|
||||||
$this->assertInstanceOf('Symfony\Component\Stopwatch\StopwatchEvent', $event);
|
$this->assertInstanceOf('Symfony\Component\Stopwatch\StopwatchEvent', $event);
|
||||||
$this->assertEquals(200, $event->getDuration(), '', self::DELTA);
|
$this->assertEqualsWithDelta(200, $event->getDuration(), self::DELTA);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUnknownEvent()
|
public function testUnknownEvent()
|
||||||
|
|
|
@ -41,6 +41,10 @@ class CsvFileLoader extends FileLoader
|
||||||
$file->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
|
$file->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
|
||||||
|
|
||||||
foreach ($file as $data) {
|
foreach ($file as $data) {
|
||||||
|
if (false === $data) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === \count($data)) {
|
if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === \count($data)) {
|
||||||
$messages[$data[0]] = $data[1];
|
$messages[$data[0]] = $data[1];
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class XliffLintCommandTest extends TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
||||||
$this->assertContains('OK', trim($tester->getDisplay()));
|
$this->assertStringContainsString('OK', trim($tester->getDisplay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLintCorrectFiles()
|
public function testLintCorrectFiles()
|
||||||
|
@ -52,7 +52,7 @@ class XliffLintCommandTest extends TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
$this->assertEquals(0, $tester->getStatusCode(), 'Returns 0 in case of success');
|
||||||
$this->assertContains('OK', trim($tester->getDisplay()));
|
$this->assertStringContainsString('OK', trim($tester->getDisplay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,7 +69,7 @@ class XliffLintCommandTest extends TestCase
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals($mustFail ? 1 : 0, $tester->getStatusCode());
|
$this->assertEquals($mustFail ? 1 : 0, $tester->getStatusCode());
|
||||||
$this->assertContains($mustFail ? '[WARNING] 0 XLIFF files have valid syntax and 1 contain errors.' : '[OK] All 1 XLIFF files contain valid syntax.', $tester->getDisplay());
|
$this->assertStringContainsString($mustFail ? '[WARNING] 0 XLIFF files have valid syntax and 1 contain errors.' : '[OK] All 1 XLIFF files contain valid syntax.', $tester->getDisplay());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLintIncorrectXmlSyntax()
|
public function testLintIncorrectXmlSyntax()
|
||||||
|
@ -80,7 +80,7 @@ class XliffLintCommandTest extends TestCase
|
||||||
$tester->execute(['filename' => $filename], ['decorated' => false]);
|
$tester->execute(['filename' => $filename], ['decorated' => false]);
|
||||||
|
|
||||||
$this->assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error');
|
$this->assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error');
|
||||||
$this->assertContains('Opening and ending tag mismatch: target line 6 and source', trim($tester->getDisplay()));
|
$this->assertStringContainsString('Opening and ending tag mismatch: target line 6 and source', trim($tester->getDisplay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLintIncorrectTargetLanguage()
|
public function testLintIncorrectTargetLanguage()
|
||||||
|
@ -91,7 +91,7 @@ class XliffLintCommandTest extends TestCase
|
||||||
$tester->execute(['filename' => $filename], ['decorated' => false]);
|
$tester->execute(['filename' => $filename], ['decorated' => false]);
|
||||||
|
|
||||||
$this->assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error');
|
$this->assertEquals(1, $tester->getStatusCode(), 'Returns 1 in case of error');
|
||||||
$this->assertContains('There is a mismatch between the language included in the file name ("messages.en.xlf") and the "es" value used in the "target-language" attribute of the file.', trim($tester->getDisplay()));
|
$this->assertStringContainsString('There is a mismatch between the language included in the file name ("messages.en.xlf") and the "es" value used in the "target-language" attribute of the file.', trim($tester->getDisplay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLintTargetLanguageIsCaseInsensitive()
|
public function testLintTargetLanguageIsCaseInsensitive()
|
||||||
|
@ -102,7 +102,7 @@ class XliffLintCommandTest extends TestCase
|
||||||
$tester->execute(['filename' => $filename], ['decorated' => false]);
|
$tester->execute(['filename' => $filename], ['decorated' => false]);
|
||||||
|
|
||||||
$this->assertEquals(0, $tester->getStatusCode());
|
$this->assertEquals(0, $tester->getStatusCode());
|
||||||
$this->assertContains('[OK] All 1 XLIFF files contain valid syntax.', trim($tester->getDisplay()));
|
$this->assertStringContainsString('[OK] All 1 XLIFF files contain valid syntax.', trim($tester->getDisplay()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testLintFileNotReadable()
|
public function testLintFileNotReadable()
|
||||||
|
|
|
@ -50,14 +50,11 @@ class TranslationExtractorPassTest extends TestCase
|
||||||
{
|
{
|
||||||
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
|
$this->expectException('Symfony\Component\DependencyInjection\Exception\RuntimeException');
|
||||||
$this->expectExceptionMessage('The alias for the tag "translation.extractor" of service "foo.id" must be set.');
|
$this->expectExceptionMessage('The alias for the tag "translation.extractor" of service "foo.id" must be set.');
|
||||||
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->disableOriginalConstructor()->getMock();
|
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
$container->register('translation.extractor');
|
$container->register('translation.extractor');
|
||||||
$container->register('foo.id')
|
$container->register('foo.id')
|
||||||
->addTag('translation.extractor', []);
|
->addTag('translation.extractor', []);
|
||||||
|
|
||||||
$definition->expects($this->never())->method('addMethodCall');
|
|
||||||
|
|
||||||
$translationDumperPass = new TranslationExtractorPass();
|
$translationDumperPass = new TranslationExtractorPass();
|
||||||
$translationDumperPass->process($container);
|
$translationDumperPass->process($container);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,22 @@ use Symfony\Contracts\Translation\Test\TranslatorTest;
|
||||||
|
|
||||||
class IdentityTranslatorTest extends TranslatorTest
|
class IdentityTranslatorTest extends TranslatorTest
|
||||||
{
|
{
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
|
}
|
||||||
|
|
||||||
public function getTranslator()
|
public function getTranslator()
|
||||||
{
|
{
|
||||||
return new IdentityTranslator();
|
return new IdentityTranslator();
|
||||||
|
|
|
@ -18,6 +18,22 @@ use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||||
|
|
||||||
class CountryValidatorTest extends ConstraintValidatorTestCase
|
class CountryValidatorTest extends ConstraintValidatorTestCase
|
||||||
{
|
{
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
|
}
|
||||||
|
|
||||||
protected function createValidator()
|
protected function createValidator()
|
||||||
{
|
{
|
||||||
return new CountryValidator();
|
return new CountryValidator();
|
||||||
|
|
|
@ -18,6 +18,22 @@ use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||||
|
|
||||||
class CurrencyValidatorTest extends ConstraintValidatorTestCase
|
class CurrencyValidatorTest extends ConstraintValidatorTestCase
|
||||||
{
|
{
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
|
}
|
||||||
|
|
||||||
protected function createValidator()
|
protected function createValidator()
|
||||||
{
|
{
|
||||||
return new CurrencyValidator();
|
return new CurrencyValidator();
|
||||||
|
|
|
@ -18,6 +18,22 @@ use Symfony\Component\Validator\Test\ConstraintValidatorTestCase;
|
||||||
|
|
||||||
class LanguageValidatorTest extends ConstraintValidatorTestCase
|
class LanguageValidatorTest extends ConstraintValidatorTestCase
|
||||||
{
|
{
|
||||||
|
private $defaultLocale;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
parent::setUp();
|
||||||
|
|
||||||
|
$this->defaultLocale = \Locale::getDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function tearDown()
|
||||||
|
{
|
||||||
|
parent::tearDown();
|
||||||
|
|
||||||
|
\Locale::setDefault($this->defaultLocale);
|
||||||
|
}
|
||||||
|
|
||||||
protected function createValidator()
|
protected function createValidator()
|
||||||
{
|
{
|
||||||
return new LanguageValidator();
|
return new LanguageValidator();
|
||||||
|
|
|
@ -50,7 +50,7 @@ class RangeValidatorTest extends ConstraintValidatorTestCase
|
||||||
[9.99999, '9.99999'],
|
[9.99999, '9.99999'],
|
||||||
['9.99999', '"9.99999"'],
|
['9.99999', '"9.99999"'],
|
||||||
[5, '5'],
|
[5, '5'],
|
||||||
[1.0, '1.0'],
|
[1.0, '1'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ class RangeValidatorTest extends ConstraintValidatorTestCase
|
||||||
[20.000001, '20.000001'],
|
[20.000001, '20.000001'],
|
||||||
['20.000001', '"20.000001"'],
|
['20.000001', '"20.000001"'],
|
||||||
[21, '21'],
|
[21, '21'],
|
||||||
[30.0, '30.0'],
|
[30.0, '30'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,6 @@ Exception {
|
||||||
› }
|
› }
|
||||||
}
|
}
|
||||||
%s%eTests%eCaster%eExceptionCasterTest.php:40 { …}
|
%s%eTests%eCaster%eExceptionCasterTest.php:40 { …}
|
||||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testDefaultSettings() {}
|
|
||||||
%A
|
%A
|
||||||
EODUMP;
|
EODUMP;
|
||||||
|
|
||||||
|
@ -71,8 +70,7 @@ EODUMP;
|
||||||
› return new \Exception(''.$msg);
|
› return new \Exception(''.$msg);
|
||||||
› }
|
› }
|
||||||
}
|
}
|
||||||
%s%eTests%eCaster%eExceptionCasterTest.php:65 { …}
|
%s%eTests%eCaster%eExceptionCasterTest.php:64 { …}
|
||||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testSeek() {}
|
|
||||||
%A
|
%A
|
||||||
EODUMP;
|
EODUMP;
|
||||||
|
|
||||||
|
@ -96,8 +94,7 @@ Exception {
|
||||||
› return new \Exception(''.$msg);
|
› return new \Exception(''.$msg);
|
||||||
› }
|
› }
|
||||||
}
|
}
|
||||||
%s%eTests%eCaster%eExceptionCasterTest.php:84 { …}
|
%s%eTests%eCaster%eExceptionCasterTest.php:82 { …}
|
||||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testNoArgs() {}
|
|
||||||
%A
|
%A
|
||||||
EODUMP;
|
EODUMP;
|
||||||
|
|
||||||
|
|
|
@ -446,7 +446,7 @@ abstract class HttpClientTestCase extends TestCase
|
||||||
|
|
||||||
$body = $response->toArray();
|
$body = $response->toArray();
|
||||||
|
|
||||||
$this->assertContains('json', $body['content-type']);
|
$this->assertStringContainsString('json', $body['content-type']);
|
||||||
unset($body['content-type']);
|
unset($body['content-type']);
|
||||||
$this->assertSame(['foo' => 'bar', 'REQUEST_METHOD' => 'POST'], $body);
|
$this->assertSame(['foo' => 'bar', 'REQUEST_METHOD' => 'POST'], $body);
|
||||||
}
|
}
|
||||||
|
@ -705,11 +705,11 @@ abstract class HttpClientTestCase extends TestCase
|
||||||
$headers = $response->getHeaders();
|
$headers = $response->getHeaders();
|
||||||
|
|
||||||
$this->assertSame(['Accept-Encoding'], $headers['vary']);
|
$this->assertSame(['Accept-Encoding'], $headers['vary']);
|
||||||
$this->assertContains('gzip', $headers['content-encoding'][0]);
|
$this->assertStringContainsString('gzip', $headers['content-encoding'][0]);
|
||||||
|
|
||||||
$body = $response->toArray();
|
$body = $response->toArray();
|
||||||
|
|
||||||
$this->assertContains('gzip', $body['HTTP_ACCEPT_ENCODING']);
|
$this->assertStringContainsString('gzip', $body['HTTP_ACCEPT_ENCODING']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testBaseUri()
|
public function testBaseUri()
|
||||||
|
@ -757,7 +757,7 @@ abstract class HttpClientTestCase extends TestCase
|
||||||
$headers = $response->getHeaders();
|
$headers = $response->getHeaders();
|
||||||
|
|
||||||
$this->assertSame(['Accept-Encoding'], $headers['vary']);
|
$this->assertSame(['Accept-Encoding'], $headers['vary']);
|
||||||
$this->assertContains('gzip', $headers['content-encoding'][0]);
|
$this->assertStringContainsString('gzip', $headers['content-encoding'][0]);
|
||||||
|
|
||||||
$body = $response->getContent();
|
$body = $response->getContent();
|
||||||
$this->assertSame("\x1F", $body[0]);
|
$this->assertSame("\x1F", $body[0]);
|
||||||
|
|
Reference in New Issue