AmountFilterTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 0
cbo 2
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFiltersValueAsExpected() 0 12 1
A testShouldNotFilterEmpty() 0 8 1
1
<?php
2
3
namespace ZFBrasil\Test\DoctrineMoneyModule\Filter;
4
5
use PHPUnit_Framework_TestCase as TestCase;
6
use ZFBrasil\DoctrineMoneyModule\Filter\AmountFilter;
7
8
/**
9
 * @author  Gabriel Schmitt <[email protected]>
10
 * @license MIT
11
 */
12
class AmountFilterTest extends TestCase
13
{
14
    public function testFiltersValueAsExpected()
15
    {
16
        $filter = new AmountFilter();
17
18
        $this->assertSame(20000, $filter->filter(200));
19
20
        $this->assertSame(20000, $filter->filter('200'));
21
22
        $this->assertSame(0, $filter->filter(0));
23
24
        $this->assertSame(0, $filter->filter('0'));
25
    }
26
27
    public function testShouldNotFilterEmpty()
28
    {
29
        $filter = new AmountFilter();
30
31
        $this->assertNull($filter->filter(''));
32
33
        $this->assertNull($filter->filter(null));
34
    }
35
}
36