Skip to content
This repository has been archived by the owner on Mar 28, 2022. It is now read-only.

Commit

Permalink
Fix config provider
Browse files Browse the repository at this point in the history
  • Loading branch information
DASPRiD committed Apr 6, 2017
1 parent 1f5b05a commit 9b8406f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
10 changes: 6 additions & 4 deletions src/ConfigProvider.php
Expand Up @@ -18,10 +18,12 @@ public function __invoke() : array
{
return [
'dependencies' => [
JwtAdapterInterface::class => LcobucciAdapterFactory::class,
CsrfTokenManagerInterface::class => JwtCsrfTokenManagerFactory::class,
CookieSettings::class => CookieSettingsFactory::class,
CsrfGuardMiddleware::class => CsrfGuardMiddlewareFactory::class,
'factories' => [
JwtAdapterInterface::class => LcobucciAdapterFactory::class,
CsrfTokenManagerInterface::class => JwtCsrfTokenManagerFactory::class,
CookieSettings::class => CookieSettingsFactory::class,
CsrfGuardMiddleware::class => CsrfGuardMiddlewareFactory::class,
],
],
];
}
Expand Down
19 changes: 11 additions & 8 deletions test/ConfigProviderTest.php
Expand Up @@ -20,16 +20,19 @@ public function testInvoke()
$this->assertArrayHasKey('dependencies', $config);
$dependencies = $config['dependencies'];

$this->assertArrayHasKey(JwtAdapterInterface::class, $dependencies);
$this->assertTrue(class_exists($dependencies[JwtAdapterInterface::class]));
$this->assertArrayHasKey('factories', $dependencies);
$factories = $dependencies['factories'];

$this->assertArrayHasKey(CsrfTokenManagerInterface::class, $dependencies);
$this->assertTrue(class_exists($dependencies[CsrfTokenManagerInterface::class]));
$this->assertArrayHasKey(JwtAdapterInterface::class, $factories);
$this->assertTrue(class_exists($factories[JwtAdapterInterface::class]));

$this->assertArrayHasKey(CookieSettings::class, $dependencies);
$this->assertTrue(class_exists($dependencies[CookieSettings::class]));
$this->assertArrayHasKey(CsrfTokenManagerInterface::class, $factories);
$this->assertTrue(class_exists($factories[CsrfTokenManagerInterface::class]));

$this->assertArrayHasKey(CsrfGuardMiddleware::class, $dependencies);
$this->assertTrue(class_exists($dependencies[CsrfGuardMiddleware::class]));
$this->assertArrayHasKey(CookieSettings::class, $factories);
$this->assertTrue(class_exists($factories[CookieSettings::class]));

$this->assertArrayHasKey(CsrfGuardMiddleware::class, $factories);
$this->assertTrue(class_exists($factories[CsrfGuardMiddleware::class]));
}
}

0 comments on commit 9b8406f

Please sign in to comment.