Used class from shlink-installer instead of duplicated local version

This commit is contained in:
Alejandro Celaya 2019-08-11 20:34:55 +02:00
parent d734d1a3b3
commit d96023d063
3 changed files with 2 additions and 50 deletions

View file

@ -8,6 +8,7 @@ use GeoIp2\Database\Reader;
use Shlinkio\Shlink\CLI\Util\GeolocationDbUpdater;
use Shlinkio\Shlink\Common\Doctrine\NoDbNameConnectionFactory;
use Shlinkio\Shlink\Core\Service;
use Shlinkio\Shlink\Installer\Factory\ProcessHelperFactory;
use Shlinkio\Shlink\IpGeolocation\GeoLite2\DbUpdater;
use Shlinkio\Shlink\IpGeolocation\Resolver\IpLocationResolverInterface;
use Shlinkio\Shlink\PreviewGenerator\Service\PreviewGenerator;
@ -23,7 +24,7 @@ return [
'dependencies' => [
'factories' => [
SymfonyCli\Application::class => Factory\ApplicationFactory::class,
SymfonyCli\Helper\ProcessHelper::class => Factory\ProcessHelperFactory::class,
SymfonyCli\Helper\ProcessHelper::class => ProcessHelperFactory::class,
PhpExecutableFinder::class => InvokableFactory::class,
GeolocationDbUpdater::class => ConfigAbstractFactory::class,

View file

@ -1,20 +0,0 @@
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\CLI\Factory;
use Symfony\Component\Console\Helper;
class ProcessHelperFactory
{
public function __invoke(): Helper\ProcessHelper
{
$processHelper = new Helper\ProcessHelper();
$processHelper->setHelperSet(new Helper\HelperSet([
new Helper\FormatterHelper(),
new Helper\DebugFormatterHelper(),
]));
return $processHelper;
}
}

View file

@ -1,29 +0,0 @@
<?php
declare(strict_types=1);
namespace ShlinkioTest\Shlink\CLI\Factory;
use PHPUnit\Framework\TestCase;
use Shlinkio\Shlink\Installer\Factory\ProcessHelperFactory;
class ProcessHelperFactoryTest extends TestCase
{
/** @var ProcessHelperFactory */
private $factory;
public function setUp(): void
{
$this->factory = new ProcessHelperFactory();
}
/** @test */
public function createsTheServiceWithTheProperSetOfHelpers(): void
{
$processHelper = ($this->factory)();
$helperSet = $processHelper->getHelperSet();
$this->assertCount(2, $helperSet);
$this->assertTrue($helperSet->has('formatter'));
$this->assertTrue($helperSet->has('debug_formatter'));
}
}