Completed
Push — master ( 2c8981...1ecbe4 )
by Kamil
23:19
created

PercentageExtensionSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 22
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_initializable() 0 4 1
A it_is_twig_extension() 0 4 1
A it_returns_float_number_as_percentage() 0 4 1
A it_has_name() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace spec\Sylius\Bundle\UiBundle\Twig;
13
14
use PhpSpec\ObjectBehavior;
15
use Prophecy\Argument;
16
17
/**
18
 * @author Anna Walasek <[email protected]>
19
 */
20
class PercentageExtensionSpec extends ObjectBehavior
21
{
22
    function it_is_initializable()
23
    {
24
        $this->shouldHaveType('Sylius\Bundle\UiBundle\Twig\PercentageExtension');
25
    }
26
27
    function it_is_twig_extension()
28
    {
29
        $this->shouldHaveType(\Twig_Extension::class);
30
    }
31
32
    function it_returns_float_number_as_percentage()
33
    {
34
        $this->getPercentage(0.112)->shouldReturn("11.2 %");
35
    }
36
37
    function it_has_name()
38
    {
39
        $this->getName()->shouldReturn('sylius_percentage');
40
    }
41
}
42