Skip to content

Commit

Permalink
Merge branch '3.4' into 4.4
Browse files Browse the repository at this point in the history
* 3.4:
  [Config] dont catch instances of Error
  • Loading branch information
nicolas-grekas committed Feb 3, 2020
2 parents a2d6d11 + 78641e0 commit a9b5fd2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public function isFresh($timestamp)
}
} catch (\Throwable $e) {
$exists[1] = $e->getMessage();

throw $e;
} finally {
self::$autoloadedClass = $autoloadedClass;
if (!--self::$autoloadLevel) {
Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Component/Config/Tests/Fixtures/ParseError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Symfony\Component\Config\Tests\Fixtures;

class ParseError
{
// missing closing bracket
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Symfony\Component\Config\Resource\ClassExistenceResource;
use Symfony\Component\Config\Tests\Fixtures\BadFileName;
use Symfony\Component\Config\Tests\Fixtures\BadParent;
use Symfony\Component\Config\Tests\Fixtures\ParseError;
use Symfony\Component\Config\Tests\Fixtures\Resource\ConditionalClass;

class ClassExistenceResourceTest extends TestCase
Expand Down Expand Up @@ -115,4 +116,12 @@ public function testConditionalClass()

$this->assertFalse($res->isFresh(0));
}

public function testParseError()
{
$this->expectException('ParseError');

$res = new ClassExistenceResource(ParseError::class, false);
$res->isFresh(0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@

use PHPUnit\Framework\TestCase;

/**
* @requires PHP 7.0
*/
class ResponseFunctionalTest extends TestCase
{
private static $server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ public function testLoadVariadic()
$this->loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/VariadicClass.php');
}

/**
* @requires PHP 7.0
*/
public function testLoadAnonymousClass()
{
$this->reader->expects($this->never())->method('getClassAnnotation');
Expand Down

0 comments on commit a9b5fd2

Please sign in to comment.