Passed
Push — master ( bacc5f...5eccc7 )
by Dispositif
02:22
created

InfoTraitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 1
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\WikiTemplateFactory;
13
use Exception;
14
use PHPUnit\Framework\TestCase;
15
16
class InfoTraitTest extends TestCase
17
{
18
    /**
19
     * @throws Exception
20
     */
21
    public function testInfoTrait()
22
    {
23
        $ouvrage = WikiTemplateFactory::create('ouvrage');
24
        $ouvrage->hydrate(
25
            [
26
                'auteur' => 'Michou',
27
                'titre' => 'Au soleil',
28
            ]
29
        );
30
31
        $ouvrage->setInfos(['test' => 'bla']);
32
        $this::assertSame(
33
            ['test' => 'bla'],
34
            $ouvrage->getInfos()
35
        );
36
37
        $ouvrage->setInfo('toto', 'bla2');
38
        $this::assertSame(
39
            'bla2',
40
            $ouvrage->getInfo('toto')
41
        );
42
    }
43
}
44