summaryrefslogtreecommitdiff
path: root/tests/Unit/Renderer
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-12 14:41:23 +0100
committermsquare <msquare@notrademark.de>2018-12-02 12:53:31 +0100
commitc33940f64a1e5b59afd700010247382f5b7b2df3 (patch)
tree453b8810c90cd78e75a1425a4f4f002e585d121a /tests/Unit/Renderer
parent951828a4f1175f99666a48629ea125640cc7c598 (diff)
Moved permission checks to Authenticator class
Diffstat (limited to 'tests/Unit/Renderer')
-rw-r--r--tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php21
1 files changed, 1 insertions, 20 deletions
diff --git a/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php b/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php
index b67d4eed..266b038e 100644
--- a/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php
+++ b/tests/Unit/Renderer/Twig/Extensions/AuthenticationTest.php
@@ -23,7 +23,7 @@ class AuthenticationTest extends ExtensionTest
$this->assertExtensionExists('is_user', [$extension, 'isAuthenticated'], $functions);
$this->assertExtensionExists('is_guest', [$extension, 'isGuest'], $functions);
- $this->assertExtensionExists('has_permission_to', [$extension, 'checkAuth'], $functions);
+ $this->assertExtensionExists('has_permission_to', [$auth, 'can'], $functions);
}
/**
@@ -53,23 +53,4 @@ class AuthenticationTest extends ExtensionTest
$this->assertTrue($extension->isAuthenticated());
$this->assertFalse($extension->isGuest());
}
-
- /**
- * @covers \Engelsystem\Renderer\Twig\Extensions\Authentication::checkAuth
- */
- public function testCheckAuth()
- {
- global $privileges;
- $privileges = [];
-
- /** @var Authenticator|MockObject $auth */
- $auth = $this->createMock(Authenticator::class);
-
- $extension = new Authentication($auth);
-
- $this->assertFalse($extension->checkAuth('foo.bar'));
-
- $privileges = ['foo.bar'];
- $this->assertTrue($extension->checkAuth('foo.bar'));
- }
}