CustomConfigTest::testCustomConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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