TerminalTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 40
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGettersSetters() 0 20 1
A testUpdateSlug() 0 8 1
A getTerminal() 0 4 1
1
<?php
2
3
namespace Loevgaard\DandomainAltapayBundle\Tests\Entity;
4
5
use Loevgaard\DandomainAltapayBundle\Entity\Terminal;
6
use PHPUnit\Framework\TestCase;
7
8
class TerminalTest extends TestCase
9
{
10
    public function testGettersSetters()
11
    {
12
        $terminal = $this->getTerminal();
13
14
        $terminal
15
            ->setId(1)
16
            ->setTitle('title')
17
            ->setSlug('sluuuug')
18
            ->setCountry('DK')
19
            ->setCurrencies(['EUR', 'DKK'])
20
            ->setNatures(['Nature 1', 'Nature 2'])
21
        ;
22
23
        $this->assertSame(1, $terminal->getId());
24
        $this->assertSame('title', $terminal->getTitle());
25
        $this->assertSame('sluuuug', $terminal->getSlug());
26
        $this->assertSame('DK', $terminal->getCountry());
27
        $this->assertSame(['EUR', 'DKK'], $terminal->getCurrencies());
28
        $this->assertSame(['Nature 1', 'Nature 2'], $terminal->getNatures());
29
    }
30
31
    public function testUpdateSlug()
32
    {
33
        $terminal = $this->getTerminal();
34
        $terminal->setTitle('test title !"#(€ EUR');
35
        $terminal->updateSlug();
36
37
        $this->assertEquals('test-title-eur', $terminal->getSlug());
38
    }
39
40
    /**
41
     * @return Terminal
42
     */
43
    public function getTerminal()
44
    {
45
        return $this->getMockForAbstractClass(Terminal::class);
46
    }
47
}
48