Skip to content

Commit 28646c7

Browse files
[Workflow] fix return type declarations
1 parent 5f9aaa7 commit 28646c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/Workflow/Tests/EventListener/GuardListenerTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
99
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
1010
use Symfony\Component\Security\Core\Role\Role;
11+
use Symfony\Component\Security\Core\Role\RoleHierarchy;
12+
use Symfony\Component\Validator\ConstraintViolation;
13+
use Symfony\Component\Validator\ConstraintViolationList;
1114
use Symfony\Component\Validator\Validator\ValidatorInterface;
1215
use Symfony\Component\Workflow\Event\GuardEvent;
1316
use Symfony\Component\Workflow\EventListener\ExpressionLanguage;
@@ -41,7 +44,8 @@ protected function setUp()
4144
$this->authenticationChecker = $this->getMockBuilder(AuthorizationCheckerInterface::class)->getMock();
4245
$trustResolver = $this->getMockBuilder(AuthenticationTrustResolverInterface::class)->getMock();
4346
$this->validator = $this->getMockBuilder(ValidatorInterface::class)->getMock();
44-
$this->listener = new GuardListener($this->configuration, $expressionLanguage, $tokenStorage, $this->authenticationChecker, $trustResolver, null, $this->validator);
47+
$roleHierarchy = new RoleHierarchy([]);
48+
$this->listener = new GuardListener($this->configuration, $expressionLanguage, $tokenStorage, $this->authenticationChecker, $trustResolver, $roleHierarchy, $this->validator);
4549
}
4650

4751
protected function tearDown()
@@ -170,7 +174,7 @@ private function configureValidator($isUsed, $valid = true)
170174
$this->validator
171175
->expects($this->once())
172176
->method('validate')
173-
->willReturn($valid ? [] : ['a violation'])
177+
->willReturn(new ConstraintViolationList($valid ? [] : [new ConstraintViolation('a violation', null, [], '', null, '')]))
174178
;
175179
}
176180
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy