Skip to content

Commit 0a3ca14

Browse files
committed
Merge branch '2.8' into 3.3
* 2.8: [Routing] Fix resource miss [Security] Fixed auth provider authenticate() cannot return void declare argument type streamed response should return $this content can be a resource Adding the Form default theme files to be warmed up in Twig's cache
2 parents c1e5430 + fe24103 commit 0a3ca14

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

RouteCollectionBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,10 @@ public function build()
318318

319319
$routeCollection->addCollection($subCollection);
320320
}
321+
}
321322

322-
foreach ($this->resources as $resource) {
323-
$routeCollection->addResource($resource);
324-
}
323+
foreach ($this->resources as $resource) {
324+
$routeCollection->addResource($resource);
325325
}
326326

327327
return $routeCollection;

Tests/RouteCollectionBuilderTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
namespace Symfony\Component\Routing\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\Config\FileLocator;
1516
use Symfony\Component\Config\Resource\FileResource;
17+
use Symfony\Component\Routing\Loader\YamlFileLoader;
1618
use Symfony\Component\Routing\Route;
1719
use Symfony\Component\Routing\RouteCollection;
1820
use Symfony\Component\Routing\RouteCollectionBuilder;
@@ -59,7 +61,18 @@ public function testImport()
5961
$this->assertCount(1, $addedCollection->getResources());
6062

6163
// make sure the routes were imported into the top-level builder
64+
$routeCollection = $routes->build();
6265
$this->assertCount(1, $routes->build());
66+
$this->assertCount(1, $routeCollection->getResources());
67+
}
68+
69+
public function testImportAddResources()
70+
{
71+
$routeCollectionBuilder = new RouteCollectionBuilder(new YamlFileLoader(new FileLocator(array(__DIR__.'/Fixtures/'))));
72+
$routeCollectionBuilder->import('file_resource.yml');
73+
$routeCollection = $routeCollectionBuilder->build();
74+
75+
$this->assertCount(1, $routeCollection->getResources());
6376
}
6477

6578
/**

0 commit comments

Comments
 (0)