MyImportedRow
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 3
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 0
lcom 0
cbo 0
dl 0
loc 3
c 0
b 0
f 0
1
<?php
2
3
namespace Mathielen\ImportEngineBundle\Tests\DependencyInjection;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
7
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
8
9
class CompareTest extends AbstractTest
10
{
11 View Code Duplication
    private function getXmlDefinitions($filename)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
    {
13
        $this->setUp();
14
        $container = $this->container;
15
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/Xml/'));
16
        $loader->load("$filename.xml");
17
18
        $container->loadFromExtension('mathielen_import_engine');
19
        $container->compile();
20
21
        return $container->getDefinitions();
22
    }
23
24 View Code Duplication
    private function getYamlDefinitions($filename)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $this->setUp();
27
        $container = $this->container;
28
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/Yaml/'));
29
        $loader->load("$filename.yml");
30
31
        $container->loadFromExtension('mathielen_import_engine');
32
        $container->compile();
33
34
        return $container->getDefinitions();
35
    }
36
37
    public function testFullXmlAndYamlSame()
38
    {
39
        $this->assertEquals($this->getYamlDefinitions('full'), $this->getXmlDefinitions('full'));
40
        $this->assertEquals($this->getYamlDefinitions('medium'), $this->getXmlDefinitions('medium'));
41
        $this->assertEquals($this->getYamlDefinitions('minimum'), $this->getXmlDefinitions('minimum'));
42
    }
43
}
44
45
class MyImportedRow
46
{
47
}
48