Skip to content

Commit

Permalink
Merge pull request #22 from SpacePossum/master_remove_deprecated_option
Browse files Browse the repository at this point in the history
remove deprecated option
  • Loading branch information
SpacePossum authored Dec 2, 2016
2 parents 62dccd0 + bdba3cc commit c5ecada
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Caching/MemcachedServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function register(Container $app)
*/
private function getLogger(Container $app, $name)
{
if (!isset($app[$name.'.enable_log']) || !interface_exists('Psr\Log\LoggerInterface')) {
if (!isset($app[$name.'.enable_log']) || true !== $app[$name.'.enable_log'] || !interface_exists('Psr\Log\LoggerInterface')) {
return null;
}

Expand Down
22 changes: 11 additions & 11 deletions tests/Caching/Tests/MemcachedServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,24 @@ public function provideLoggerByConfiguration()
return [
// add logger to $app['logger'] before testing
[true, false, ['memcache.client' => 'mock']],
[true, true, ['memcache.client' => 'mock', 'memcache.enable_log' => false]],
[true, false, ['memcache.client' => 'mock', 'memcache.enable_log' => false]],
[true, true, ['memcache.client' => 'mock', 'memcache.enable_log' => true]],
[true, false, ['test.client' => 'mock', 'test.logger' => new TestLogger()], 'test'],

// do not add logger to $app['logger'] before testing
[false, false, ['memcache.client' => 'mock', 'memcache.logger' => new TestLogger()]],
[
false,
true,
true,
[
'memcache.client' => 'mock',
'memcache.enable_log' => true,
'memcache.logger' => new TestLogger(),
],
],
[
false,
false,
[
'memcache.client' => 'mock',
'memcache.enable_log' => false,
Expand All @@ -190,15 +199,6 @@ public function provideLoggerByConfiguration()
],
'test',
],
[
true,
true,
[
'memcache.client' => 'mock',
'memcache.enable_log' => true,
'memcache.logger' => new TestLogger(),
],
],
[
false,
false,
Expand Down

0 comments on commit c5ecada

Please sign in to comment.