Completed
Push — master ( 866487...6bcace )
by Dorian
04:50
created

StarWarsExtensionTest::getSimpleMethodsData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Gnutix\StarWarsLibrary\Tests\Unit\Twig\Extension;
4
5
use Gnutix\Kernel\Tests\Unit\PhpUnitSimpleTestCase;
6
use Gnutix\StarWarsLibrary\Twig\Extension\StarWarsExtension;
7
8
/**
9
 * Star Wars Twig Extension Tests
10
 */
11
final class StarWarsExtensionTest extends PhpUnitSimpleTestCase
12
{
13
    /**
14
     * Set up the instance
15
     */
16
    protected function setUp(): void
17
    {
18
        $this->instance = new StarWarsExtension();
19
    }
20
21
    public function getSimpleMethodsData()
22
    {
23
        $bby = '&nbsp;<abbr title="Before the Battle of Yavin IV">BBY</abbr>';
24
        $aby = '&nbsp;<abbr title="After the Battle of Yavin IV">ABY</abbr>';
25
26
        return [
27
            ['transformToStarWarsDate', '', ''],
28
            ['transformToStarWarsDate', '42', '42'.$aby],
29
            ['transformToStarWarsDate', '42.5', '42.5'.$aby],
30
            ['transformToStarWarsDate', '-1337', '1337'.$bby],
31
            ['transformToStarWarsDate', '-1337.25', '1337.25'.$bby],
32
            ['transformToStarWarsDate', '42 BBY', '42'.$bby],
33
            ['transformToStarWarsDate', '-1337 BBY', '1337'.$bby],
34
            ['transformToStarWarsDate', '1337 BBY - 42 ABY', '1337'.$bby.' - 42'.$aby],
35
        ];
36
    }
37
}
38