Fixed all phpstan inspections on tests

This commit is contained in:
Alejandro Celaya
2022-10-24 20:11:25 +02:00
parent 1650499a38
commit 85e18a4754
10 changed files with 36 additions and 19 deletions

View File

@@ -38,7 +38,7 @@ class RoleResolverTest extends TestCase
): void {
$this->domainService->expects($this->exactly($expectedDomainCalls))->method('getOrCreate')->with(
'example.com',
)->willReturn(Domain::withAuthority('example.com')->setId('1'));
)->willReturn($this->domainWithId(Domain::withAuthority('example.com')));
$result = $this->resolver->determineRoles($input);
@@ -47,7 +47,7 @@ class RoleResolverTest extends TestCase
public function provideRoles(): iterable
{
$domain = Domain::withAuthority('example.com')->setId('1');
$domain = $this->domainWithId(Domain::withAuthority('example.com'));
$buildInput = function (array $definition): InputInterface {
$input = $this->createStub(InputInterface::class);
$input->method('getOption')->willReturnMap(
@@ -113,4 +113,10 @@ class RoleResolverTest extends TestCase
$this->resolver->determineRoles($input);
}
private function domainWithId(Domain $domain): Domain
{
$domain->setId('1');
return $domain;
}
}