AmountFilterTest::testFiltersValueAsExpected()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
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