mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-02 04:59:49 +09:00
Dependency updates and update version number
This commit is contained in:
@@ -39,9 +39,15 @@ final class ServiceValueResolver implements ArgumentValueResolverInterface
|
||||
|
||||
if (\is_array($controller) && \is_callable($controller, true) && \is_string($controller[0])) {
|
||||
$controller = $controller[0].'::'.$controller[1];
|
||||
} elseif (!\is_string($controller) || '' === $controller) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return \is_string($controller) && $this->container->has($controller) && $this->container->get($controller)->has($argument->getName());
|
||||
if ('\\' === $controller[0]) {
|
||||
$controller = ltrim($controller, '\\');
|
||||
}
|
||||
|
||||
return $this->container->has($controller) && $this->container->get($controller)->has($argument->getName());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -53,6 +59,10 @@ final class ServiceValueResolver implements ArgumentValueResolverInterface
|
||||
$controller = $controller[0].'::'.$controller[1];
|
||||
}
|
||||
|
||||
if ('\\' === $controller[0]) {
|
||||
$controller = ltrim($controller, '\\');
|
||||
}
|
||||
|
||||
yield $this->container->get($controller)->get($argument->getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
|
||||
}
|
||||
|
||||
foreach ($reflection->getParameters() as $param) {
|
||||
$arguments[] = new ArgumentMetadata($param->getName(), $this->getType($param), $this->isVariadic($param), $this->hasDefaultValue($param), $this->getDefaultValue($param), $param->allowsNull());
|
||||
$arguments[] = new ArgumentMetadata($param->getName(), $this->getType($param, $reflection), $this->isVariadic($param), $this->hasDefaultValue($param), $this->getDefaultValue($param), $param->allowsNull());
|
||||
}
|
||||
|
||||
return $arguments;
|
||||
@@ -107,23 +107,35 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
private function getType(\ReflectionParameter $parameter)
|
||||
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function)
|
||||
{
|
||||
if ($this->supportsParameterType) {
|
||||
if (!$type = $parameter->getType()) {
|
||||
return;
|
||||
}
|
||||
$typeName = $type instanceof \ReflectionNamedType ? $type->getName() : $type->__toString();
|
||||
if ('array' === $typeName && !$type->isBuiltin()) {
|
||||
$name = $type instanceof \ReflectionNamedType ? $type->getName() : $type->__toString();
|
||||
if ('array' === $name && !$type->isBuiltin()) {
|
||||
// Special case for HHVM with variadics
|
||||
return;
|
||||
}
|
||||
|
||||
return $typeName;
|
||||
} elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $parameter, $name)) {
|
||||
$name = $name[1];
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
$lcName = strtolower($name);
|
||||
|
||||
if (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $parameter, $info)) {
|
||||
return $info[1];
|
||||
if ('self' !== $lcName && 'parent' !== $lcName) {
|
||||
return $name;
|
||||
}
|
||||
if (!$function instanceof \ReflectionMethod) {
|
||||
return;
|
||||
}
|
||||
if ('self' === $lcName) {
|
||||
return $function->getDeclaringClass()->name;
|
||||
}
|
||||
if ($parent = $function->getDeclaringClass()->getParentClass()) {
|
||||
return $parent->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
if ($this->stopwatch) {
|
||||
$this->stopwatch->start('dump');
|
||||
}
|
||||
if ($this->isCollected) {
|
||||
if ($this->isCollected && !$this->dumper) {
|
||||
$this->isCollected = false;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
|
||||
--$i;
|
||||
}
|
||||
|
||||
if ('cli' !== PHP_SAPI && stripos($h[$i], 'html')) {
|
||||
if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true) && stripos($h[$i], 'html')) {
|
||||
$this->dumper = new HtmlDumper('php://output', $this->charset);
|
||||
$this->dumper->setDisplayOptions(array('fileLinkFormat' => $this->fileLinkFormat));
|
||||
} else {
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace Symfony\Component\HttpKernel\Debug;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Routing\Exception\ExceptionInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
/**
|
||||
* Formats debug file links.
|
||||
@@ -26,6 +28,9 @@ class FileLinkFormatter implements \Serializable
|
||||
private $baseDir;
|
||||
private $urlFormat;
|
||||
|
||||
/**
|
||||
* @param string|\Closure $urlFormat the URL format, or a closure that returns it on-demand
|
||||
*/
|
||||
public function __construct($fileLinkFormat = null, RequestStack $requestStack = null, $baseDir = null, $urlFormat = null)
|
||||
{
|
||||
$fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
|
||||
@@ -70,6 +75,18 @@ class FileLinkFormatter implements \Serializable
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public static function generateUrlFormat(UrlGeneratorInterface $router, $routeName, $queryString)
|
||||
{
|
||||
try {
|
||||
return $router->generate($routeName).$queryString;
|
||||
} catch (ExceptionInterface $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private function getFileLinkFormat()
|
||||
{
|
||||
if ($this->fileLinkFormat) {
|
||||
@@ -78,6 +95,10 @@ class FileLinkFormatter implements \Serializable
|
||||
if ($this->requestStack && $this->baseDir && $this->urlFormat) {
|
||||
$request = $this->requestStack->getMasterRequest();
|
||||
if ($request instanceof Request) {
|
||||
if ($this->urlFormat instanceof \Closure && !$this->urlFormat = \call_user_func($this->urlFormat)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return array(
|
||||
$request->getSchemeAndHttpHost().$request->getBaseUrl().$this->urlFormat,
|
||||
$this->baseDir.DIRECTORY_SEPARATOR, '',
|
||||
|
||||
@@ -22,6 +22,7 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\DependencyInjection\LazyProxy\ProxyHelper;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\DependencyInjection\TypedReference;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Creates the service-locators required by ServiceValueResolver.
|
||||
@@ -148,6 +149,10 @@ class RegisterControllerArgumentLocatorsPass implements CompilerPassInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Request::class === $type) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($type && !$p->isOptional() && !$p->allowsNull() && !class_exists($type) && !interface_exists($type, false)) {
|
||||
$message = sprintf('Cannot determine controller argument for "%s::%s()": the $%s argument is type-hinted with the non-existent class or interface: "%s".', $class, $r->name, $p->name, $type);
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
*/
|
||||
abstract class AbstractTestSessionListener implements EventSubscriberInterface
|
||||
{
|
||||
private $sessionId;
|
||||
|
||||
public function onKernelRequest(GetResponseEvent $event)
|
||||
{
|
||||
if (!$event->isMasterRequest()) {
|
||||
@@ -44,7 +46,8 @@ abstract class AbstractTestSessionListener implements EventSubscriberInterface
|
||||
$cookies = $event->getRequest()->cookies;
|
||||
|
||||
if ($cookies->has($session->getName())) {
|
||||
$session->setId($cookies->get($session->getName()));
|
||||
$this->sessionId = $cookies->get($session->getName());
|
||||
$session->setId($this->sessionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,9 +69,10 @@ abstract class AbstractTestSessionListener implements EventSubscriberInterface
|
||||
$session->save();
|
||||
}
|
||||
|
||||
if ($session instanceof Session ? !$session->isEmpty() : $wasStarted) {
|
||||
if ($session instanceof Session ? !$session->isEmpty() || (null !== $this->sessionId && $session->getId() !== $this->sessionId) : $wasStarted) {
|
||||
$params = session_get_cookie_params();
|
||||
$event->getResponse()->headers->setCookie(new Cookie($session->getName(), $session->getId(), 0 === $params['lifetime'] ? 0 : time() + $params['lifetime'], $params['path'], $params['domain'], $params['secure'], $params['httponly']));
|
||||
$this->sessionId = $session->getId();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
namespace Symfony\Component\HttpKernel\EventListener;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Debug\ExceptionHandler;
|
||||
use Symfony\Component\Debug\Exception\FlattenException;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
||||
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
|
||||
@@ -33,12 +35,14 @@ class ExceptionListener implements EventSubscriberInterface
|
||||
protected $controller;
|
||||
protected $logger;
|
||||
protected $debug;
|
||||
private $charset;
|
||||
|
||||
public function __construct($controller, LoggerInterface $logger = null, $debug = false)
|
||||
public function __construct($controller, LoggerInterface $logger = null, $debug = false, $charset = null)
|
||||
{
|
||||
$this->controller = $controller;
|
||||
$this->logger = $logger;
|
||||
$this->debug = $debug;
|
||||
$this->charset = $charset;
|
||||
}
|
||||
|
||||
public function onKernelException(GetResponseForExceptionEvent $event)
|
||||
@@ -117,8 +121,12 @@ class ExceptionListener implements EventSubscriberInterface
|
||||
protected function duplicateRequest(\Exception $exception, Request $request)
|
||||
{
|
||||
$attributes = array(
|
||||
'_controller' => $this->controller,
|
||||
'exception' => FlattenException::create($exception),
|
||||
'exception' => $exception = FlattenException::create($exception),
|
||||
'_controller' => $this->controller ?: function () use ($exception) {
|
||||
$handler = new ExceptionHandler($this->debug, $this->charset);
|
||||
|
||||
return new Response($handler->getHtml($exception), $exception->getStatusCode(), $exception->getHeaders());
|
||||
},
|
||||
'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
|
||||
);
|
||||
$request = $request->duplicate(null, null, $attributes);
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Symfony\Component\HttpKernel\EventListener;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
|
||||
use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
@@ -129,12 +130,6 @@ class RouterListener implements EventSubscriberInterface
|
||||
unset($parameters['_route'], $parameters['_controller']);
|
||||
$request->attributes->set('_route_params', $parameters);
|
||||
} catch (ResourceNotFoundException $e) {
|
||||
if ($this->debug && $e instanceof NoConfigurationException) {
|
||||
$event->setResponse($this->createWelcomeResponse());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$message = sprintf('No route found for "%s %s"', $request->getMethod(), $request->getPathInfo());
|
||||
|
||||
if ($referer = $request->headers->get('referer')) {
|
||||
@@ -149,11 +144,23 @@ class RouterListener implements EventSubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function onKernelException(GetResponseForExceptionEvent $event)
|
||||
{
|
||||
if (!$this->debug || !($e = $event->getException()) instanceof NotFoundHttpException) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($e->getPrevious() instanceof NoConfigurationException) {
|
||||
$event->setResponse($this->createWelcomeResponse());
|
||||
}
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return array(
|
||||
KernelEvents::REQUEST => array(array('onKernelRequest', 32)),
|
||||
KernelEvents::FINISH_REQUEST => array(array('onKernelFinishRequest', 0)),
|
||||
KernelEvents::EXCEPTION => array('onKernelException', -64),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface
|
||||
$response->setLastModified(null);
|
||||
}
|
||||
|
||||
if (!$response->isFresh()) {
|
||||
if (!$response->isFresh() || !$response->isCacheable()) {
|
||||
$this->cacheable = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -387,16 +387,22 @@ class Store implements StoreInterface
|
||||
|
||||
$tmpFile = tempnam(dirname($path), basename($path));
|
||||
if (false === $fp = @fopen($tmpFile, 'wb')) {
|
||||
@unlink($tmpFile);
|
||||
|
||||
return false;
|
||||
}
|
||||
@fwrite($fp, $data);
|
||||
@fclose($fp);
|
||||
|
||||
if ($data != file_get_contents($tmpFile)) {
|
||||
@unlink($tmpFile);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (false === @rename($tmpFile, $path)) {
|
||||
@unlink($tmpFile);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
28
vendor/symfony/http-kernel/Kernel.php
vendored
28
vendor/symfony/http-kernel/Kernel.php
vendored
@@ -22,6 +22,7 @@ use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\DirectoryLoader;
|
||||
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
@@ -32,7 +33,6 @@ use Symfony\Component\HttpKernel\Config\EnvParametersResource;
|
||||
use Symfony\Component\HttpKernel\Config\FileLocator;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\AddAnnotatedClassesToCachePass;
|
||||
use Symfony\Component\Config\Loader\GlobFileLoader;
|
||||
use Symfony\Component\Config\Loader\LoaderResolver;
|
||||
use Symfony\Component\Config\Loader\DelegatingLoader;
|
||||
use Symfony\Component\Config\ConfigCache;
|
||||
@@ -67,11 +67,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
private $requestStackSize = 0;
|
||||
private $resetServices = false;
|
||||
|
||||
const VERSION = '3.4.4';
|
||||
const VERSION_ID = 30404;
|
||||
const VERSION = '3.4.11';
|
||||
const VERSION_ID = 30411;
|
||||
const MAJOR_VERSION = 3;
|
||||
const MINOR_VERSION = 4;
|
||||
const RELEASE_VERSION = 4;
|
||||
const RELEASE_VERSION = 11;
|
||||
const EXTRA_VERSION = '';
|
||||
|
||||
const END_OF_MAINTENANCE = '11/2020';
|
||||
@@ -587,7 +587,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
$errorLevel = error_reporting(\E_ALL ^ \E_WARNING);
|
||||
$fresh = $oldContainer = false;
|
||||
try {
|
||||
if (\is_object($this->container = include $cache->getPath())) {
|
||||
if (file_exists($cache->getPath()) && \is_object($this->container = include $cache->getPath())) {
|
||||
$this->container->set('kernel', $this);
|
||||
$oldContainer = $this->container;
|
||||
$fresh = true;
|
||||
@@ -650,7 +650,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $oldContainer) {
|
||||
if (null === $oldContainer && file_exists($cache->getPath())) {
|
||||
$errorLevel = error_reporting(\E_ALL ^ \E_WARNING);
|
||||
try {
|
||||
$oldContainer = include $cache->getPath();
|
||||
@@ -670,9 +670,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
// Because concurrent requests might still be using them,
|
||||
// old container files are not removed immediately,
|
||||
// but on a next dump of the container.
|
||||
static $legacyContainers = array();
|
||||
$oldContainerDir = dirname($oldContainer->getFileName());
|
||||
foreach (glob(dirname($oldContainerDir).'/*.legacy') as $legacyContainer) {
|
||||
if ($oldContainerDir.'.legacy' !== $legacyContainer && @unlink($legacyContainer)) {
|
||||
$legacyContainers[$oldContainerDir.'.legacy'] = true;
|
||||
foreach (glob(dirname($oldContainerDir).DIRECTORY_SEPARATOR.'*.legacy') as $legacyContainer) {
|
||||
if (!isset($legacyContainers[$legacyContainer]) && @unlink($legacyContainer)) {
|
||||
(new Filesystem())->remove(substr($legacyContainer, 0, -7));
|
||||
}
|
||||
}
|
||||
@@ -790,7 +792,6 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
foreach ($this->bundles as $bundle) {
|
||||
if ($extension = $bundle->getContainerExtension()) {
|
||||
$container->registerExtension($extension);
|
||||
$extensions[] = $extension->getAlias();
|
||||
}
|
||||
|
||||
if ($this->debug) {
|
||||
@@ -804,6 +805,10 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
|
||||
$this->build($container);
|
||||
|
||||
foreach ($container->getExtensions() as $extension) {
|
||||
$extensions[] = $extension->getAlias();
|
||||
}
|
||||
|
||||
// ensure these extensions are implicitly loaded
|
||||
$container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));
|
||||
}
|
||||
@@ -842,7 +847,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
$dumper = new PhpDumper($container);
|
||||
|
||||
if (class_exists('ProxyManager\Configuration') && class_exists('Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper')) {
|
||||
$dumper->setProxyDumper(new ProxyDumper(substr(hash('sha256', $cache->getPath()), 0, 7)));
|
||||
$dumper->setProxyDumper(new ProxyDumper());
|
||||
}
|
||||
|
||||
$content = $dumper->dump(array(
|
||||
@@ -852,6 +857,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
'as_files' => true,
|
||||
'debug' => $this->debug,
|
||||
'inline_class_loader_parameter' => \PHP_VERSION_ID >= 70000 && !$this->loadClassCache && !class_exists(ClassCollectionLoader::class, false) ? 'container.dumper.inline_class_loader' : null,
|
||||
'build_time' => $container->hasParameter('kernel.container_build_time') ? $container->getParameter('kernel.container_build_time') : time(),
|
||||
));
|
||||
|
||||
$rootCode = array_pop($content);
|
||||
@@ -880,7 +886,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
new YamlFileLoader($container, $locator),
|
||||
new IniFileLoader($container, $locator),
|
||||
new PhpFileLoader($container, $locator),
|
||||
new GlobFileLoader($locator),
|
||||
new GlobFileLoader($container, $locator),
|
||||
new DirectoryLoader($container, $locator),
|
||||
new ClosureLoader($container),
|
||||
));
|
||||
|
||||
@@ -27,7 +27,7 @@ interface KernelInterface extends HttpKernelInterface, \Serializable
|
||||
/**
|
||||
* Returns an array of bundles to register.
|
||||
*
|
||||
* @return BundleInterface[] An array of bundle instances
|
||||
* @return iterable|BundleInterface[] An iterable of bundle instances
|
||||
*/
|
||||
public function registerBundles();
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class Profiler
|
||||
private $enabled = true;
|
||||
|
||||
/**
|
||||
* @param bool $enable The initial enabled state
|
||||
* @param bool $enable The initial enabled state
|
||||
*/
|
||||
public function __construct(ProfilerStorageInterface $storage, LoggerInterface $logger = null, $enable = true)
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
<div id="comment">
|
||||
<p>
|
||||
You're seeing this message because you have debug mode enabled and you haven't configured any URLs.
|
||||
You're seeing this page because debug mode is enabled and you haven't configured any homepage URL.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
28
vendor/symfony/http-kernel/Tests/ClientTest.php
vendored
28
vendor/symfony/http-kernel/Tests/ClientTest.php
vendored
@@ -60,22 +60,17 @@ class ClientTest extends TestCase
|
||||
$m = $r->getMethod('filterResponse');
|
||||
$m->setAccessible(true);
|
||||
|
||||
$expected = array(
|
||||
'foo=bar; expires=Sun, 15-Feb-2009 20:00:00 GMT; max-age='.(strtotime('Sun, 15-Feb-2009 20:00:00 GMT') - time()).'; path=/foo; domain=http://example.com; secure; httponly',
|
||||
'foo1=bar1; expires=Sun, 15-Feb-2009 20:00:00 GMT; max-age='.(strtotime('Sun, 15-Feb-2009 20:00:00 GMT') - time()).'; path=/foo; domain=http://example.com; secure; httponly',
|
||||
);
|
||||
$response = new Response();
|
||||
$response->headers->setCookie($cookie1 = new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
|
||||
$domResponse = $m->invoke($client, $response);
|
||||
$this->assertSame((string) $cookie1, $domResponse->getHeader('Set-Cookie'));
|
||||
|
||||
$response = new Response();
|
||||
$response->headers->setCookie(new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
|
||||
$response->headers->setCookie($cookie1 = new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
|
||||
$response->headers->setCookie($cookie2 = new Cookie('foo1', 'bar1', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
|
||||
$domResponse = $m->invoke($client, $response);
|
||||
$this->assertEquals($expected[0], $domResponse->getHeader('Set-Cookie'));
|
||||
|
||||
$response = new Response();
|
||||
$response->headers->setCookie(new Cookie('foo', 'bar', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
|
||||
$response->headers->setCookie(new Cookie('foo1', 'bar1', \DateTime::createFromFormat('j-M-Y H:i:s T', '15-Feb-2009 20:00:00 GMT')->format('U'), '/foo', 'http://example.com', true, true));
|
||||
$domResponse = $m->invoke($client, $response);
|
||||
$this->assertEquals($expected[0], $domResponse->getHeader('Set-Cookie'));
|
||||
$this->assertEquals($expected, $domResponse->getHeader('Set-Cookie', false));
|
||||
$this->assertSame((string) $cookie1, $domResponse->getHeader('Set-Cookie'));
|
||||
$this->assertSame(array((string) $cookie1, (string) $cookie2), $domResponse->getHeader('Set-Cookie', false));
|
||||
}
|
||||
|
||||
public function testFilterResponseSupportsStreamedResponses()
|
||||
@@ -97,6 +92,7 @@ class ClientTest extends TestCase
|
||||
public function testUploadedFile()
|
||||
{
|
||||
$source = tempnam(sys_get_temp_dir(), 'source');
|
||||
file_put_contents($source, '1');
|
||||
$target = sys_get_temp_dir().'/sf.moved.file';
|
||||
@unlink($target);
|
||||
|
||||
@@ -104,8 +100,8 @@ class ClientTest extends TestCase
|
||||
$client = new Client($kernel);
|
||||
|
||||
$files = array(
|
||||
array('tmp_name' => $source, 'name' => 'original', 'type' => 'mime/original', 'size' => 123, 'error' => UPLOAD_ERR_OK),
|
||||
new UploadedFile($source, 'original', 'mime/original', 123, UPLOAD_ERR_OK, true),
|
||||
array('tmp_name' => $source, 'name' => 'original', 'type' => 'mime/original', 'size' => 1, 'error' => UPLOAD_ERR_OK),
|
||||
new UploadedFile($source, 'original', 'mime/original', 1, UPLOAD_ERR_OK, true),
|
||||
);
|
||||
|
||||
$file = null;
|
||||
@@ -120,7 +116,7 @@ class ClientTest extends TestCase
|
||||
|
||||
$this->assertEquals('original', $file->getClientOriginalName());
|
||||
$this->assertEquals('mime/original', $file->getClientMimeType());
|
||||
$this->assertEquals('123', $file->getClientSize());
|
||||
$this->assertSame(1, $file->getClientSize());
|
||||
$this->assertTrue($file->isValid());
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,25 @@ class ServiceValueResolverTest extends TestCase
|
||||
$this->assertYieldEquals(array(new DummyService()), $resolver->resolve($request, $argument));
|
||||
}
|
||||
|
||||
public function testExistingControllerWithATrailingBackSlash()
|
||||
{
|
||||
$resolver = new ServiceValueResolver(new ServiceLocator(array(
|
||||
'App\\Controller\\Mine::method' => function () {
|
||||
return new ServiceLocator(array(
|
||||
'dummy' => function () {
|
||||
return new DummyService();
|
||||
},
|
||||
));
|
||||
},
|
||||
)));
|
||||
|
||||
$request = $this->requestWithAttributes(array('_controller' => '\\App\\Controller\\Mine::method'));
|
||||
$argument = new ArgumentMetadata('dummy', DummyService::class, false, false, null);
|
||||
|
||||
$this->assertTrue($resolver->supports($request, $argument));
|
||||
$this->assertYieldEquals(array(new DummyService()), $resolver->resolve($request, $argument));
|
||||
}
|
||||
|
||||
public function testControllerNameIsAnArray()
|
||||
{
|
||||
$resolver = new ServiceValueResolver(new ServiceLocator(array(
|
||||
|
||||
@@ -126,11 +126,11 @@ class ArgumentMetadataFactoryTest extends TestCase
|
||||
), $arguments);
|
||||
}
|
||||
|
||||
private function signature1(ArgumentMetadataFactoryTest $foo, array $bar, callable $baz)
|
||||
private function signature1(self $foo, array $bar, callable $baz)
|
||||
{
|
||||
}
|
||||
|
||||
private function signature2(ArgumentMetadataFactoryTest $foo = null, FakeClassThatDoesNotExist $bar = null, ImportedAndFake $baz = null)
|
||||
private function signature2(self $foo = null, FakeClassThatDoesNotExist $bar = null, ImportedAndFake $baz = null)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
@@ -66,7 +67,7 @@ class DumpDataCollectorTest extends TestCase
|
||||
|
||||
ob_start();
|
||||
$collector->collect(new Request(), new Response());
|
||||
$output = ob_get_clean();
|
||||
$output = preg_replace("/\033\[[^m]*m/", '', ob_get_clean());
|
||||
|
||||
$this->assertSame("DumpDataCollectorTest.php on line {$line}:\n123\n", $output);
|
||||
$this->assertSame(1, $collector->getDumpsCount());
|
||||
@@ -110,6 +111,28 @@ EOTXT;
|
||||
|
||||
ob_start();
|
||||
$collector->__destruct();
|
||||
$this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", ob_get_clean());
|
||||
$output = preg_replace("/\033\[[^m]*m/", '', ob_get_clean());
|
||||
$this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", $output);
|
||||
}
|
||||
|
||||
public function testFlushNothingWhenDataDumperIsProvided()
|
||||
{
|
||||
$data = new Data(array(array(456)));
|
||||
$dumper = new CliDumper('php://output');
|
||||
$collector = new DumpDataCollector(null, null, null, null, $dumper);
|
||||
|
||||
ob_start();
|
||||
$collector->dump($data);
|
||||
$line = __LINE__ - 1;
|
||||
$output = preg_replace("/\033\[[^m]*m/", '', ob_get_clean());
|
||||
if (\PHP_VERSION_ID >= 50400) {
|
||||
$this->assertSame("DumpDataCollectorTest.php on line {$line}:\n456\n", $output);
|
||||
} else {
|
||||
$this->assertSame("\"DumpDataCollectorTest.php on line {$line}:\"\n456\n", $output);
|
||||
}
|
||||
|
||||
ob_start();
|
||||
$collector->__destruct();
|
||||
$this->assertEmpty(ob_get_clean());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,10 @@
|
||||
namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\Definition;
|
||||
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Symfony\Component\DependencyInjection\ServiceLocator;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\FragmentRendererPass;
|
||||
use Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface;
|
||||
@@ -22,73 +24,37 @@ class FragmentRendererPassTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Tests that content rendering not implementing FragmentRendererInterface
|
||||
* trigger an exception.
|
||||
* triggers an exception.
|
||||
*
|
||||
* @expectedException \InvalidArgumentException
|
||||
*/
|
||||
public function testContentRendererWithoutInterface()
|
||||
{
|
||||
// one service, not implementing any interface
|
||||
$services = array(
|
||||
'my_content_renderer' => array(array('alias' => 'foo')),
|
||||
);
|
||||
|
||||
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
|
||||
|
||||
$builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
|
||||
$builder->expects($this->any())
|
||||
->method('hasDefinition')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
// We don't test kernel.fragment_renderer here
|
||||
$builder->expects($this->atLeastOnce())
|
||||
->method('findTaggedServiceIds')
|
||||
->will($this->returnValue($services));
|
||||
|
||||
$builder->expects($this->atLeastOnce())
|
||||
->method('getDefinition')
|
||||
->will($this->returnValue($definition));
|
||||
$builder = new ContainerBuilder();
|
||||
$fragmentHandlerDefinition = $builder->register('fragment.handler');
|
||||
$builder->register('my_content_renderer', 'Symfony\Component\DependencyInjection\Definition')
|
||||
->addTag('kernel.fragment_renderer', array('alias' => 'foo'));
|
||||
|
||||
$pass = new FragmentRendererPass();
|
||||
$pass->process($builder);
|
||||
|
||||
$this->assertEquals(array(array('addRendererService', array('foo', 'my_content_renderer'))), $fragmentHandlerDefinition->getMethodCalls());
|
||||
}
|
||||
|
||||
public function testValidContentRenderer()
|
||||
{
|
||||
$services = array(
|
||||
'my_content_renderer' => array(array('alias' => 'foo')),
|
||||
);
|
||||
|
||||
$renderer = new Definition('', array(null));
|
||||
|
||||
$definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
|
||||
$definition->expects($this->atLeastOnce())
|
||||
->method('getClass')
|
||||
->will($this->returnValue('Symfony\Component\HttpKernel\Tests\DependencyInjection\RendererService'));
|
||||
|
||||
$builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition', 'getReflectionClass'))->getMock();
|
||||
$builder->expects($this->any())
|
||||
->method('hasDefinition')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
// We don't test kernel.fragment_renderer here
|
||||
$builder->expects($this->atLeastOnce())
|
||||
->method('findTaggedServiceIds')
|
||||
->will($this->returnValue($services));
|
||||
|
||||
$builder->expects($this->atLeastOnce())
|
||||
->method('getDefinition')
|
||||
->will($this->onConsecutiveCalls($renderer, $definition));
|
||||
|
||||
$builder->expects($this->atLeastOnce())
|
||||
->method('getReflectionClass')
|
||||
->with('Symfony\Component\HttpKernel\Tests\DependencyInjection\RendererService')
|
||||
->will($this->returnValue(new \ReflectionClass('Symfony\Component\HttpKernel\Tests\DependencyInjection\RendererService')));
|
||||
$builder = new ContainerBuilder();
|
||||
$fragmentHandlerDefinition = $builder->register('fragment.handler')
|
||||
->addArgument(null);
|
||||
$builder->register('my_content_renderer', 'Symfony\Component\HttpKernel\Tests\DependencyInjection\RendererService')
|
||||
->addTag('kernel.fragment_renderer', array('alias' => 'foo'));
|
||||
|
||||
$pass = new FragmentRendererPass();
|
||||
$pass->process($builder);
|
||||
|
||||
$this->assertInstanceOf(Reference::class, $renderer->getArgument(0));
|
||||
$serviceLocatorDefinition = $builder->getDefinition((string) $fragmentHandlerDefinition->getArgument(0));
|
||||
$this->assertSame(ServiceLocator::class, $serviceLocatorDefinition->getClass());
|
||||
$this->assertEquals(array('foo' => new ServiceClosureArgument(new Reference('my_content_renderer'))), $serviceLocatorDefinition->getArgument(0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,44 +12,39 @@
|
||||
namespace Symfony\Component\HttpKernel\Tests\DependencyInjection;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
|
||||
|
||||
class MergeExtensionConfigurationPassTest extends TestCase
|
||||
{
|
||||
public function testAutoloadMainExtension()
|
||||
{
|
||||
$container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerBuilder')->setMethods(array('getExtensionConfig', 'loadFromExtension', 'getParameterBag', 'getDefinitions', 'getAliases', 'getExtensions'))->getMock();
|
||||
$params = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ParameterBag\\ParameterBag')->getMock();
|
||||
$container = new ContainerBuilder();
|
||||
$container->registerExtension(new LoadedExtension());
|
||||
$container->registerExtension(new NotLoadedExtension());
|
||||
$container->loadFromExtension('loaded', array());
|
||||
|
||||
$container->expects($this->at(0))
|
||||
->method('getExtensionConfig')
|
||||
->with('loaded')
|
||||
->will($this->returnValue(array(array())));
|
||||
$container->expects($this->at(1))
|
||||
->method('getExtensionConfig')
|
||||
->with('notloaded')
|
||||
->will($this->returnValue(array()));
|
||||
$container->expects($this->once())
|
||||
->method('loadFromExtension')
|
||||
->with('notloaded', array());
|
||||
|
||||
$container->expects($this->any())
|
||||
->method('getParameterBag')
|
||||
->will($this->returnValue($params));
|
||||
$params->expects($this->any())
|
||||
->method('all')
|
||||
->will($this->returnValue(array()));
|
||||
$container->expects($this->any())
|
||||
->method('getDefinitions')
|
||||
->will($this->returnValue(array()));
|
||||
$container->expects($this->any())
|
||||
->method('getAliases')
|
||||
->will($this->returnValue(array()));
|
||||
$container->expects($this->any())
|
||||
->method('getExtensions')
|
||||
->will($this->returnValue(array()));
|
||||
|
||||
$configPass = new MergeExtensionConfigurationPass(array('loaded', 'notloaded'));
|
||||
$configPass = new MergeExtensionConfigurationPass(array('loaded', 'not_loaded'));
|
||||
$configPass->process($container);
|
||||
|
||||
$this->assertTrue($container->hasDefinition('loaded.foo'));
|
||||
$this->assertTrue($container->hasDefinition('not_loaded.bar'));
|
||||
}
|
||||
}
|
||||
|
||||
class LoadedExtension extends Extension
|
||||
{
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$container->register('loaded.foo');
|
||||
}
|
||||
}
|
||||
|
||||
class NotLoadedExtension extends Extension
|
||||
{
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$container->register('not_loaded.bar');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +151,23 @@ class ExceptionListenerTest extends TestCase
|
||||
$this->assertFalse($response->headers->has('content-security-policy'), 'CSP header has been removed');
|
||||
$this->assertFalse($dispatcher->hasListeners(KernelEvents::RESPONSE), 'CSP removal listener has been removed');
|
||||
}
|
||||
|
||||
public function testNullController()
|
||||
{
|
||||
$listener = new ExceptionListener(null);
|
||||
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
|
||||
$kernel->expects($this->once())->method('handle')->will($this->returnCallback(function (Request $request) {
|
||||
$controller = $request->attributes->get('_controller');
|
||||
|
||||
return $controller();
|
||||
}));
|
||||
$request = Request::create('/');
|
||||
$event = new GetResponseForExceptionEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST, new \Exception('foo'));
|
||||
|
||||
$listener->onKernelException($event);
|
||||
|
||||
$this->assertContains('Whoops, looks like something went wrong.', $event->getResponse()->getContent());
|
||||
}
|
||||
}
|
||||
|
||||
class TestLogger extends Logger implements DebugLoggerInterface
|
||||
|
||||
@@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||
use Symfony\Component\HttpKernel\HttpKernelInterface;
|
||||
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
||||
use Symfony\Component\HttpKernel\EventListener\SessionListener;
|
||||
@@ -44,6 +45,9 @@ class TestSessionListenerTest extends TestCase
|
||||
{
|
||||
$this->listener = $this->getMockForAbstractClass('Symfony\Component\HttpKernel\EventListener\AbstractTestSessionListener');
|
||||
$this->session = $this->getSession();
|
||||
$this->listener->expects($this->any())
|
||||
->method('getSession')
|
||||
->will($this->returnValue($this->session));
|
||||
}
|
||||
|
||||
public function testShouldSaveMasterRequestSession()
|
||||
@@ -86,6 +90,22 @@ class TestSessionListenerTest extends TestCase
|
||||
$this->assertSame(array(), $response->headers->getCookies());
|
||||
}
|
||||
|
||||
public function testEmptySessionWithNewSessionIdDoesSendCookie()
|
||||
{
|
||||
$this->sessionHasBeenStarted();
|
||||
$this->sessionIsEmpty();
|
||||
$this->fixSessionId('456');
|
||||
|
||||
$kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
|
||||
$request = Request::create('/', 'GET', array(), array('MOCKSESSID' => '123'));
|
||||
$event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
|
||||
$this->listener->onKernelRequest($event);
|
||||
|
||||
$response = $this->filterResponse(new Request(), HttpKernelInterface::MASTER_REQUEST);
|
||||
|
||||
$this->assertNotEmpty($response->headers->getCookies());
|
||||
}
|
||||
|
||||
public function testUnstartedSessionIsNotSave()
|
||||
{
|
||||
$this->sessionHasNotBeenStarted();
|
||||
@@ -150,6 +170,13 @@ class TestSessionListenerTest extends TestCase
|
||||
->will($this->returnValue(true));
|
||||
}
|
||||
|
||||
private function fixSessionId($sessionId)
|
||||
{
|
||||
$this->session->expects($this->any())
|
||||
->method('getId')
|
||||
->will($this->returnValue($sessionId));
|
||||
}
|
||||
|
||||
private function getSession()
|
||||
{
|
||||
$mock = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Session')
|
||||
|
||||
@@ -6,21 +6,6 @@ use Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException;
|
||||
|
||||
class UnprocessableEntityHttpExceptionTest extends HttpExceptionTest
|
||||
{
|
||||
/**
|
||||
* Test that setting the headers using the setter function
|
||||
* is working as expected.
|
||||
*
|
||||
* @param array $headers The headers to set
|
||||
*
|
||||
* @dataProvider headerDataProvider
|
||||
*/
|
||||
public function testHeadersSetter($headers)
|
||||
{
|
||||
$exception = new UnprocessableEntityHttpException(10);
|
||||
$exception->setHeaders($headers);
|
||||
$this->assertSame($headers, $exception->getHeaders());
|
||||
}
|
||||
|
||||
protected function createException()
|
||||
{
|
||||
return new UnprocessableEntityHttpException();
|
||||
|
||||
@@ -6,17 +6,7 @@ use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
|
||||
|
||||
class UnsupportedMediaTypeHttpExceptionTest extends HttpExceptionTest
|
||||
{
|
||||
/**
|
||||
* @dataProvider headerDataProvider
|
||||
*/
|
||||
public function testHeadersSetter($headers)
|
||||
{
|
||||
$exception = new UnsupportedMediaTypeHttpException(10);
|
||||
$exception->setHeaders($headers);
|
||||
$this->assertSame($headers, $exception->getHeaders());
|
||||
}
|
||||
|
||||
protected function createException($headers = array())
|
||||
protected function createException()
|
||||
{
|
||||
return new UnsupportedMediaTypeHttpException();
|
||||
}
|
||||
|
||||
@@ -175,8 +175,26 @@ class ResponseCacheStrategyTest extends TestCase
|
||||
$cacheStrategy->update($masterResponse);
|
||||
|
||||
$this->assertTrue($masterResponse->headers->hasCacheControlDirective('private'));
|
||||
// Not sure if we should pass "max-age: 60" in this case, as long as the response is private and
|
||||
// that's the more conservative of both the master and embedded response...?
|
||||
$this->assertFalse($masterResponse->headers->hasCacheControlDirective('public'));
|
||||
}
|
||||
|
||||
public function testEmbeddingPublicResponseDoesNotMakeMainResponsePublic()
|
||||
{
|
||||
$cacheStrategy = new ResponseCacheStrategy();
|
||||
|
||||
$masterResponse = new Response();
|
||||
$masterResponse->setPrivate(); // this is the default, but let's be explicit
|
||||
$masterResponse->setMaxAge(100);
|
||||
|
||||
$embeddedResponse = new Response();
|
||||
$embeddedResponse->setPublic();
|
||||
$embeddedResponse->setSharedMaxAge(100);
|
||||
|
||||
$cacheStrategy->add($embeddedResponse);
|
||||
$cacheStrategy->update($masterResponse);
|
||||
|
||||
$this->assertTrue($masterResponse->headers->hasCacheControlDirective('private'));
|
||||
$this->assertFalse($masterResponse->headers->hasCacheControlDirective('public'));
|
||||
}
|
||||
|
||||
public function testResponseIsExiprableWhenEmbeddedResponseCombinesExpiryAndValidation()
|
||||
|
||||
@@ -849,14 +849,14 @@ EOF;
|
||||
$kernel = new CustomProjectDirKernel();
|
||||
$kernel->boot();
|
||||
|
||||
$this->assertSame($containerClass, get_class($kernel->getContainer()));
|
||||
$this->assertInstanceOf($containerClass, $kernel->getContainer());
|
||||
$this->assertFileExists($containerFile);
|
||||
unlink(__DIR__.'/Fixtures/cache/custom/FixturesCustomDebugProjectContainer.php.meta');
|
||||
|
||||
$kernel = new CustomProjectDirKernel(function ($container) { $container->register('foo', 'stdClass')->setPublic(true); });
|
||||
$kernel->boot();
|
||||
|
||||
$this->assertTrue(get_class($kernel->getContainer()) !== $containerClass);
|
||||
$this->assertNotInstanceOf($containerClass, $kernel->getContainer());
|
||||
$this->assertFileExists($containerFile);
|
||||
$this->assertFileExists(dirname($containerFile).'.legacy');
|
||||
}
|
||||
|
||||
@@ -83,22 +83,22 @@ class FileProfilerStorageTest extends TestCase
|
||||
$profile = new Profile('simple_quote');
|
||||
$profile->setUrl('http://foo.bar/\'');
|
||||
$this->storage->write($profile);
|
||||
$this->assertTrue(false !== $this->storage->read('simple_quote'), '->write() accepts single quotes in URL');
|
||||
$this->assertNotFalse($this->storage->read('simple_quote'), '->write() accepts single quotes in URL');
|
||||
|
||||
$profile = new Profile('double_quote');
|
||||
$profile->setUrl('http://foo.bar/"');
|
||||
$this->storage->write($profile);
|
||||
$this->assertTrue(false !== $this->storage->read('double_quote'), '->write() accepts double quotes in URL');
|
||||
$this->assertNotFalse($this->storage->read('double_quote'), '->write() accepts double quotes in URL');
|
||||
|
||||
$profile = new Profile('backslash');
|
||||
$profile->setUrl('http://foo.bar/\\');
|
||||
$this->storage->write($profile);
|
||||
$this->assertTrue(false !== $this->storage->read('backslash'), '->write() accepts backslash in URL');
|
||||
$this->assertNotFalse($this->storage->read('backslash'), '->write() accepts backslash in URL');
|
||||
|
||||
$profile = new Profile('comma');
|
||||
$profile->setUrl('http://foo.bar/,');
|
||||
$this->storage->write($profile);
|
||||
$this->assertTrue(false !== $this->storage->read('comma'), '->write() accepts comma in URL');
|
||||
$this->assertNotFalse($this->storage->read('comma'), '->write() accepts comma in URL');
|
||||
}
|
||||
|
||||
public function testStoreDuplicateToken()
|
||||
@@ -247,7 +247,7 @@ class FileProfilerStorageTest extends TestCase
|
||||
$profile->setMethod('GET');
|
||||
$this->storage->write($profile);
|
||||
|
||||
$this->assertTrue(false !== $this->storage->read('token1'));
|
||||
$this->assertNotFalse($this->storage->read('token1'));
|
||||
$this->assertCount(1, $this->storage->find('127.0.0.1', '', 10, 'GET'));
|
||||
|
||||
$profile = new Profile('token2');
|
||||
@@ -256,7 +256,7 @@ class FileProfilerStorageTest extends TestCase
|
||||
$profile->setMethod('GET');
|
||||
$this->storage->write($profile);
|
||||
|
||||
$this->assertTrue(false !== $this->storage->read('token2'));
|
||||
$this->assertNotFalse($this->storage->read('token2'));
|
||||
$this->assertCount(2, $this->storage->find('127.0.0.1', '', 10, 'GET'));
|
||||
|
||||
$this->storage->purge();
|
||||
|
||||
@@ -44,7 +44,7 @@ class ProfilerTest extends TestCase
|
||||
public function testReset()
|
||||
{
|
||||
$collector = $this->getMockBuilder(DataCollectorInterface::class)
|
||||
->setMethods(['collect', 'getName', 'reset'])
|
||||
->setMethods(array('collect', 'getName', 'reset'))
|
||||
->getMock();
|
||||
$collector->expects($this->any())->method('getName')->willReturn('mock');
|
||||
$collector->expects($this->once())->method('reset');
|
||||
|
||||
5
vendor/symfony/http-kernel/composer.json
vendored
5
vendor/symfony/http-kernel/composer.json
vendored
@@ -20,6 +20,7 @@
|
||||
"symfony/event-dispatcher": "~2.8|~3.0|~4.0",
|
||||
"symfony/http-foundation": "^3.4.4|^4.0.4",
|
||||
"symfony/debug": "~2.8|~3.0|~4.0",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
@@ -28,7 +29,7 @@
|
||||
"symfony/config": "~2.8|~3.0|~4.0",
|
||||
"symfony/console": "~2.8|~3.0|~4.0",
|
||||
"symfony/css-selector": "~2.8|~3.0|~4.0",
|
||||
"symfony/dependency-injection": "~3.4|~4.0",
|
||||
"symfony/dependency-injection": "^3.4.5|^4.0.5",
|
||||
"symfony/dom-crawler": "~2.8|~3.0|~4.0",
|
||||
"symfony/expression-language": "~2.8|~3.0|~4.0",
|
||||
"symfony/finder": "~2.8|~3.0|~4.0",
|
||||
@@ -45,7 +46,7 @@
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<2.8",
|
||||
"symfony/dependency-injection": "<3.4",
|
||||
"symfony/dependency-injection": "<3.4.5|<4.0.5,>=4",
|
||||
"symfony/var-dumper": "<3.3",
|
||||
"twig/twig": "<1.34|<2.4,>=2"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user