Skip to content

Commit db566d4

Browse files
committed
adapt tests to reflect the split of the request matchers
1 parent 710fe58 commit db566d4

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ public function testRegisterAccessControlWithSpecifiedAttributes()
343343
$call = $accessMap->getMethodCalls()[0];
344344
$this->assertSame('add', $call[0]);
345345
$args = $call[1];
346-
$requestMatcherId = (string) $args[0];
347346

348-
$requestMatcherDefinition = $container->getDefinition($requestMatcherId);
349-
$requestMatcherConstructorArguments = $requestMatcherDefinition->getArguments();
350-
$this->assertArrayHasKey(4, $requestMatcherConstructorArguments);
351-
$attributes = $requestMatcherConstructorArguments[4];
352-
$this->assertArrayHasKey('_route', $attributes);
353-
$this->assertSame('foo_route', $attributes['_route']);
347+
$chainRequestMatcherDefinition = $container->getDefinition((string) $args[0]);
348+
$chainRequestMatcherConstructorArguments = $chainRequestMatcherDefinition->getArguments();
349+
$attributesRequestMatcher = $container->getDefinition((string) $chainRequestMatcherConstructorArguments[0][0]);
350+
351+
$this->assertCount(1, $attributesRequestMatcher->getArguments());
352+
$this->assertArrayHasKey('_route', $attributesRequestMatcher->getArgument(0));
353+
$this->assertSame('foo_route', $attributesRequestMatcher->getArgument(0)['_route']);
354354
}
355355

356356
public function testRegisterAccessControlWithSpecifiedRoute()
@@ -379,14 +379,14 @@ public function testRegisterAccessControlWithSpecifiedRoute()
379379
$call = $accessMap->getMethodCalls()[0];
380380
$this->assertSame('add', $call[0]);
381381
$args = $call[1];
382-
$requestMatcherId = (string) $args[0];
383-
384-
$requestMatcherDefinition = $container->getDefinition($requestMatcherId);
385-
$requestMatcherConstructorArguments = $requestMatcherDefinition->getArguments();
386-
$this->assertArrayHasKey(4, $requestMatcherConstructorArguments);
387-
$attributes = $requestMatcherConstructorArguments[4];
388-
$this->assertArrayHasKey('_route', $attributes);
389-
$this->assertSame('foo_route', $attributes['_route']);
382+
383+
$chainRequestMatcherDefinition = $container->getDefinition((string) $args[0]);
384+
$chainRequestMatcherConstructorArguments = $chainRequestMatcherDefinition->getArguments();
385+
$attributesRequestMatcher = $container->getDefinition((string) $chainRequestMatcherConstructorArguments[0][0]);
386+
387+
$this->assertCount(1, $attributesRequestMatcher->getArguments());
388+
$this->assertArrayHasKey('_route', $attributesRequestMatcher->getArgument(0));
389+
$this->assertSame('foo_route', $attributesRequestMatcher->getArgument(0)['_route']);
390390
}
391391

392392
public function testRegisterAccessControlWithSpecifiedAttributesThrowsException()

0 commit comments

Comments
 (0)