Completed
Push — master ( d5b8a7...cdd9b5 )
by Dispositif
02:37
created

OuvrageTemplateTest::provideSpanInitial()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
rs 10
1
<?php
2
/**
3
 * This file is part of dispositif/wikibot application
4
 * 2019 : Philippe M. <[email protected]>
5
 * For the full copyright and MIT license information, please view the LICENSE file.
6
 */
7
8
declare(strict_types=1);
9
10
namespace App\Domain\Models\Wiki\Tests;
11
12
use App\Domain\Models\Wiki\OuvrageTemplate;
13
use PHPUnit\Framework\TestCase;
14
15
class OuvrageTemplateTest extends TestCase
16
{
17
    /**
18
     * @dataProvider provideSpanInitial
19
     */
20
    public function testSpanInitial(array $data, ?string $expected)
21
    {
22
        $ouvrage = new OuvrageTemplate();
23
        $ouvrage->hydrate($data);
24
25
        $this::assertSame(
26
            $expected,
27
            $ouvrage->getSpanInitial()
28
        );
29
    }
30
31
    public function provideSpanInitial()
32
    {
33
        return [
34
            [
35
                ['id' => 'Bla'],
36
                'Bla',
37
            ],
38
            [
39
                ['auteur' => 'Dupont', 'année' => '1989'],
40
                'Dupont1989',
41
            ],
42
            [
43
                ['auteur1' => 'Dupont', 'auteur2'=>'Durand', 'année' => '1989'],
44
                'DupontDurand1989',
45
            ],
46
        ];
47
    }
48
49
}
50