From c33940f64a1e5b59afd700010247382f5b7b2df3 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 12 Nov 2018 14:41:23 +0100 Subject: Moved permission checks to Authenticator class --- .../Renderer/Twig/Extensions/AuthenticationTest.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'tests/Unit/Renderer') 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')); - } } -- cgit v1.2.3-54-g00ecf