Merge branch '3.4' into 4.4

* 3.4:
  [Config] dont catch instances of Error
This commit is contained in:
Nicolas Grekas 2020-02-03 09:21:21 +01:00
commit a9b5fd23ef
5 changed files with 18 additions and 6 deletions

View File

@ -94,6 +94,8 @@ class ClassExistenceResource implements SelfCheckingResourceInterface
} }
} catch (\Throwable $e) { } catch (\Throwable $e) {
$exists[1] = $e->getMessage(); $exists[1] = $e->getMessage();
throw $e;
} finally { } finally {
self::$autoloadedClass = $autoloadedClass; self::$autoloadedClass = $autoloadedClass;
if (!--self::$autoloadLevel) { if (!--self::$autoloadLevel) {

View File

@ -0,0 +1,7 @@
<?php
namespace Symfony\Component\Config\Tests\Fixtures;
class ParseError
{
// missing closing bracket

View File

@ -15,6 +15,7 @@ use PHPUnit\Framework\TestCase;
use Symfony\Component\Config\Resource\ClassExistenceResource; use Symfony\Component\Config\Resource\ClassExistenceResource;
use Symfony\Component\Config\Tests\Fixtures\BadFileName; use Symfony\Component\Config\Tests\Fixtures\BadFileName;
use Symfony\Component\Config\Tests\Fixtures\BadParent; use Symfony\Component\Config\Tests\Fixtures\BadParent;
use Symfony\Component\Config\Tests\Fixtures\ParseError;
use Symfony\Component\Config\Tests\Fixtures\Resource\ConditionalClass; use Symfony\Component\Config\Tests\Fixtures\Resource\ConditionalClass;
class ClassExistenceResourceTest extends TestCase class ClassExistenceResourceTest extends TestCase
@ -115,4 +116,12 @@ EOF
$this->assertFalse($res->isFresh(0)); $this->assertFalse($res->isFresh(0));
} }
public function testParseError()
{
$this->expectException('ParseError');
$res = new ClassExistenceResource(ParseError::class, false);
$res->isFresh(0);
}
} }

View File

@ -13,9 +13,6 @@ namespace Symfony\Component\HttpFoundation\Tests;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/**
* @requires PHP 7.0
*/
class ResponseFunctionalTest extends TestCase class ResponseFunctionalTest extends TestCase
{ {
private static $server; private static $server;

View File

@ -59,9 +59,6 @@ class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest
$this->loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/VariadicClass.php'); $this->loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/VariadicClass.php');
} }
/**
* @requires PHP 7.0
*/
public function testLoadAnonymousClass() public function testLoadAnonymousClass()
{ {
$this->reader->expects($this->never())->method('getClassAnnotation'); $this->reader->expects($this->never())->method('getClassAnnotation');