CustomConfigTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A formatProvider() 0 4 1
A testCustomConfig() 0 8 1
1
<?php
2
3
namespace MewesK\TwigExcelBundle\Tests\Functional;
4
5
/**
6
 * Class CustomConfigTest
7
 * @package MewesK\TwigExcelBundle\Tests\Functional
8
 */
9
class CustomConfigTest extends AbstractControllerTest
10
{
11
    protected static $CONFIG_FILE = 'config_custom.yml';
12
    protected static $TEMP_PATH = '/../../tmp/functional/config/';
13
14
    //
15
    // PhpUnit
16
    //
17
18
    /**
19
     * @return array
20
     */
21
    public function formatProvider()
22
    {
23
        return [['xlsx']];
24
    }
25
26
    //
27
    // Tests
28
    //
29
30
    /**
31
     * @param string $format
32
     * @throws \Exception
33
     *
34
     * @dataProvider formatProvider
35
     */
36
    public function testCustomConfig($format)
37
    {
38
        $document = $this->getDocument(static::$router->generate('test_default', ['templateName' => 'simple', '_format' => $format]), $format);
39
        static::assertNotNull($document, 'Document does not exist');
40
41
        static::assertFalse(static::$kernel->getContainer()->getParameter('mewes_k_twig_excel.pre_calculate_formulas'), 'Unexpected parameter');
42
        static::assertStringEndsWith('tmp/phpexcel', static::$kernel->getContainer()->getParameter('mewes_k_twig_excel.disk_caching_directory'), 'Unexpected parameter');
43
    }
44
}
45