Passed
Push — master ( ddb420...13a60b )
by Dispositif
02:30
created

InfoTraitTest::testInfoTrait()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

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