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

DefaultConfigCustomizerPluginFactoryTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 4 1
A createsProperService() 0 12 1
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