Skip to content

Commit

Permalink
Remove deprecated ContainerHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar authored and Milan Felix Šulc committed Jun 21, 2018
1 parent a63c6a5 commit b2b797d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 78 deletions.
5 changes: 1 addition & 4 deletions src/DI/ConsoleExtension.php
Expand Up @@ -5,7 +5,6 @@
use Contributte\Console\Application;
use Contributte\Console\CommandLoader\ContainerCommandLoader;
use Contributte\Console\Exception\Logical\InvalidArgumentException;
use Contributte\Console\Helper\ContainerHelper;
use Nette\DI\Compiler;
use Nette\DI\CompilerExtension;
use Nette\DI\ServiceCreationException;
Expand All @@ -31,9 +30,7 @@ class ConsoleExtension extends CompilerExtension
'catchExceptions' => null,
'autoExit' => null,
'helperSet' => null,
'helpers' => [
ContainerHelper::class,
],
'helpers' => [],
'lazy' => false,
];

Expand Down
66 changes: 0 additions & 66 deletions src/Helper/ContainerHelper.php

This file was deleted.

15 changes: 7 additions & 8 deletions tests/cases/DI/ConsoleExtension.HelperSet.phpt
Expand Up @@ -11,6 +11,7 @@ use Nette\DI\ContainerLoader;
use Symfony\Component\Console\Application;
use Tester\Assert;
use Tester\FileMock;
use Tests\Fixtures\FooHelperSet;

require_once __DIR__ . '/../../bootstrap.php';

Expand All @@ -25,8 +26,7 @@ test(function (): void {
$container = new $class();

// 4 default helpers
// 1 container helper
Assert::count(5, $container->getByType(Application::class)->getHelperSet()->getIterator());
Assert::count(4, $container->getByType(Application::class)->getHelperSet()->getIterator());
});

// Own helperSet
Expand All @@ -43,8 +43,8 @@ test(function (): void {
/** @var Container $container */
$container = new $class();

// 1 container helper
Assert::count(1, $container->getByType(Application::class)->getHelperSet()->getIterator());
// Our helper set
Assert::type(FooHelperSet::class, $container->getByType(Application::class)->getHelperSet());
});

// Own helperSet as service
Expand All @@ -64,8 +64,8 @@ test(function (): void {
/** @var Container $container */
$container = new $class();

// 1 container helper
Assert::count(1, $container->getByType(Application::class)->getHelperSet()->getIterator());
// Our helper set
Assert::type(FooHelperSet::class, $container->getByType(Application::class)->getHelperSet());
});

// Own helper
Expand All @@ -84,7 +84,6 @@ test(function (): void {
$container = new $class();

// 4 default helpers
// 1 container helper
// 1 foo helper
Assert::count(6, $container->getByType(Application::class)->getHelperSet()->getIterator());
Assert::count(5, $container->getByType(Application::class)->getHelperSet()->getIterator());
});

0 comments on commit b2b797d

Please sign in to comment.