Skip to content
This repository was archived by the owner on May 19, 2022. It is now read-only.

Commit c797b8c

Browse files
committed
Fixed helper
1 parent 4ff54e3 commit c797b8c

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use mako\application\Application;
88
use mako\config\Config;
99
use mako\gatekeeper\adapters\AdapterInterface;
10-
use mako\gatekeeper\Authentication;
10+
use mako\gatekeeper\Gatekeeper;
1111
use mako\http\Request;
1212
use mako\http\routing\URLBuilder;
1313
use mako\i18n\I18n;
@@ -281,7 +281,7 @@ function gatekeeper(string $adapterName = null): AdapterInterface
281281

282282
if($gatekeeper === null)
283283
{
284-
$gatekeeper = Application::instance()->getContainer()->get(Authentication::class);
284+
$gatekeeper = Application::instance()->getContainer()->get(Gatekeeper::class);
285285
}
286286

287287
return $gatekeeper->adapter($adapterName);

tests/unit/HelpersTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,11 @@ public function testGatekeeper(): void
327327

328328
$container = Mockery::mock('alias:mako\syringe\Container');
329329

330-
$authentication = Mockery::mock('alias:mako\gatekeeper\Authentication');
330+
$authentication = Mockery::mock('alias:mako\gatekeeper\Gatekeeper');
331331

332332
$authentication->shouldReceive('adapter')->times(2)->with(null)->andReturn(Mockery::mock('mako\gatekeeper\adapters\AdapterInterface'));
333333

334-
$container->shouldReceive('get')->once()->with('mako\gatekeeper\Authentication')->andReturn($authentication);
334+
$container->shouldReceive('get')->once()->with('mako\gatekeeper\Gatekeeper')->andReturn($authentication);
335335

336336
$mock->shouldReceive('getContainer')->once()->andReturn($container);
337337

@@ -351,15 +351,15 @@ public function testUser(): void
351351

352352
$container = Mockery::mock('alias:mako\syringe\Container');
353353

354-
$authentication = Mockery::mock('alias:mako\gatekeeper\Authentication');
354+
$authentication = Mockery::mock('alias:mako\gatekeeper\Gatekeeper');
355355

356356
$adapter = Mockery::mock('alias:mako\gatekeeper\adapters\AdapterInterface');
357357

358358
$adapter->shouldReceive('getUser')->times(2)->andReturn(null);
359359

360360
$authentication->shouldReceive('adapter')->times(2)->with(null)->andReturn($adapter);
361361

362-
$container->shouldReceive('get')->once()->with('mako\gatekeeper\Authentication')->andReturn($authentication);
362+
$container->shouldReceive('get')->once()->with('mako\gatekeeper\Gatekeeper')->andReturn($authentication);
363363

364364
$mock->shouldReceive('getContainer')->once()->andReturn($container);
365365

0 commit comments

Comments
 (0)