Completed
Push — master ( b53e51...1009f9 )
by Alejandro
04:13 queued 38s
created

createsProperService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace ShlinkioTest\Shlink\CLI\Install\Plugin\Factory;
3
4
use PHPUnit\Framework\TestCase;
5
use Shlinkio\Shlink\CLI\Install\Plugin\ApplicationConfigCustomizerPlugin;
6
use Shlinkio\Shlink\CLI\Install\Plugin\Factory\DefaultConfigCustomizerPluginFactory;
7
use Shlinkio\Shlink\CLI\Install\Plugin\LanguageConfigCustomizerPlugin;
8
use Symfony\Component\Console\Helper\QuestionHelper;
9
use Zend\ServiceManager\ServiceManager;
10
11
class DefaultConfigCustomizerPluginFactoryTest extends TestCase
12
{
13
    /**
14
     * @var DefaultConfigCustomizerPluginFactory
15
     */
16
    protected $factory;
17
18
    public function setUp()
19
    {
20
        $this->factory = new DefaultConfigCustomizerPluginFactory();
21
    }
22
23
    /**
24
     * @test
25
     */
26
    public function createsProperService()
27
    {
28
        $instance = $this->factory->__invoke(new ServiceManager(['services' => [
29
            QuestionHelper::class => $this->prophesize(QuestionHelper::class)->reveal(),
30
        ]]), ApplicationConfigCustomizerPlugin::class);
31
        $this->assertInstanceOf(ApplicationConfigCustomizerPlugin::class, $instance);
32
33
        $instance = $this->factory->__invoke(new ServiceManager(['services' => [
34
            QuestionHelper::class => $this->prophesize(QuestionHelper::class)->reveal(),
35
        ]]), LanguageConfigCustomizerPlugin::class);
36
        $this->assertInstanceOf(LanguageConfigCustomizerPlugin::class, $instance);
37
    }
38
}
39