Allowed guest users to access impressum

This commit is contained in:
Kevin Frantz
2019-01-01 22:36:55 +01:00
parent 3efa57f29a
commit 130682ef6c
3 changed files with 57 additions and 31 deletions

View File

@@ -55,16 +55,16 @@ class SecureSourceLoaderTest extends KernelTestCase
$secureSourceLoader->getSource();
}
// public function testGranted(): void
// {
// $requestedSource = new TextSource();
// $requestedSource->setSlug(SystemSlugType::IMPRINT);
// $requestedRight = new Right();
// $requestedRight->setSource($requestedSource);
// $requestedRight->setLayer(LayerType::SOURCE);
// $requestedRight->setType(RightType::READ);
// $requestedRight->setReciever($this->sourceRepository->findOneBy(['slug' => SystemSlugType::GUEST_USER]));
// $secureSourceLoader = new SecureSourceLoader($this->sourceRepository, $requestedRight);
// $this->assertInstanceOf(TextSourceInterface::class, $secureSourceLoader->getSource());
// }
public function testGranted(): void
{
$requestedSource = new TextSource();
$requestedSource->setSlug(SystemSlugType::IMPRINT);
$requestedRight = new Right();
$requestedRight->setSource($requestedSource);
$requestedRight->setLayer(LayerType::SOURCE);
$requestedRight->setType(RightType::READ);
$requestedRight->setReciever($this->sourceRepository->findOneBy(['slug' => SystemSlugType::GUEST_USER]));
$secureSourceLoader = new SecureSourceLoader($this->sourceRepository, $requestedRight);
$this->assertInstanceOf(TextSourceInterface::class, $secureSourceLoader->getSource());
}
}