Skip to content

Commit 3cade9d

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: (22 commits) [Routing] Fix resource miss [Security] Fixed auth provider authenticate() cannot return void declare argument type [FrameworkBundle][Serializer] Move normalizer/encoders definitions to xml file & remove unnecessary checks streamed response should return $this $isClientIpsVali is not used content can be a resource Adding the Form default theme files to be warmed up in Twig's cache Remove BC Break label from `NullDumper` class Username and password in basic auth are allowed to contain '.' Remove obsolete PHPDoc from UriSigner [Serializer] YamlEncoder: throw if the Yaml component isn't installed [Serializer] ObjectNormalizer: throw if PropertyAccess isn't installed [PropertyInfo] Add support for the iterable type pdo session fix Fixed pathinfo calculation for requests starting with a question mark. - fix bad conflict resolving issue - port symfony/symfony#21968 to 3.3+ Fixed unsetting from loosely equal keys OrderedHashMap add DOMElement as return type in Crawler::getIterator to support foreach support in ide Fixed mistake in exception expectation [Debug] Fix same vendor detection in class loader ...
2 parents f37405c + 0a3ca14 commit 3cade9d

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)