added some more tests (#1835)

This commit is contained in:
Kevin Papst
2020-07-21 15:27:29 +02:00
committed by GitHub
parent aee063bb3c
commit 4b8f743fa6
7 changed files with 175 additions and 5 deletions

View File

@@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\RequestStack;
class SamlAuthFactory extends AbstractMockFactory
{
public function create(?array $connection = null): SamlAuth
public function create(?array $connection = null, bool $fromTrustedProxy = false): SamlAuth
{
if (null === $connection) {
$connection = [
@@ -76,8 +76,11 @@ class SamlAuthFactory extends AbstractMockFactory
];
}
$request = $this->getMockBuilder(Request::class)->getMock();
$request->method('isFromTrustedProxy')->willReturn($fromTrustedProxy);
$requestStack = new RequestStack();
$requestStack->push(new Request());
$requestStack->push($request);
return new SamlAuth($requestStack, $connection);
}